我用的nadflash1个page时2k,也就是0x800
下面对flash读取,看一下到底读10个字节和1个字节有啥区别
[root@EmbedSky arm-linux]# ./nanddump -s 0x100800 -l 10 -f 10.txt /dev/mtd0
ECC failed: 0
ECC corrected: 0
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00100800 and ending at 0x0010080a...//这个地方可以看到确实读了10个字节
[root@EmbedSky arm-linux]# ./nanddump --help
Usage: nanddump [OPTIONS] MTD-device
Dumps the contents of a nand mtd partition.
-h --help Display this help and exit
--version Output version information and exit
--bb=METHOD Choose bad block handling method (see below).
-a --forcebinary Force printing of binary data to tty
-c --canonicalprint Print canonical Hex+ASCII dump
-f file --file=file Dump to file
-l length --length=length Length
-n --noecc Read without error correction
--omitoob Omit OOB data (default)
-o --oob Dump OOB data
-p --prettyprint Print nice (hexdump)
-q --quiet Don't display progress and status messages
-s addr --startaddress=addr Start address
--bb=METHOD, where METHOD can be `padbad', `dumpbad', or `skipbad':
padbad: dump flash data, substituting 0xFF for any bad blocks
dumpbad: dump flash data, including any bad blocks
skipbad: dump good data, completely skipping any bad blocks (default)
[root@EmbedSky arm-linux]# disconnect::Already Disconnected..
[root@EmbedSky arm-linux]# ./nanddump -s 0x100800 -l 1 -f 1.txt /dev/mtd0
ECC failed: 0
ECC corrected: 0
Number of bad blocks: 0
Number of bbt blocks: 0
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00100800 and ending at 0x00100801..//这个地方也确实读了一个字节
下面来看看结果吧,都是读了一个page的内容