Monday, October 23, 2017

dump mtd block in linux kernel

uboot$ smem
kernel$ cat /proc/mtd
kernel$ ls -l /dev/
kernel$ hexdump -C /dev/mtdblock7 -s 4096 -n 1024
(offset 4096 == 0x1000, len = 1024)

dd if=/dev/mtdblock7 of=/root/data.bin count=64 bs=1024

dd if=/dev/mtd7 of=/root/data.bin bs=32 count=377 skip=128

bs: block size to read at once
count: number of 'bs' to run
* total size = bs * count = 64KB


* flash erase on kernel
kernel$flash_erase /dev/mtdblock7

* flash copy on kernel
kernel$ flashcp u-boot-env /dev/mtdblock7

No comments:

Post a Comment