I want to write an image to a mtd device. Here is the /proc/mtd
entry for the mtd device.
/ # cat /proc/mtd
dev: size erasesize name
...
mtd10: 007c0000 00040000 "recovery"
...
First I performed a flash_eraseall
on /dev/mtd10 which was successful.
Then, I tried flashcp
:
flashcp /path/to/image /dev/mtd10
This command fails with the error:
While erasing blocks from 0x00000000-0x00680000 on /dev/mtd10: Invalid argument
dmesg has the following error:
msm_nand_erase: unsupported erase len, 6815744
But if I use nandwrite
to write the image, the write works fine:
/ # 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
So is nandwrite
the recommended way to write a raw image to a mtd device?
User contributions licensed under CC BY-SA 3.0