U-Boot bootcmd (auto vs manual)

1

I'm running into an issue where when I power up my device, it hangs at

Starting kernel ...

Or it loops with

Starting kernel ...

resetting ...

However, if I interrupt the boot process and manually run boot, ie:

=> run bootcmd
or
=> boot

then the kernel loads fine.

According to DENX (5.9.6.5) this is equivalent to what Uboot should be doing automatically.

Does anyone know if there is a difference between letting uboot run on it's own and interrupting and running boot manually? Otherwise, how do I start debugging this?

ENVIRONMENT

=> printenv
autoload=no
baudrate=115200
board_name=EVK
board_rev=pilot
boot_fdt=try
bootcmd=echo Booting from network ...; usb start; setenv ethact asx0; if dhcp && tftp $loadaddr $bootfile && tftp $f
dt_addr $fdt_file; then run nfsboot; else echo WARN: Issue with TFTP.; run sdboot; fi;
bootdelay=3
bootfile=zImage
bootscript=echo Running bootscript from mmc ...; source
console=ttymxc1
ethact=asx0
ethprime=FEC
fdt_addr=0x83000000
fdt_file=imx6ul-pilot-v1-evk.dtb
fdt_high=0xffffffff
image=zImage
initrd_high=0xffffffff
ip_dyn=yes
loadaddr=0x80800000
loadbootscript=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};
loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}
loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
mmcargs=setenv bootargs console=${console},${baudrate} root=${mmcroot}
mmcautodetect=yes
mmcboot=echo Booting from mmc ...; run mmcargs; if test ${boot_fdt} = yes || test ${boot_fdt} = try; then if run loadfdt; then bootz ${loadaddr} - ${fdt_addr}; else if test ${boot_fdt} = try; then bootz; else echo WARN: Cannot load the DT; fi; fi; else bootz; fi;
mmcdev=1
mmcpart=1
mmcroot=/dev/mmcblk1p2 rootwait rw
netargs=setenv bootargs console=${console},${baudrate} root=/dev/nfs ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
nfsboot=run netargs; bootz $loadaddr - $fdt_addr
nfsroot=/nfs/rootfs
script=boot.scr
sdboot=echo Booting from mmc ...; mmc dev ${mmcdev}; mmc dev ${mmcdev}; if mmc rescan; then if run loadbootscript; then run bootscript; else if run loadimage; then run mmcboot; else echo ERROR: Cannot run loadimage; fi; fi; else run ERROR: Cannot run mmc rescan; fi;
serverip=192.168.0.219

Environment size: 1714/8188 bytes
embedded-linux
u-boot
asked on Stack Overflow Jul 14, 2017 by Otus • edited Jul 19, 2017 by Otus

1 Answer

3

This issue was with the SDBOOT env var:

sdboot = echo Booting from mmc ...; mmc dev ${mmcdev}; mmc dev ${mmcdev}; 
         if mmc rescan; then 
             if run loadbootscript; then 
                 run bootscript; 
             else 
                 if run loadimage; then 
                     run mmcboot; 
                 else 
                     echo ERROR: Cannot run loadimage; 
                 fi; 
             fi; 
         else 
             echo ERROR: Cannot run mmc rescan; 
         fi;

Load bootscript kept failing with "** Unable to read file boot.scr **". I'm still not sure what was causing the difference but removing the loadbootscript branch and going straight to loadimage fixed the issue.

answered on Stack Overflow Jul 19, 2017 by Otus

User contributions licensed under CC BY-SA 3.0