How to Increase or Decrease the Boot Delay in U-Boot Before the Automatic Boot Process

Beaglebone black board






In this article, we show how to increase or decrease the boot delay in U-boot before the automatic boot process in which U-boot ultimately runs the operating system kernel image file.

So, if you have run U-boot before, you know that there is a delay given (such as 5 seconds) where U-boot waits before beginning the automatic boot process where a user can press the space bar and go to the U-boot command prompt.

You can increase or decrease this time period by setting the value of the bootdelay system variable.

You can find this information in the U-Boot Reference Manual

Within this reference manual, we see the following description for the bootdelay system variable, shown below.


U-boot bootdelay system variable


So you can see that we can set this value to a number and this number will signify the amount of seconds to wait before U-boot runs the automatic boot process in bootcmd.

We want to specify an integer that represents this time delay.

This number can even be 0.

According to the U-Boot refernce manual, if the bootdelay is set to 0, the autoboot happens immediately after U-Boot starts. To stop the process and enter the monitor, press a key as soon as the first U-Boot output lines appear.

This is shown below in the U-boot reference manual.


U-boot bootdelay system variable set to 0


So in order words, there will be no prompt to go to the U-boot command prompt, but it can still be achieved by pressing a key as soon as the first U-Boot output lines appear.

So in order to set the delay, we use the setenv command followed by bootdelay followed by the integer for how long we want the delay to last.

So if we want U-boot to wait 10 seconds, then the code would be the following shown below.


So when we incorporate this into our uEnv.txt file, we can put it into any of a few various places but it must go before the actual boot command.

The uEnv.txt file is shown below.


console=ttyO0,115200n8
ipaddr=192.168.7.2
serverip=192.168.7.1
loadaddr=0x82000000
fdtaddr=0x88000000
loadfromsd=load mmc 0:2 ${loadaddr} /boot/uImage;load mmc 0:2 ${fdtaddr} /boot/am335x-boneblack.dtb
linuxbootargs=setenv bootargs console=${console} root=/dev/mmcblk0p2 rw
uenvcmd=setenv autoload no; setenv bootdelay 10; run loadfromsd; run linuxbootargs; bootm ${loadaddr} - ${fdtaddr}



So now when U-Boot runs, it should wait 10 seconds where a user can press a key to go to the U-boot prompt before the automatic boot process begins.

This can also be changed in the U-boot source code itself.

However, as we have just done, it can be done externally to the U-boot source code through the uEnv.txt file.

So this is how to increase or decrease the boot delay in U-Boot before running the linux kernel.



Related Resources





HTML Comment Box is loading comments...