Dear Community,
From the tutorial in attachment, it is said :
I would like to know if there's any way to have default u-Boot's environment variables in the storage without using the saveenv command once as we plan to remove the serial debug interface and serial download interface (i.e. without u-Boot access) from an iMX8M Plus based system with SD card as only storage, please ?
Thanks and best regards,
Khang
It is no difference between under arm linux with real device sdcard/emmc and x86/x64 linux with sdcard mirror(or real sdcard).
The document is just under arm linux with real device sdcard/emmc.
Now You just need to compile a x86/64 fw_setenv/fw_printenv.
Others are the exactly the same.
you can use "make u-boot-initial-env" to get the default uboot env. (So far, the yocto use the same way output the env in its deploy)
Here is one example, yocto deploy. u-boot-imx-initial-env-imx8mmevk-sd-2020.04-r0 is the default env.
mx8mm-evk-qca-wifi--5.4-r0-imx8mmevk-20210709103222.dtb tee.mx8mmevk.bin
imx8mm-evk-qca-wifi.dtb u-boot.bin
imx8mm-evk-qca-wifi-imx8mmevk.dtb u-boot.bin-sd
imx8mm-evk-revb-qca-wifi--5.4-r0-imx8mmevk-20210709103222.dtb u-boot-imx8mmevk.bin
imx8mm-evk-revb-qca-wifi.dtb u-boot-imx8mmevk.bin-sd
imx8mm-evk-revb-qca-wifi-imx8mmevk.dtb u-boot-imx-initial-env-imx8mmevk-sd
imx8mm-evk-rm67191--5.4-r0-imx8mmevk-20210709103222.dtb u-boot-imx-initial-env-imx8mmevk-sd-2020.04-r0
imx8mm-evk-rm67191.dtb u-boot-imx-initial-env-sd
imx8mm-evk-rm67191-imx8mmevk.dtb u-boot-sd-2020.04-r0.bin
imx8mm-evk-root--5.4-r0-imx8mmevk-20210709103222.dtb u-boot-spl.bin
If you need a binary env, you can use mkenvimage to convert it.
In the following document, you can see the fw_setenv apply uboot environment into a sdcard mrrior.
create sdcard mirror under windows
https://community.nxp.com/t5/i-MX-Processors-Knowledge-Base/create-sdcard-mirror-under-windows/ta-p/...
You can see a.sdcard is a mirror not a real device.
fw_env.config
#a.sdcard 0x400000 0x4000 #8MQ,8MM, 8MN, 8MP since lf-5.10.52-2.1.0
#a.sdcard 0x400000 0x2000 #8, 8X,8ULP
a.sdcard 0x400000 0x1000 #8MQ,8MM, 8MN, 8MP
and
fw_setenv has "-f" for the first time, the device has no env yet. The env file is the previous command "make u-boot-initial-env", you got.
You can use the -f or you can prepare a scard/emmc mirror has env inside(use x86/x64 fw_setenv set it or use mkenvimage get binary env to integrate it).
fw_setenv (compiled Dec 27 2021)
Usage fw_setenv [OPTION]
-h, : print this help
-c, --config <filename> : configuration file (old fw_env.config)
-f, --defenv <filename> : default environment if no one found
-V, : print version and exit
-s, --script <filename> : read variables to be set from a script
In the document, the swupdate uses the same way for the first time when device has no env.
SWUpdate OTA i.MX8MM EVK / i.MX8QXP MEK
Lots of ways to achieve your goal.
You also can consider the "uENV.txt" way.