Configuring the bootloader with `fw_env.config` and `CONFIG_ENV_OFFSET`

佐手、 提交于 2021-01-29 07:10:39

问题


I have a previously built image where the content of fw_env.config is (using u-boot):

/dev/mmcblk0 0x400000 0x4000
/dev/mmcblk0 0x800000 0x4000

Do I understand correctly that this tells u-boot the partition layout? That is the layout that I would like to have also on a new image.

I have a libubootenv\%.bbappend which is supposed to copy the layout above into the new image's fw_env.config (even though I didn't come to the point, yet to test if that actually worked). There are also u-boot configuration parameters regarding the layout that can be set using:

CONFIG_ENV_OFFSET
CONFIG_ENV_OFFSET_REDUND

Do I understand correctly, that these two (fw_env.config and CONFIG_ENV_OFFSET[_REDUND]) define the same thing and that they have to match? Or does one take precendence over the other when booting so it actually is enough to set the u-boot's CONFIG_ENV_OFFSET? What isn't clear to me besides that is: Are these strictly defined by the bsp or hardware or can I change these variables for backwards compatibility? Reason I'm asking is that these values differed when going from warrior to dunfell. That would imply the answer to the last question is 'yes, they can be changed'. This is still a little tricky for me to understand thus, I would like some confirmation before screwing up some systems.

Any hints on material for further reading and research is highly welcome too.


回答1:


Thanks to the lively community support over at the yocto IRC channel I was provided with the following answer:

The two definitions (fw_env.config and CONFIG_ENV_OFFSET[_REDUND]) have to match. On top of that CONFIG_ENV_SIZE should be defined. The parameters can be configured as they represent addresses in the storage medium. Thus, they are not strictly predictated by the bsp.

Credits go to qschulz. Thanks a lot!



来源:https://stackoverflow.com/questions/65006727/configuring-the-bootloader-with-fw-env-config-and-config-env-offset

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!