All of lore.kernel.org
 help / color / mirror / Atom feed
* nandwrite vs. flashcp when writing image to mtd device
@ 2019-03-20  6:45 Shibin George
  2019-03-21  7:54 ` David Oberhollenzer
  0 siblings, 1 reply; 2+ messages in thread
From: Shibin George @ 2019-03-20  6:45 UTC (permalink / raw)
  To: linux-mtd

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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-03-21  7:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20  6:45 nandwrite vs. flashcp when writing image to mtd device Shibin George
2019-03-21  7:54 ` David Oberhollenzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.