Knowledge Base
Authentication is disabled (development mode).

man u-boot env export

Edit

bash env environment export man sh u-boot uboot

env export [-t | -b | -c] [-s size] addr [var ...]

-t:	export as text format; if size is given, data will be
	padded with '\0' bytes; if not, one terminating '\0'
	will be added (which is included in the "filesize"
	setting so you can for exmple copy this to flash and
	keep the termination).
-b:	export as binary format (name=value pairs separated by
	'\0', list end marked by double "\0\0")
-c:	export as checksum protected environment format as
	used for example by "saveenv" command
-s size:
	size of output buffer
addr:	memory address where environment gets stored
var...	List of variable names that get included into the
	export. Without arguments, the whole environment gets
	exported.

With "-c" and size is NOT given, then the export command will
format the data as currently used for the persistent storage,
i. e. it will use CONFIG_ENV_SECT_SIZE as output block size and
prepend a valid CRC32 checksum and, in case of resundant
environment, a "current" redundancy flag. If size is given, this
value will be used instead of CONFIG_ENV_SECT_SIZE; again, CRC32
checksum and redundancy flag will be inserted.

With "-b" and "-t", always only the real data (including a
terminating '\0' byte) will be written; here the optional size
argument will be used to make sure not to overflow the user
provided buffer; the command will abort if the size is not
sufficient. Any remainign space will be '\0' padded.

On successful return, the variable "filesize" will be set.
Note that filesize includes the trailing/terminating '\0' byte(s).

Usage szenario:  create a text snapshot/backup of the current settings:

=> env export -t 100000
=> era ${backup_addr} +${filesize}
=> cp.b 100000 ${backup_addr} ${filesize}

Re-import this snapshot, deleting all other settings:

=> env import -d -t ${backup_addr}