We are having problems using fw_setenv to set U-boot environment variables in nand from linux.
Here is the nand partition layout:-
>cat /proc/mtd
dev: size erasesize name
mtd0: 00020000 00020000 "SPL"
mtd1: 00020000 00020000 "SPL.backup1"
mtd2: 00020000 00020000 "SPL.backup2"
mtd3: 00020000 00020000 "SPL.backup3"
mtd4: 001e0000 00020000 "U-Boot"
mtd5: 00020000 00020000 "U-Boot Env"
mtd6: 04000000 00020000 "Kernel+initramfs"
mtd7: 0bd80000 00020000 "File System"
/etc/fw_env.config:-
/dev/mtd5 0x0000 0x2000 0x20000
fw_printenv from linux appears to work ok.
If I create a new environment variable using fw_setenv such as...
>fw_setenv test 123
then fw_printenv displays the new variable as expected.
However, when I reboot, U-boot indicates 'bad CRC, using default environment'.
It suggests a mismatch between the ECC method used by U-boot to read environment variables
and that used by fw_setenv when saving.
We are using:-
linux-3.1.0-psp04.06.00.03.sdk
u-boot-2011.09-psp04.06.00.03
I have looked through a number of forums and although I've found others with
similar issues, I have not found a solution.
Any help appreciated.