A semiconductor device wherein a flash memory of lower cost per bit, such as NAND type, is used as a boot device, and the same boot program is stored in each of a plurality of blocks in the flash memory. A flash memory controller, when receiving from a CPU an access to a boot program storage area, outputs, to the CPU, data read from the corresponding page, only if it determines that the corresponding block is not defective from a determination based on ECC in that data and from a determination based on block information. Otherwise, the flash memory controller reads the boot program stored in the next block and performs anew a determination as to whether the block is defective or not. |