Hi :
My system Uboot + Linux run on OMAPl138. In Uboot step, write Linux to spi flash is ok. Uboot write command : sf probe 0, sf erase 'flashstartaddr' 'erasesize', sf write 'memorystartaddr' 'flashstartaddr' 'writesize'.
Then linux os startup ok. Write spiflash error In my application. Source code :
fd = open("/dev/mtdblock5", O_RDWR);
if (fd < 0)
{
printf("open err.\n");
goto ERR_LABEL;
}
ret = write(fd, acwritebuf, 256);
if (ret != 256)
{
printf("write err, ret = %d, err = %d\n", ret, errno);
perror("write err");
goto ERR_LABEL;
}
close(fd);
Result :
write err, ret = -1, err = 1
write err: Operation not permitted
Flash mtd infomation :
0x000000000000-0x000000010000 : "UBL"
0x000000010000-0x000000090000 : "U-Boot"
0x000000090000-0x0000000a0000 : "U-Boot-Env"
0x0000000a0000-0x000000320000 : "Kernel"
0x000000320000-0x000000720000 : "Filesystem"
0x000000700000-0x000000780000 : "ImageData0"
0x000000780000-0x000000800000 : "ImageData1"