This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/PROCESSOR-SDK-AM335X: U-boot environment area read issue

Part Number: PROCESSOR-SDK-AM335X


Tool/software: Linux

I hope this is the correct area for a problem I have regarding flashing and reading the u-boot env area to/from nand flash. Here is the sequence  - any help would be appreciated

1. I Use u-boot's mkenvimage to generate a binary data file from a text file e.g ./mkenvimage -s 8192 -o env.bin  env.txt

2. The environment variables are defined to go onto partition 5 so /etc/fw_env.config has this  defined as follows:

MTD Device Name    Device Offset    Env. size    Flash Sector Size     Number of sectors

/dev/mtd5                   0x0000              0x2000       0x20000                   1   

3. In Linux (SD card), write  env.bin to nand flash as follows:

/usr/sbin/flash_erase /dev/mtd5 0 0

/usr/sbin/nandwrite -p /dev/mtd5 env.bin

All of this succeeds.

When I then try to boot from nand flash I get the following error:

when u-boot reads the env area.

Error: Bad compare! failed

..and proceeds to use the default environment.

It seems that it is failing because the calculated ecc differs fro the read ecc.

My question is, how is the ecc generated and where do I put a valid ecc count for my env.bin so that

the environment area is read correctly by u-boot.

Regards,

A Hart