AnsweredAssumed Answered

Bad CRC after saving uboot Environment

Question asked by Thinh Nguyen on Apr 15, 2020
Latest reply on May 8, 2020 by Thinh Nguyen

I created a uboot environment file by this command:

$ mkenvimage -s 0x4200 -o uEnv.bin uboot-env.txt

 

Then I load this uboot env file in uboot command line:

=> fatload mmc 3:1 0x12100000 uEnv.bin
16896 bytes read in 15 ms (1.1 MiB/s)
=> env import -c 0x12100000 0x4200
=> env print bootcompleted
bootcompleted=true

 

It works, because the value of var bootcompleted is correct. Afterthat, I would like to change the value of bootcompleted and save to uEnv.bin

 

=> setenv bootcompleted false
=> env export -c 0x12100000 -s 0x4200
=> fatwrite mmc 3:1 0x12100000 uEnv.bin 0x4200
16896 bytes written

Then, I reboot the board and import uboot env from uEnv.bin again

 

=> fatload mmc 3:1 0x12100000 uEnv.bin
16896 bytes read in 18 ms (916 KiB/s)
=> env import -c 0x12100000 0x4200
## Error: bad CRC, import failed

 

It said that imported failed because bad CRC. how to fix this problem? Please advise! 

Outcomes