0
点赞
收藏
分享

微信扫一扫

linux fw_printenv fw_setenv 设置uboot环境变量


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 boot , the 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


举报

相关推荐

0 条评论