nand flash測試載入器集

來源:互聯網
上載者:User

<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: 03c00000 00020000 "cache"
mtd6: 031c0000 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 (768K)
mtd.erasesize = 131072 (128K)
mtd.writesize = 2048 (2K)
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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.