Enable auto boot from SD card

I have built a reference image following the steps in Build a Reference Image with Yocto Project/OpenEmbedded.

I have Apalis iMX8 QuadMax 4GB WB IT v1.1E on Apalis Evaluation Board v1.1Z.
I am trying to boot from an SD card using wic files. When I switch on, by default it automatically starts to boot from mmc0. So, everytime I need to interrupt the booting and execute the following commands to load image and kernel and boot from mmc1(SD card).

load mmc 1:1 $loadaddr Image.gz
load mmc 1:1 $fdt_addr_r imx8qm-apalis-v1.1-eval.dtb
unzip $loadaddr $kernel_addr_r
setenv bootargs "root=/dev/mmcblk1p2"
booti $kernel_addr_r - $fdt_addr_r

I like to know whether there is any hardware/software setting to enable booting from SD card directly when I switch on.

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


To enable automatic booting from the SD card (mmc1) on your Apalis iMX8 QuadMax, you need to modify the U-Boot environment variables to set the SD card as the default boot source. Here’s how you can do it:

  1. Interrupt the U-Boot boot process by pressing any key within the first 2 seconds after powering on the board.

  2. Set the environment variables to load the kernel and device tree from the SD card and set the appropriate boot arguments. You can do this by running the following commands in the U-Boot console:

    setenv bootcmd 'load mmc 1:1 $loadaddr Image.gz; load mmc 1:1 $fdt_addr_r imx8qm-apalis-v1.1-eval.dtb; unzip $loadaddr $kernel_addr_r; setenv bootargs "root=/dev/mmcblk1p2"; booti $kernel_addr_r - $fdt_addr_r'
    saveenv
    
  3. Save the environment variables to make the changes persistent across reboots. The saveenv command will store the modified environment variables in the non-volatile storage.

  4. Reboot the board to test the new boot configuration:

    reset
    

After performing these steps, your Apalis iMX8 QuadMax should automatically boot from the SD card (mmc1) without requiring manual intervention.

If you need to revert to the default boot configuration (booting from mmc0), you can interrupt the boot process again and reset the bootcmd variable to its original value or use the env default -a command to reset all environment variables to their default values.