1、fw_printenv/fw_setenv

u-boot提供fw_printenv/fw_setenv 为Linux访问uboot环境编译。

在uboot端编译,在Linux端使用

2、测试环境

source /opt/fsl-imx-xwayland/4.14-sumo/environment-setup-aarch64-poky-linux
make envtools CC="$CC"
Now, you will find the u-boot/tools/env/fw_printenv
Note: the fw_setenv is applet of fw_printenv as busybox does
fw_env.config
fw_env.config default directory is in the /etc/
如下
/dev/mmcblk1  0x400000         0x2000
uboot/include/configs/imx8qxp_mek.h
0x2000 : #define CONFIG_ENV_SIZE  0x2000
0x400000: #define CONFIG_ENV_OFFSET (64 * SZ_64K)

3、所有文件集成在rootfs里面

fw_env.config copy to /etc/
fw_printenv copy to /bin
Make symbol link fw_setenv from fw_printenv
ln -s fw_printenv fw_setenv
fw_setenv -> fw_printenv

4、Test fw_printenv/fw_setenv

注意以下文字,第一次开机的时候需要在uboot中设置saveenv

The first bootthe environment is generated by uboot C code.
i.MX uboot detects the which board it is, then give proper u-boot environment
variables. It is in the memory not in the storage such as emmc, till you use
saveenv to do save.
If it is the first time to do the test, get into uboot run saveenv first.

Test fw_printenv/fw_setenv(Cont.)
Get in to linux then test fw_printenv

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐