Need to boot IMX8QM through SD Card by default

Hi team,

We are currently using Toradex IMX8QM board for the Yocto project. We tried to flash the image via SD card. We were able to flash the image manually.
These are the steps we followed to flash the image:

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

However, we wanted to boot image via SD card automatically. We searched in the HW but we were not able to find the DIP switches to change the boot mode in HW.

Could you please provide the steps to select the boot mode automatically in HW and SW.

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 boot the Toradex Apalis iMX8QM from an SD card by default, you need to modify the U-Boot environment to automatically boot from the SD card. Since you mentioned that you couldn’t find DIP switches to change the boot mode, we’ll focus on the software approach.

Here are the steps to set up automatic booting from the SD card:

  1. Prepare the SD Card:
    Ensure your SD card is properly prepared with the necessary partitions and files. You can use the wic image method as described in the context to create a bootable SD card.

  2. Modify U-Boot Environment:
    You need to modify the U-Boot environment variables to set the SD card as the default boot device. This can be done by updating the bootcmd variable in U-Boot.

  3. Access U-Boot Console:
    Insert the SD card into the carrier board slot, power on the module, and quickly access the U-Boot console by pressing any key within the first 2 seconds.

  4. Set U-Boot Environment Variables:
    In the U-Boot console, set the environment variables to boot from the SD card by default. You can do this by running the following commands:

    setenv bootcmd 'mmc dev 1; 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
    

    This command sets the bootcmd variable to the sequence of commands you provided and saves the environment variables to persistent storage.

  5. Reboot:
    Reboot the board to ensure it boots from the SD card automatically.

    reset
    

By following these steps, your Toradex Apalis iMX8QM should boot from the SD card by default without the need for DIP switches. If you need to revert to the original boot settings, you can access the U-Boot console again and modify the bootcmd variable accordingly.

Hi @karthikgowda6 ,
You can change the boot order to boot from SD card first from the u-boot environment.
Please check the parameter “boot_targets”