U-BOOT environment variables not stored in u-boot-env partition
Hi,
I am confused how to correctly set u-boot environment variables in a system based on OpenST Linux 4.1 and follows DK2 settings.
The partition layout looks like this:
#Opt Id Name Type IP Offset Binary
- 0x01 fsbl1-boot Binary none 0x0 arm-trusted-firmware/tf-a-stm32mp157f-nexio-usb.stm32
- 0x03 fip-boot Binary none 0x0 fip/fip-stm32mp157f-nexio-trusted.bin
P 0x04 fsbl1 Binary mmc0 0x00004400 arm-trusted-firmware/tf-a-stm32mp157f-nexio-sdcard.stm32
P 0x05 fsbl2 Binary mmc0 0x00044400 arm-trusted-firmware/tf-a-stm32mp157f-nexio-sdcard.stm32
P 0x06 metadata1 Binary mmc0 0x00084400 arm-trusted-firmware/metadata.bin
P 0x07 metadata2 Binary mmc0 0x000C4400 arm-trusted-firmware/metadata.bin
P 0x08 fip-a FIP mmc0 0x00104400 fip/fip-stm32mp157f-nexio-trusted.bin
PED 0x09 fip-b FIP mmc0 0x00504400 none
PED 0x0A u-boot-env Binary mmc0 0x00904400 none
P 0x10 bootfs System mmc0 0x00984400 st-image-bootfs-openstlinux-weston-stm32mp1-nexio.ext4
P 0x11 vendorfs FileSystem mmc0 0x04984400 st-image-vendorfs-openstlinux-weston-stm32mp1-nexio.ext4
P 0x12 rootfs FileSystem mmc0 0x05984400 st-image-core-openstlinux-weston-stm32mp1-nexio.ext4
P 0x13 rootfs FileSystem mmc0 0x45984400 st-image-core-openstlinux-weston-stm32mp1-nexio.ext4
E 0x14 writeable FileSystem mmc0 0x85984400 none # 256kB persistent memory
E 0x15 dummy FileSystem mmc0 0x859C4400 none # unusedMy idea is to use u-boot boot.scr.cmd to be able to switch between the two root filesystems.
fw_env.config looks like this:
# Block device example
/dev/disk/by-partlabel/u-boot-env 0x3bc00 0x2000
/dev/disk/by-partlabel/u-boot-env 0x3bc00 0x2000I got the start offset by looking into u-boot-env by using hexdump.
After boot I am able to use fw_printenv and fw_setenv and I see the changes made to u-boot-env.
But I have a number of issues with this approach:
- boot.scr.img is not always executed. It seems only to get executed at the first boot.
- u-boot prompt: env set var 123; env save; does not seem to save the variable to the u-boot-env partition. In fact after using hexdump I found out the value is stored to the fip-b partition. Why doesnt it use u-boot-dev?
- Using fw_setenv does change the value in u-boot-dev, but on the u-boot prompt I see the previous value. The one from the fip-b partition.
How can I configure the system so that u-boot and the rootfs use the same device for storing the FW environment variables?
Thank you 1000 times!
bye Gunther
