hi marcel.tx,
I am trying to make it work with option 2. So far, I figured out the commands I need to program the u-boot env variables to load flash the new U-Boot and Linux Kernel. Now, I need to figure out modifying the U-Boot env variables from my old Linux Kernel, then I would be good to go.
Our old system consist the following:
BSP 2.2 Beta, U-Boot (2014.04) Linux Kernel 3.0.15.
I am trying to use tool fw_printenv/fw_setenv in Linux. However, this tool does not come with the BSP 2.2. I tried to use the tools in the later BSP, such as 2.4, 2.5, 2.6, 2.7 and 2.8. However, I got error while reading/writing the U-Boot Env.
my partitions are the following:
device nand0 , # parts = 6
# name size offset mask_flags
0: vf-bcb 0x00020000 0x00000000 1
1: u-boot 0x00160000 0x00020000 1
2: u-boot-env 0x00080000 0x00180000 1
3: kernel-ubi 0x00800000 0x00200000 0
4: rootfs-ubi 0x01000000 0x00a00000 0
5: userfs-ubi 0x06600000 0x01a00000 0
Device 0: nand0, sector size 128 KiB
In Linux,
root@ECU:~# cat /sys/class/mtd/mtd2/name
# u-boot-env
So, I know mtd2 is the right partition.
I created the /etc/fw_env.config to be
#MTD device name Device offset Env. size Flash sector size Number of sectors
/dev/mtd2 0x00000000 0x00080000 0x20000 4
When performing the operations, I got the following
root@ECU:~# /sbin/fw_printenv
Warning: Bad CRC, using default environment
bootcmd=run ubiboot; run sdboot; run nfsboot
... .... ...
root@ECU:~# /sbin/fw_setenv bootdelay 3
Warning: Bad CRC, using default environment
Can't open /dev/mtd2: Permission denied
Error: can't write fw_env to flash
I did get into the U-Boot prompt, modified one variable, and performed saveenv to make sure there is a saved copy in the flash. I did reset to verify that the new variable is being saved.
I am thinking
1)the setting on the fw_env.config is not correct
OR/AND
- fw_setenv tools is not the same version (CRC different) with the old BSP.
Please advise.