3 bootloader update, Bootloader update – Kontron AM4204 User Manual

Page 66

Advertising
background image

51

AM4204

www.kontron.com

Var: The variable controls a specific behavior of the bootloader startup sequence. E.g. the
‘bootdelay’ variable controls the time u-boot waits before execution of the bootcmd which
normally loads and starts the Linux kernel.

Auto: The variable is automatically set during bootloader startup sequence. E.g. the ‘postresult’
variable stores the result of the POST.

It is possible to modify environment variables and start the pre-defined scripts from the bootloader shell. It
is strongly recommended not to modify the pre-defined script variables. However, definition and execution
of user-defined script variables can be done.

For additional information about u-boot, refer to

http://sourceforge.net/projects/u-boot/

Modification of bootloader environment variables is done using the ‘setenv’ and ‘saveenv’ bootloader CLI
commands. In the following example, first, the new environment script variable ‘bootcmdmyscript’ is
defined. After that, the ‘bootsource’ is set to <myscript> causing the bootloader to execute
<bootcmdmyscript> upon next restart. In addition, bootdelay is increased to 10. Finally, all changes are
stored into flash environment sector.

T5516#

setenv bootcmdmyscript ‘bootp; tftpboot ${loadaddr} myimg.multi; bootm ${loadaddr}

T5516#

setenv bootsource myscript

T5516#

setenv bootdelay 10

T5516#

saveenv

Environment changes are stored in one of the redundant bootloader environment sectors. In case of failure
(e.g. power loss), the settings of the redundant sector are still available. However, the fabric default setting
is running with environment sectors erased. In this case the following startup message is displayed:

Using default environment

Any changes of the environment can be cleared using the ‘nuke_env’ script (provided that ‘nuke_env’ itself
was not changed):

T5516#

run nuke_env

5.2.3

Bootloader Update

To update the bootloader, the new U-boot binary is transferred to the board using TFTP. After that, this
binary is written into the onboard flash. The onboard E1000 NIC is used for network connection.

Prerequisites: a working TFTP server, DHCP server and network connectivity to the DHCP and TFTP server. The
new bootloader image has to be stored on the TFTP server. No jumper settings are required on the AM4204.

There are 2 possible ways to update Image 0 and image 1 bootloaders:

• Using the predefined update scripts from the bootloader CLI

• Using the kex-flashimage tool which is provided with the Kontron WindRiver BSP.

CAUTION

Changing bootloader environment variables must be taken very carefully. It will
change system behavior and can lead to a non-booting system

Advertising