Erasing Flash NOR: ioctl(MEMUNLOCK) return status?
问题 I'm trying to erase a NOR Flash memory with Linux MTD driver in C... I'm confused about the return status from the ioctl(MEMUNLOCK) call which returns an error even if ioctl(MEMERASE) is successful after it. The following code displays the warning message but works (i.e. the Flash block has been erased): int erase_MTD_Pages(int fd, size_t size, off_t offset) { mtd_info_t mtd_info; erase_info_t ei; ioctl(fd, MEMGETINFO, &mtd_info); ei.length = mtd_info.erasesize; for(ei.start = offset; ei