<1> download MTD-utils (v1.4.1)
Http://git.infradead.org/mtd-utils.git
Git clone git: // git.infradead.org/mtd-utils.git
<2> compile
Mtd_debug:
Arm-None-Linux-gnueabi-gcc-static mtd_debug.c-O mtd_debug-I./include
Nanddump:
Arm-None-Linux-gnueabi-gcc-C lib/libmtd. C-I./include
Arm-None-Linux-gnueabi-gcc-C lib/libmtd_legacy.c-I./include
Arm-None-Linux-gnueabi-gcc-static nanddump. c libmtd. O libmtd_legacy.o-O nanddump-I./include
<3> How to Use mtd_debug
# Cat/proc/MTD
Dev: Size erasesize name
Mtd0: 000c0000 00020000 "bootloader"
Mtd1: 00040000 00020000 "Misc"
Mtd2: 01080000 00020000 "recovery"
Mtd3: 00600000 00020000 "kernel"
Mtd4: 06000000 00020000 "system"
Mtd5: 03c000000 00020000 "cache"
Mtd6: 031c00000 00020000 "userdata"
Mtd7: 00060000 00020000 "NVM"
A). Read some information from MTD layer.
#./Mtd_debug info/dev/MTD/mtd0
MTD. type = mtd_nandflash
MTD. Flags = mtd_cap_rom
MTD. size = 786432 (768 K)
MTD. erasesize = 131072 (128 K)
MTD. writesize = 2048 (2 k)
MTD. oobsize = 64
Regions = 0
B). Erase the NAND Flash partitions.
#./Mtd_debug Erase/dev/MTD/mtd7 0 0x00060000
Erased 393216 bytes from address 0x00000000 in Flash
<4> How to Use the nanddump
#./Nanddump
Usage: nanddump [Options] MTD-Device
Dumps the contents of a nand mtd partition.
-- Help display this help and exit
-- Version output version information and exit
-F file -- file = file dump to file
-I -- ignoreerrors ignore errors
-L length -- length = length Length
-N -- noecc read without error correction
-O -- omitoob omit OOB data
-B -- omitbad omit Bad blocks from the dump
-P -- prettyprint print nice (hexdump)
-S ADDR -- startaddress = ADDR start address