VF50 Booting from SD card issue

I am trying to boot my VF50 module from SD card.

When I turn on the board on the serial console, I can see the following output

U-Boot 2016.11-2.8.7+g5c2d46b325 (Jun 10 2020 - 16:54:13 +0000)

CPU: Freescale Vybrid VF500 at 396 MHz
Reset cause: WDOG A5
DRAM:  128 MiB
NAND:  128 MiB
MMC:   FSL_SDHC: 0
In:    serial
Out:   serial
Err:   serial
Model: Toradex Colibri VF50 128MB IT V1.2A, Serial# 0496xxxx
Net:   FEC
Colibri VFxx #

And it stops at Colibri VFxx #

Looking for some information on how to configure the u-boot, I have found it

Then, running the following command:

run sdboot

I am able to boot my custom distro properly, with the SD card connected.

Also, looking for the information here

I am trying to make this configuration permanent (running the following commands on the uboot prompt

setenv bootcmd 'run sdboot'
saveenv

If I do perform a board reset, using the reset command or turning it off and on again, it stops at the same Colibri VF # prompt as described above.

I am using the uboot available at
https://developer.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Images/Colibri-VF_Console-Image_2.8b7.-20200610.tar.bz2

Looking at the uboot variables

bootcmd=run sdboot

Does anyone know how can I make this thing to boot from the SD card without using run sdboot commands? Even if persisting the information in the bootcmd the automatic boot does not work for me.

Hi @Fabricio

Thanks for writing to the Toradex community.

I tried to reproduce your issue at my place but for me this is working fine. If I reset the carrier board, then run sdboot is launched and the SoM is booting from SD Card.

Best regards,
Jaski

Hi jaski.tx
Which uboot version are you using ?
Could you show me the printenv values, so that I can compare it with my values here ?
I did the same procedure 3 times and no success so far. I have no idea what is going wrong.
Do you have some tips or suggestions to allow me to investigate here? It is good that your setup is working, but I have to fix it on my side.

Hi Fabricio

I installed the Bsp 2.8.7 and I am using U-Boot version 2016.11-2.8.7+g5c2d46b325. Have you done any customization to the image (U-Boot or Kernel)?

Best regards,
Jaski

Hi @jaski.tx
No, there is no customization on the uboot side. I am using the uboot from
https://developer.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Images/Colibri-VF_Console-Image_2.8b7.-20200610.tar.bz2

About the kernel, I am using a Kernel built with Yocto (warrior) but there were no changes and if I do execute the “run sdcard” manually I am able to boot the system. then not sure if the Kernel is a problem.
So far I am trying to compare all uboot variables, so maybe If you can provide the printenv output from your module I can compare it with mine.
Thanks

This is the output of printenv:

Colibri VFxx # print 
arch=arm
baudrate=115200
board=colibri_vf
board_name=colibri_vf
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc0 usb0 dhcp 
bootcmd=run ubiboot; setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;
bootcmd_dhcp=if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=1
console=ttyLP0
cpu=armv7
defargs=user_debug=30
dfu_alt_info=vf-bcb part 0,1;u-boot part 0,2;ubi part 0,4
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
eth1addr=00:14:2d:3b:fd:13
ethact=FEC
ethaddr=00:14:2d:2b:fd:13
fdt_addr_r=0x82000000
fdt_board=eval-v3
fdt_fixup=;
fdt_high=0xffffffff
fdtcontroladdr=877070c0
initrd_high=0xffffffff
ipaddr=192.168.10.2
kernel_addr_r=0x81000000
kernel_file=zImage
loadaddr=0x80008000
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
mtdparts=mtdparts=vf610_nfc:128k(vf-bcb)ro,1408k(u-boot)ro,512k(u-boot-env),-(ubi)
netmask=255.255.255.0
nfsargs=ip=:::::eth0: root=/dev/nfs
nfsboot=run setup; setenv bootargs ${defargs} ${nfsargs} ${setupargs} ${vidargs}; echo Booting from NFS...;dhcp ${kernel_addr_r} && tftp ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}
pxefile_addr_r=0x87100000
ramdisk_addr_r=0x82100000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x87000000
sdargs=root=/dev/mmcblk0p2 ro rootwait
sdboot=run setup; setenv bootargs ${defargs} ${sdargs} ${setupargs} ${vidargs}; echo Booting from MMC/SD card...; load mmc 0:1 ${kernel_addr_r} ${kernel_file} && load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}
serial#=02882835
serverip=192.168.10.1
setethupdate=if env exists ethaddr; then; else setenv ethaddr 00:14:2d:00:00:00; fi; tftpboot ${loadaddr} ${board}/flash_eth.img && source ${loadaddr}
setsdupdate=mmc rescan && setenv interface mmc && fatload ${interface} 0:1 ${loadaddr} ${board}/flash_blk.img && source ${loadaddr}
setup=setenv setupargs console=tty1 console=${console},${baudrate}n8 ${memargs} consoleblank=0 ${mtdparts}
setupdate=run setsdupdate || run setusbupdate || run setethupdate
setusbupdate=usb start && setenv interface usb && fatload ${interface} 0:1 ${loadaddr} ${board}/flash_blk.img && source ${loadaddr}
soc=vf500
splashpos=m,m
ubiargs=ubi.mtd=ubi root=ubi0:rootfs rw rootfstype=ubifs ubi.fm_autoconvert=1
ubiboot=run setup; setenv bootargs ${defargs} ${ubiargs} ${setupargs} ${vidargs}; echo Booting from NAND...; ubi part ubi && ubi read ${kernel_addr_r} kernel && ubi read ${fdt_addr_r} dtb && run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
vendor=toradex
ver=U-Boot 2016.11-2.8.7+g5c2d46b325 (Jun 10 2020 - 16:54:13 +0000)
video-mode=dcufb:640x480-16@60,monitor=lcd

Environment size: 4228/131068 bytes

@jaski.tx, is your printenv the one after

 setenv bootcmd 'run sdboot'
 saveenv

?

Because your bootcmd is:

bootcmd=run ubiboot; setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;

@Fabricio, could you please paste here your printenv as well?

Best regards,
André Curvello

hi @andrecurvello.tx,

You are right, I forget to save the environment after changing the command but the rest environment should be the same.

Best regards,
Jaski

Ok! Good to know.

Any updates @Fabricio ?

Hi @andrecurvello.tx ,

Yes. Trying to make it work I fell into the uboot loading problems again. What is the most curious part, I did everything in the same way I was doing before and now it seems to work properly, but using the Toradex Angstron image. Next step will be using my custom image.

Colibri VFxx # print
arch=arm
baudrate=115200
board=colibri_vf
board_name=colibri_vf
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}extlinux/extlinux.conf
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr.uimg
boot_scripts=boot.scr.uimg boot.scr
boot_targets=mmc0 usb0 dhcp
bootcmd=run sdboot; setenv fdtfile ${soc}-colibri-${fdt_board}.dtb && run distro_bootcmd;
bootcmd_dhcp=if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;
bootcmd_mmc0=setenv devnum 0; run mmc_boot
bootcmd_usb0=setenv devnum 0; run usb_boot
bootdelay=1
console=ttyLP0
cpu=armv7
defargs=user_debug=30
dfu_alt_info=vf-bcb part 0,1;u-boot part 0,2;ubi part 0,4
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
eth1addr=00:14:2d:5b:ca:be
ethact=FEC
ethaddr=00:14:2d:4b:ca:be
fdt_addr_r=0x82000000
fdt_board=eval-v3
fdt_fixup=;
fdt_high=0xffffffff
fdtcontroladdr=877070c0
initrd_high=0xffffffff
ipaddr=192.168.10.2
kernel_addr_r=0x81000000
kernel_file=zImage
loadaddr=0x80008000
mmc_boot=if mmc dev ${devnum}; then setenv devtype mmc; run scan_dev_for_boot_part; fi
mtdparts=mtdparts=vf610_nfc:128k(vf-bcb)ro,1408k(u-boot)ro,512k(u-boot-env),-(ubi)
netmask=255.255.255.0
nfsargs=ip=:::::eth0: root=/dev/nfs
nfsboot=run setup; setenv bootargs ${defargs} ${nfsargs} ${setupargs} ${vidargs}; echo Booting from NFS...;dhcp ${kernel_addr_r} && tftp ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}
pxefile_addr_r=0x87100000
ramdisk_addr_r=0x82100000
scan_dev_for_boot=echo Scanning ${devtype} ${devnum}:${distro_bootpart}...; for prefix in ${boot_prefixes}; do run scan_dev_for_extlinux; run scan_dev_for_scripts; done;
scan_dev_for_boot_part=part list ${devtype} ${devnum} -bootable devplist; env exists devplist || setenv devplist 1; for distro_bootpart in ${devplist}; do if fstype ${devtype} ${devnum}:${distro_bootpart} bootfstype; then run scan_dev_for_boot; fi; done
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}extlinux/extlinux.conf; then echo Found ${prefix}extlinux/extlinux.conf; run boot_extlinux; echo SCRIPT FAILED: continuing...; fi
scan_dev_for_scripts=for script in ${boot_scripts}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${script}; then echo Found U-Boot script ${prefix}${script}; run boot_a_script; echo SCRIPT FAILED: continuing...; fi; done
scriptaddr=0x87000000
sdargs=root=/dev/mmcblk0p2 ro rootwait
sdboot=run setup; setenv bootargs ${defargs} ${sdargs} ${setupargs} ${vidargs}; echo Booting from MMC/SD card...; load mmc 0:1 ${kernel_addr_r} ${kernel_file} && load mmc 0:1 ${fdt_addr_r} ${soc}-colibri-${fdt_board}.dtb && run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}
serial#=04967102
serverip=192.168.10.1
setethupdate=if env exists ethaddr; then; else setenv ethaddr 00:14:2d:00:00:00; fi; tftpboot ${loadaddr} ${board}/flash_eth.img && source ${loadaddr}
setsdupdate=mmc rescan && setenv interface mmc && fatload ${interface} 0:1 ${loadaddr} ${board}/flash_blk.img && source ${loadaddr}
setup=setenv setupargs console=tty1 console=${console},${baudrate}n8 ${memargs} consoleblank=0 ${mtdparts}
setupdate=run setsdupdate || run setusbupdate || run setethupdate
setusbupdate=usb start && setenv interface usb && fatload ${interface} 0:1 ${loadaddr} ${board}/flash_blk.img && source ${loadaddr}
soc=vf500
splashpos=m,m
ubiargs=ubi.mtd=ubi root=ubi0:rootfs rw rootfstype=ubifs ubi.fm_autoconvert=1
ubiboot=run setup; setenv bootargs ${defargs} ${ubiargs} ${setupargs} ${vidargs}; echo Booting from NAND...; ubi part ubi && ubi read ${kernel_addr_r} kernel && ubi read ${fdt_addr_r} dtb && run fdt_fixup && bootz ${kernel_addr_r} - ${fdt_addr_r}
usb_boot=usb start; if usb dev ${devnum}; then setenv devtype usb; run scan_dev_for_boot_part; fi
vendor=toradex
ver=U-Boot 2016.11-2.8.7+g5c2d46b325 (Jun 10 2020 - 16:54:13 +0000)
video-mode=dcufb:640x480-16@60,monitor=lcd

Environment size: 4227/131068 bytes

Then, the only thing I changed was the bootcmd variable.

So far so good I can boot the Toradex image
https://developer.toradex.com/files/toradex-dev/uploads/media/Colibri/Linux/Images/Colibri-VF_Console-Image_2.8b7.-20200610.tar.bz2

Well, we can consider this issue solved, then?

I hope so :wink:

Thank you for the feedback.