nandwrite vs. flashcp when writing image to mtd device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I wanted to write an image to a mtd device. Here is the /proc/mtd
entry for that 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?
Any reason why flashcp wouldn't work? One query I have is /proc/mtd
lists that the erasesize if 00040000 (262144) but flashcp is reporting
erase len as 6815744..

Appreciate any help in this matter..

Regards,
Shibin George

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux