How to disable uboot couting down feature during serial console

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to disable uboot couting down feature during serial console

Jump to solution
27,178 Views
jiye
Contributor V

Hi,

I have a TWR-LS1021a Eva board and I am using LSDK1906 to build the kernel. My kernel version is 4.19.46

However, I want to disable

 "Hit any key to stop autoboot:  0 " this feature every time during boot so I wont be able to access to the u-boot command window.

I did try to disable the tty during the menuconfig and also hacking kernel to make the console logs as less as possible but

still I can see the u-boot counting down during the boot time.

Anyone knows how to disable that counting down feature so no one can access to the u-boot prompt command window?

Labels (1)
0 Kudos
Reply
1 Solution
25,758 Views
alexander_yakov
NXP Employee
NXP Employee

"Set this variable to -2 to boot without delay and not check for abort." means, as per my understanding, that U-boot will skip this check and go directly to booting. This does not mean that you will never have access to the u-boot prompt, because

a) this setting can be changed back by modifying E-boot environment variables from Linux, as we already discussed

b) U-boot can boot Linux successfully only if Linux image is present and valid. In case if booting is not possible, U-boot will obviously stop.

View solution in original post

10 Replies
25,758 Views
alexander_yakov
NXP Employee
NXP Employee

The following is said in U-boot documentation, Section 5.10 "U-boot Environment Variables":

bootdelay: After reset, U-Boot will wait this number of seconds before it executes the contents of the bootcmd variable. During this time a countdown is printed, which can be interrupted by pressing any key.
Set this variable to 0 boot without delay. Be careful: depending on the contents of your bootcmd variable, this can prevent you from entering interactive commands again forever!
Set this variable to -1 to disable autoboot. Set this variable to -2 to boot without delay and not check for abort.

To set this variable you can type in U-boot prompt:

setenv bootdelay 0

saveenv

Direct link to mentioned U-boot documentation page:

https://www.denx.de/wiki/view/DULG/UBootEnvVariables

0 Kudos
Reply
25,758 Views
jiye
Contributor V

Thanks for the reply. But what if I want to re-enable then later. Is there a way to do all these settings from the linux ?

Another question is how to make this printing messages silent from the console? I did some research on lines people say I need to change the board header file. 

0 Kudos
Reply
25,758 Views
alexander_yakov
NXP Employee
NXP Employee

To modify U-boot environment variables from Linux, you have to build two tools fw_printenv and fw_setenv.

Making u-boot fully silent may be a bit tricky - it is known that "setenv silent 1", intended for this, does not make u-boot fully silent, so some minor changes in software may be required.

0 Kudos
Reply
25,758 Views
jiye
Contributor V

Thanks for the reply. Would you be able to provide a bit more detail of how to build that two tools fw_printenv and fw_setenv ? are they from the kernel compilation?

0 Kudos
Reply
25,758 Views
alexander_yakov
NXP Employee
NXP Employee

Please search this community by "fw_printenv" keyword. For example, please look this topic:

https://community.nxp.com/thread/488024

0 Kudos
Reply
25,758 Views
jiye
Contributor V

Also regarding your previous reply if I set the bootdelay to -2 does that mean I will never have access to the u-boot prompt?

0 Kudos
Reply
25,759 Views
alexander_yakov
NXP Employee
NXP Employee

"Set this variable to -2 to boot without delay and not check for abort." means, as per my understanding, that U-boot will skip this check and go directly to booting. This does not mean that you will never have access to the u-boot prompt, because

a) this setting can be changed back by modifying E-boot environment variables from Linux, as we already discussed

b) U-boot can boot Linux successfully only if Linux image is present and valid. In case if booting is not possible, U-boot will obviously stop.

25,000 Views
keyurthumar
Contributor I

I have changed it to -2 but it is reflected as "-2" i.e. with double inverted commas. See below screenshots
keyurthumar_0-1606305659805.png

keyurthumar_1-1606305742863.png

 

0 Kudos
Reply
25,758 Views
jiye
Contributor V

Hi Alex,

 

After I run "apt-get install u-boot-tools"  

then I perform fw_printenv in the linux it tells me that 

Cannot parse config file '/etc/fw_env.config': No such file or directory

 

Have you ever encountered this issue before?

0 Kudos
Reply
25,758 Views
alexander_yakov
NXP Employee
NXP Employee

As I can understand, this file should be created by used and it should reflect actual flash memory configuration.

Please look, for example, this link:

https://github.com/ARM-software/u-boot/blob/master/tools/env/fw_env.config

0 Kudos
Reply