我想将图像写入mtd设备。这是mtd设备的/proc/mtd
条目。
/ # cat /proc/mtd
dev: size erasesize name
...
mtd10: 007c0000 00040000 "recovery"
...
首先,我在/ dev / mtd10上执行了flash_eraseall
,成功了。
然后,我尝试了flashcp
:
flashcp /path/to/image /dev/mtd10
此命令失败,并显示以下错误:
While erasing blocks from 0x00000000-0x00680000 on /dev/mtd10: Invalid argument
dmesg出现以下错误:
msm_nand_erase: unsupported erase len, 6815744
但是,如果我使用nandwrite
来写图像,写就可以了:
/ # nandwrite -p /dev/mtd10 /path/to/image
Writing data to block 0 at offset 0x0
Writing data to block 1 at offset 0x40000
...
Writing data to block 5 at offset 0x140000
...
Writing data to block 17 at offset 0x440000
Writing data to block 18 at offset 0x480000
Writing data to block 19 at offset 0x4c0000
...
Writing data to block 24 at offset 0x600000
Writing data to block 25 at offset 0x640000
nandwrite
是推荐将原始映像写入mtd设备的推荐方法吗?