Hi Frieder,
On 26.10.22 11:54, Frieder Schrempf wrote:
> Hello everyone,
>
> I'm wondering how to include the U-Boot environment created from "make
> u-boot-initial-env" into an SWU image so it can be flashed to the SPI
> NOR during the update process?
The reason for u-boot-initial-env (and libubootenv) is to avoid any
hardware dependency, what we have using U-Boot's legacy tool. It is not
required at all that the file is stored into the SPI flash.
When system boots and no environment is in flash, the tools in
libubootenv (fw_setenv / fw_printenv, but SWUpdate, too) will use
u-boot-initial-env. In OE, u-boot-initial-env is installed via the
u-boot-env package.
>
> Writing it to the flash directly doesn't work as the u-boot-initial-env
> is not a flashable image (no header/CRC included).
>
> Writing it via fw_setenv works, but how can I use the file from the
> swu-Image instead of the one from the local file system
> (/etc/u-boot-initial-env)?
> Do I need to write a script and use "fw_setenv -f" or is there a better way?
>
In case you update U-Boot and you have a new "default" environment, the
following methods are often used:
1. Put u-boot-initial-env into the SWU and use the bootloader handler, like:
images: (
{
filename = "u-boot-initial-env";
type = "bootloader";
}
);
(this is more similar as what you want - it is like a fw_setenv -s
u-boot-initial-env")
2. Just break the CRC into environment copy. You can use "copyhandler"
or whatever you want. U-Boot will start with default environment, and in
user space /etc/u-boot-initial-env will be taken.
In any case, SWUpdate does not need as input a flashable environment
built with mkimage or mkenvimage. SWUpdate takes a plain ASCII like
u-boot-initial-env and creates the environment for U-Boot nvia libubootenv.
Best regards,
Stefano
> Thanks for helping!
> Frieder
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
swupdate+u...@googlegroups.com
> <mailto:
swupdate+u...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/swupdate/91b3b9bf-5c80-4c86-8fd6-97ea4bcd4369n%40googlegroups.com <
https://groups.google.com/d/msgid/swupdate/91b3b9bf-5c80-4c86-8fd6-97ea4bcd4369n%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, 82194 Groebenzell, Germany
Phone:
+49-8142-66989-53 Fax:
+49-8142-66989-80 Email:
sba...@denx.de
=====================================================================