U-Boot Environment on FAT

Discussion about U-Boot and the kernel.

U-Boot Environment on FAT

Postby LogiSch17 » Sun Sep 18, 2016 4:07 pm

Hi,
i have just setup a raspberry pi compute module with U-Boot as bootloader and everything works fine.
But now i am trying to set my uboot environment variables from Linux, to have the possibility to switch between two filesystems. I am using the following partition table:
Code: Select all
/dev/mmcblk0p1 fat32    boot (kernel,start.elf,u-boot.bin,uboot.env,...)
/dev/mmcblk0p2 ext4     rootfs1
/dev/mmcblk0p3 ext4     rootfs2
/dev/mmcblk0p4 fat32    data

As you can see, uboot is successfully saving the env variables to the first fat partition. From the bootloader menu i also can print, setenv and save all variables.
when i saveenv:
Code: Select all
U-Boot> saveenv
Saving Environment to FAT...
writing uboot.env
FAT: Misaligned buffer address (1bb42d78)
done

when i mount my boot partition i can see the uboot.env file.
my uboot config about environment :
Code: Select all
/* Environment */
#define CONFIG_ENV_SIZE         SZ_16K
#define CONFIG_ENV_IS_IN_FAT
#define FAT_ENV_INTERFACE      "mmc"
#define FAT_ENV_DEVICE_AND_PART     "0:1"
#define FAT_ENV_FILE                 "uboot.env"
#define CONFIG_FAT_WRITE
#define CONFIG_ENV_VARS_UBOOT_CONFIG
#define CONFIG_SYS_LOAD_ADDR      0x1000000
#define CONFIG_CONSOLE_MUX
#define CONFIG_SYS_CONSOLE_IS_IN_ENV
#define CONFIG_PREBOOT         "usb start"


My question is now, is there a possibility to get access to the uboot.env from linux?
Cause i have no idea what i should tell my fw_env.config where to find the uboot.env.
How can i find out the physical adress of my .env file?

Hope someone can help me.
best regards Logi
LogiSch17
 
Posts: 2
Joined: Sun Sep 18, 2016 3:22 pm

Re: U-Boot Environment on FAT

Postby WarheadsSE » Mon Sep 19, 2016 2:15 pm

fw_env.cfg was never designed to be used with a file, AFAIK.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6730
Joined: Mon Oct 18, 2010 2:12 pm

Re: U-Boot Environment on FAT

Postby LogiSch17 » Mon Sep 19, 2016 2:47 pm

As I feared.
So if U-Boot is used on non MTD/eMMC devices there is no possibility to getting access to the uboot environment form linux ?
Would you think it´s an option to mount boot to add a new uenv.txt or new boot.scr with mkimage to change the settings, or is there an argument against it?
LogiSch17
 
Posts: 2
Joined: Sun Sep 18, 2016 3:22 pm

Re: U-Boot Environment on FAT

Postby WarheadsSE » Mon Sep 19, 2016 2:49 pm

It's a text file. You could just _edit_ it.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6730
Joined: Mon Oct 18, 2010 2:12 pm


Return to U-Boot/Kernel

Who is online

Users browsing this forum: No registered users and 3 guests