1 (edited by RomMon 2011-04-17 14:02:11)

Topic: mtd write cfe.bin /dev/mtd0 not working

Hi,

Can someone have a look why "mtd write cfe.bin /dev/mtd0" is not working?
I'm using trunk-26400 at the moment.

I found a number of references [1] [2] that this used to work, but now it bricks my router.

root@OpenWrt:/tmp# hexdump -vC Patched-cfe-for-Davolink.bin | head -n 2
00000000  10 00 02 78 00 00 00 00  00 00 00 00 00 00 00 00  |...x............|
00000010  00 00 00 05 00 00 00 00  00 00 00 00 00 00 00 00  |................|
root@OpenWrt:/tmp# mtd write Patched-cfe-for-Davolink.bin /dev/mtd0
Unlocking /dev/mtd0 ...

Writing from Patched-cfe-for-Davolink.bin to /dev/mtd0 ...
root@OpenWrt:/tmp# dd if=/dev/mtd0 of=/tmp/boot.backup
128+0 records in
128+0 records out
root@OpenWrt:/tmp# hexdump -vC boot.backup | head -n 3
00000000  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00000010  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
00000020  ff ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|
root@OpenWrt:/tmp#

So it seems to erase it, but not write to it.

Fortunately dd command does work.

dd if=/dev/mtd0 of=/tmp/boot.backup
root@OpenWrt:/tmp#
root@OpenWrt:/tmp#
root@OpenWrt:/tmp# dd if=/tmp/Patched-cfe-for-Davolink.bin of=/dev/mtd0
128+0 records in
128+0 records out
root@OpenWrt:/tmp# dd if=/dev/mtd0 of=/tmp/boot.backup
128+0 records in
128+0 records out
root@OpenWrt:/tmp# hexdump -vC boot.backup | head -n 2
00000000  10 00 02 78 00 00 00 00  00 00 00 00 00 00 00 00  |...x............|
00000010  00 00 00 05 00 00 00 00  00 00 00 00 00 00 00 00  |................|
root@OpenWrt:/tmp#

[1] http://lostscrews.com/viewtopic.php?f=16&t=61&sid=32a143460b66878c44b39a2272e222b7
[2] http://oldwiki.openwrt.org/Hardware(2f)Davolink(2f)DV201AMR.html

2 (edited by Orca 2011-04-17 14:16:22)

Re: mtd write cfe.bin /dev/mtd0 not working

No idea. Once you found out, maybe you could write about it.   http://wiki.openwrt.org/doc/techref/mtd#mtd.vs.dd
or http://wiki.openwrt.org/doc/techref/mtd#differences.between.mtd.and.dd


Here is something regarding blocksize with dd:  https://forum.openwrt.org/viewtopic.php?pid=116205#p116205