Project

General

Profile

Ecc Bitflips in u-boot image

Checking for bitflips in linux

The -n option should allow you to disable ecc when reading the image. So you could do the following:

root@mityarm-335x ~ $ cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00800000 00010000 "NOR User Defined" 
mtd1: 00020000 00020000 "SPL" 
mtd2: 00020000 00020000 "SPL.backup1" 
mtd3: 00020000 00020000 "SPL.backup2" 
mtd4: 00020000 00020000 "SPL.backup3" 
mtd5: 001e0000 00020000 "U-Boot" 
mtd6: 00020000 00020000 "U-Boot Env" 
mtd7: 00500000 00020000 "Kernel" 
mtd8: 0f880000 00020000 "File System" 
root@mityarm-335x ~ $ nanddump -f /tmp/u-boot.dmp /dev/mtd5 -n
Block size 131072, page size 2048, OOB size 64
Dumping data starting at 0x00000000 and ending at 0x001e0000...
root@mityarm-335x ~ $ nanddump -f /tmp/u-boot_corrected.dmp /dev/mtd5
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 0x00000000 and ending at 0x001e0000...
root@mityarm-335x ~ $ cmp /tmp/u-boot.dmp /tmp/u-boot_corrected.dmp
root@mityarm-335x ~ $

For reference:

root@mityarm-335x ~ $ 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
-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
-N         --noskipbad          Read without bad block skipping
-o         --omitoob            Omit oob data
-b         --omitbad            Omit bad blocks from the dump
-p         --prettyprint        Print nice (hexdump)
-q         --quiet              Don't display progress and status messages
-s addr    --startaddress=addr  Start address

Go to top
Add picture from clipboard (Maximum size: 1 GB)