TechNexion / meta-tn-imx-bsp

TechNexion BSP Layer for i.MX Yocto Project
MIT License
6 stars 11 forks source link

Save uboot env to eMMC? #26

Closed JeanPhilippeLebel closed 3 months ago

JeanPhilippeLebel commented 3 months ago

Hello,

We are in the process of upgrading from Sumo to Mickedore. We've got almost everything working, except the upgrade process (via swupdate).

If we boot the system after a fresh install and run fw_printenv, we have the following message:

Cannot read environment, using default Cannot read default environment from file

If we boot to the uboot, then execute saveenv and boot to linux and run fw_printenv again, everything works.

Obviously, we can't ask our users to manually execute saveenv in the uboot.

Is there a way to resolve this?

Thanks

JoeZhang-tn commented 3 months ago

Hi there,

You can refer to this product: https://github.com/TechNexion/u-boot-tn-imx/blob/tn-imx_v2023.04_6.1.55_2.2.0-stable/include/configs/tep-imx8mp.h#L161

This product doesn't have console outside the box, we do the auto saveenv during boot process. And customer can change ENV or disable this function using fw_setenv.

Maybe you can try it out and make properly modification.

Also, skip the range of ENV when flash can also keep the ENV.

THANKS~~

Joe

johnweber commented 3 months ago

Joe, I've been working with this customer via email. The good news is I recommended essentially the same approach, but didn't realize that we actually had that already built into the default u-boot environment now, so that's good.

JeanPhilippeLebel commented 3 months ago

I can confirm the proposed solution works. Thanks. I will close this issue.