全志A133 默认CONFIG_BOOTDELAY=2 如下,
config BOOTDELAY
int "delay in seconds before automatically booting"
default 2
depends on AUTOBOOT
help
Delay before automatically running bootcmd;
set to 0 to autoboot with no delay, but you can stop it by key input.
set to -1 to disable autoboot.
set to -2 to autoboot with no delay and not check for abort
See doc/README.autoboot for details.
通过修改longan\brandy\brandy-2.0\u-boot-2018\common\Kconfig中对应宏default的值,有对应解释
常数是在自动运行bootcmd之前的延迟时间;
设置为0表示无延迟自动引导,但您可以通过键盘按键停止它。
设置为-1表示禁用自动引导。进入bootcmd
设置为-2表示无延迟自动引导,不检查中止。正常开机
这样设置uboot环境变量区的bootdelay是-2,也就是没有启动延时了,我们也没办法再进去uboot菜单管理界面了。实测告诉你那是不行的,因为uboot每次启动他都先去读取了flash里面的环境变量,除非里面没任何数据才会来取这个宏的定义,同时要修改代码只要不让uboot从环境变量里面取不就行了吗!经过查看uboot源码,发现在源码文件“longan\brandy\brandy-2.0\u-boot-2018\common\autoboot.c”中做了如下的判断:
#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
s = getenv ("bootdelay");
bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;
debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);
先去取了环境变量的值做判断,有就直接用,那直接把这个判断去掉并改为每次都取“CONFIG_BOOTDELAY”的值不就行了,如下
#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
s = getenv ("bootdelay");
bootdelay = CONFIG_BOOTDELAY;
debug ("### main_loop entered: bootdelay=%d\n\n", bootdelay);
刷机验证完美去掉boot管理模式