Guidance on Automatic Boot Configuration for Apalis iMX6

Dear Team,

We have recently migrated from the Apalis T30 to the Apalis iMX6 module for one of our ongoing projects. With Apalis iMX6 modules we successfully bring up them up using the Yocto project.

At present, we are loading the application from a USB pendrive. The pendrive has two partitions (rootfs and boot), and we currently stop at the U-Boot prompt to run the command run bootcmd_usb0.

As we are now at the final stage, our requirement is to eliminate the use of the USB pendrive and configure the module to boot automatically.

Could you please guide us on how to set up the module for automatic boot?

Looking forward to your support.

Regards

Raj

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Setting Up Automatic Boot for Apalis iMX6

Hello Raj,

To configure your Apalis iMX6 module to boot automatically from USB without manual intervention, you need to modify the U-Boot environment variables to change the boot sequence.

Understanding the Current Boot Sequence

By default, U-Boot scans devices in this order(1):

  1. External SD card
  2. Internal flash memory (raw NAND or eMMC)
  3. External USB storage
  4. External server (DHCP)

The boot sequence is controlled by the boot_targets environment variable(2).

Solution: Modify Boot Targets

To make your module automatically boot from USB, you need to modify the boot_targets variable to prioritize USB storage. Here’s how:

  1. Access U-Boot console and modify the boot sequence:
setenv boot_targets 'usb0 mmc1 mmc2 mmc0 dhcp'
saveenv

(2)

  1. Save the environment to make the changes persistent(2).

Alternative Approach: Using Distro Boot Commands

If you want to ensure USB boot priority, you can also use specific distro boot commands(1):

run bootcmd_usb0

(1)

Environment Variables Reference

The key environment variables that control boot behavior include(2):

  • boot_targets or boot_devtype: Boot device type (mmc, usb, tftp, dhcp)
  • boot_devnum: Boot device number
  • boot_part: Boot partition number

Verification

After making these changes, your module should automatically attempt to boot from the USB device first. If the USB device is not present, it will fall back to the other devices in the sequence.

To verify your current environment variables, you can use(2):

printenv

(2)

This will show all currently set variables, allowing you to confirm your boot sequence configuration.

Best regards, Toradex AI Assistant.

Dear Toradex Team,

Thank you for your response. I would like to clarify our requirement in more detail.

We are not looking to boot from the USB pendrive anymore. Instead, we want to flash our Yocto build project (boot + rootfs) into the internal flash memory (eMMC/raw NAND) of the Apalis iMX6 modules and configure them to boot automatically from there once the power reset is done

.

Could you please guide us on the recommended procedure for:

  1. Flashing the Yocto-generated images (U-Boot, kernel, device tree, and rootfs) into the internal flash.

  2. Setting up U-Boot environment variables to ensure the module boots directly from the internal flash without manual intervention.

We are currently at the final stage of the project and this step is critical for our deployment. Your guidance on the correct approach (Toradex Easy Installer vs. manual flashing) would be highly appreciated.

Looking forward to your support.

Regards,
Raj

Hi @Raj1,

Please use Toradex easy installer and simply flash the OS to the internal eMMC by following the guide mentioned in the article.