## Error: "sdboot" not defined

I want to boot from a SD card, according to this document: https://developer.toradex.com/easy-installer/alternative-approaches/boot-from-an-sd-card-usb-stick-sata-drive/#using-toradex-images:

Colibri iMX6 # run sdboot
## Error: "sdboot" not defined
Colibri iMX6 # printenv
arch=arm
baudrate=115200
board=colibri_imx6
board_name=colibri_imx6
board_rev=011b
boot_a_script=load ${devtype} ${devnum}:${distro_bootpart} ${scriptaddr} ${prefix}${script}; source ${scriptaddr}
boot_efi_binary=load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} efi/boot/bootarm.efi; if fdt addr -q ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r};else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi
boot_efi_bootmgr=if fdt addr -q ${fdt_addr_r}; then bootefi bootmgr ${fdt_addr_r};else bootefi bootmgr;fi
boot_extlinux=sysboot ${devtype} ${devnum}:${distro_bootpart} any ${scriptaddr} ${prefix}${boot_syslinux_conf}
boot_file=zImage
boot_net_usb_start=usb start
boot_prefixes=/ /boot/
boot_script_dhcp=boot.scr
boot_scripts=boot.scr.uimg boot.scr
boot_syslinux_conf=extlinux/extlinux.conf
boot_targets=mmc1 mmc0 usb0 dhcp 
bootcmd=run distro_bootcmd; usb start; setenv stdout serial,vidconsole; setenv stdin serial,usbkbd
bootcmd_dhcp=devtype=dhcp; if dhcp ${scriptaddr} ${boot_script_dhcp}; then source ${scriptaddr}; fi;setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; setenv efi_old_vci ${bootp_vci};setenv efi_old_arch ${bootp_arch};setenv bootp_vci PXEClient:Arch:00010:UNDI:003000;setenv bootp_arch 0xa;if dhcp ${kernel_addr_r}; then tftpboot ${fdt_addr_r} dtb/${efi_fdtfile};if fdt addr -q ${fdt_addr_r}; then bootefi ${kernel_addr_r} ${fdt_addr_r}; else bootefi ${kernel_addr_r} ${fdtcontroladdr};fi;fi;setenv bootp_vci ${efi_old_vci};setenv bootp_arch ${efi_old_arch};setenv efi_fdtfile;setenv efi_old_arch;setenv efi_old_vci;
bootcmd_mmc0=devnum=0; run mmc_boot
bootcmd_mmc1=devnum=1; run mmc_boot
bootcmd_usb0=devnum=0; run usb_boot
bootcount=1
bootdelay=1
bootm_size=0x10000000
console=ttymxc0
cpu=armv7
defargs=enable_wait_mode=off galcore.contiguousSize=50331648
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
efi_dtb_prefixes=/ /dtb/ /dtb/current/
ethaddr=00:14:2d:a8:aa:f5
fdt_addr_r=0x18200000
fdt_board=eval-v3
fdt_file=imx6dl-colibri-eval-v3.dtb
fdt_fixup=;
fdtcontroladdr=2df724f0
fdtfile=imx6dl-colibri-eval-v3.dtb
ipaddr=192.168.10.2
kernel_addr_r=0x14200000
load_efi_dtb=load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${prefix}${efi_fdtfile}
loadaddr=0x14200000
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
netmask=255.255.255.0
preboot=test -n ${fdtfile} || setenv fdtfile imx6dl-colibri-${fdt_board}.dtb
pxefile_addr_r=0x18300000
ramdisk_addr_r=0x18400000
rootpath=/srv/nfs
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;run scan_dev_for_efi;
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; setenv devplist
scan_dev_for_efi=setenv efi_fdtfile ${fdtfile}; if test -z "${fdtfile}" -a -n "${soc}"; then setenv efi_fdtfile ${soc}-${board}${boardver}.dtb; fi; for prefix in ${efi_dtb_prefixes}; do if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${efi_fdtfile}; then run load_efi_dtb; fi;done;run boot_efi_bootmgr;if test -e ${devtype} ${devnum}:${distro_bootpart} efi/boot/bootarm.efi; then echo Found EFI removable media binary efi/boot/bootarm.efi; run boot_efi_binary; echo EFI LOAD FAILED: continuing...; fi; setenv efi_fdtfile
scan_dev_for_extlinux=if test -e ${devtype} ${devnum}:${distro_bootpart} ${prefix}${boot_syslinux_conf}; then echo Found ${prefix}${boot_syslinux_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=0x18280000
serial#=11053813
serverip=192.168.10.1
set_blkcnt=setexpr blkcnt ${filesize} + 0x1ff && setexpr blkcnt ${blkcnt} / 0x200
setethupdate=if env exists ethaddr; then; else setenv ethaddr 00:14:2d:00:00:00; fi; tftpboot ${loadaddr} flash_eth.img && source ${loadaddr}
setsdupdate=setenv interface mmc; setenv drive 1; mmc rescan; load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && source ${loadaddr}
setup=setenv setupargs fec_mac=${ethaddr} consoleblank=0 no_console_suspend=1 console=tty1 console=${console},${baudrate}n8
setupdate=run setsdupdate || run setusbupdate || run setethupdate
setusbupdate=usb start && setenv interface usb; setenv drive 0; load ${interface} ${drive}:1 ${loadaddr} flash_blk.img && source ${loadaddr}
soc=mx6
splashimage=0x14200000
splashpos=m,m
stderr=serial@2020000
stdin=serial@2020000
stdout=serial@2020000
uboot_blk=8a
uboot_hwpart=1
uboot_spl_blk=2
update_spl=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} ${uboot_spl_blk} ${blkcnt}
update_uboot=run set_blkcnt && mmc dev 0 ${uboot_hwpart} && mmc write ${loadaddr} ${uboot_blk} ${blkcnt}
usb_boot=usb start; if usb dev ${devnum}; then devtype=usb; run scan_dev_for_boot_part; fi
vendor=toradex
ver=U-Boot 2022.07-6.0.0+git.e092e3250270 (Jul 11 2022 - 13:42:58 +0000)
vidargs=fbmem=8M

Environment size: 5343/8188 bytes
Colibri iMX6 #

Hello @ubx ,

Thanks for reaching out!
What output do you get running # print bootcmd command on U-Boot shell?
If it outputs something other than bootcmd=run sdboot you must change the environment variable.
Try this: # setenv bootcmd 'run sdboot' ; saveenv ; reboot
Let me know if that solves the issue for you.

Hi rudhi.tx

What output do you get running # print bootcmd command on U-Boot shell?

Colibri iMX6 # print bootcmd
bootcmd=run distro_bootcmd; usb start; setenv stdout serial,vidconsole; setenv stdin serial,usbkbd

Try this: # setenv bootcmd 'run sdboot' ; saveenv ; reboot

Colibri iMX6 # print bootcmd
bootcmd=run sdboot

Then I tried:

Colibri iMX6 # run sd_boot  
## Error: "sd_boot" not defined

By the way, run usb_boot works as expected.

Hello @ubx ,

Thanks for your reply. May I ask you a few other questions which could help us solve your issue faster:

  1. What output do you get on running the commands mmc info and mmc list from the U-Boot shell?
  2. What carrier board are you using for your Colibri iMX6 module?
  3. Could you also send me the logs from your boot?

Hello rudhi.tx

Here are my answers:

Colibri iMX6 #  mmc list
FSL_SDHC: 1
FSL_SDHC: 0 (eMMC)
Colibri iMX6 # mmc info
Device: FSL_SDHC
Manufacturer ID: 1
OEM: 0
Name: S40004 
Bus Speed: 49500000
Mode: MMC High Speed (52MHz)
Rd Block Len: 512
MMC version 5.1
High Capacity: Yes
Capacity: 3.6 GiB
Bus Width: 8-bit
Erase Group Size: 512 KiB
HC WP Group Size: 8 MiB
User Capacity: 3.6 GiB WRREL
Boot Capacity: 4 MiB ENH
RPMB Capacity: 4 MiB ENH
Boot area 0 is not write protected
Boot area 1 is not write protected
Colibri iMX6 # mmc list
FSL_SDHC: 1
FSL_SDHC: 0 (eMMC)
  1. What carrier board are you using for your Colibri iMX6 module?

Col Evaluation
V3.2B
00060601

  1. Could you also send me the logs from your boot?

What log do you exactly mean ?

What log do you exactly mean ?

The logs appear on the console when the module is booting up. It looks like the following:

U-Boot 2020.04-5.7.0+git.33bb8e968332 (Jan 01 1970 - 00:00:00 +0000)

CPU:   NXP i.MX8QXP RevC A35 at 1200 MHz at 55C

DRAM:  2 GiB
MMC:   FSL_SDHC: 0, FSL_SDHC: 1
Loading Environment from MMC... OK
In:    serial
Out:   serial
Err:   serial
...
...

Is your U-Boot bootloader custom built by you from the source code?
Also, are you using a custom yocto image or one of our reference images (if then which version)?

Hello rudhi.tx

Just to recap: Error: “sdboot” not defined. So no boot, no boot log!

The Colibri iMX6 board is a ‘virgin’ one bough from Toradex. The yocto reference image is tdx-reference-minimal-image.
Btw, I can boot the same image from a USB-SD adaptor. But not directly from a SD card!

Hi @ubx !

Could you please share the output of your U-boot shell when you run the following commands:

mmc list

mmc dev 0
mmc info

mmc dev 1
mmc info

Seems like we need to update our documentation regarding the sdboot command, since it is not present anymore. We are going to trigger it. Thanks for pointing this out. Please also try to boot by doing each of the following:

run bootcmd_mmc0
run bootcmd_mmc1

About this, Rudhi asked for your usual OS boot log. The one that you already have installed on the module and not the one you want to boot from the SD card. Please share this as well :slight_smile:

Best regards,