Login

Why register?

  • Download software and technical materials
  • Purchase products at our on-line shop
  • Receive design news to stay up-to-date with Emcraft's new solutions

 

 

Using U-Boot Environment Print

 

U-Boot makes use of the so-called environment variables to define various aspects of the target functionality. On the SOLOX SOM, the U-Boot environment is stored in the on-module NAND Flash and is persistent across power or reset cycles. Parameters defined by the U-Boot environment variables include: target IP address, target MAC address, location in RAM where a Linux bootable image will be loaded, and many others.

To manipulate the U-Boot environment the following commands are used:

  • printenv <var> - print the value of the variable var. Without arguments, prints all environment variables:
  • SLX-SOM U-Boot > printenv
    addip=setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:eth0:off  fec_mac=${ethaddr}
    args=run args_quiet
    ...
    Environment size: 2040/65531 bytes

  • setenv <var> <val> - set the variable var to the value val:
  • SLX-SOM U-Boot > setenv image vlad/rootfs.uImage
    SLX-SOM U-Boot >

    Running setenv <var> will unset (undefine) a specified U-Boot variable, so it won't be shown as available next time you run printenv.

  • saveenv - save the up-to-date U-Boot environment, possibly updated using setenv commands, into internal Flash. Running saveenv makes sure that any updates you have made to the U-Boot environment are persistent across power cycles and resets. If you don't run saveenv, any updates you may have made to the U-Boot environment will be lost on next reboot.
  • SLX--SOM U-Boot > saveenv
    Saving Environment to NAND...
    Erasing redundant NAND...
    Erasing at 0x240000 -- 100% complete.
    Writing to redundant NAND... OK
    SLX-SOM U-Boot >