2416213_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2416213_en-US

2416213_en-US

i.MX8M Quad – M4 Core Boot Steps and Required U-Boot Commands

I am working with an i.MX8M Quad EVK SD card image and would like to understand the correct procedure for booting and running an application on the Cortex-M4 core from U-Boot.

I have downloaded the MCUXpresso SDK for the i.MX8M Quad and successfully compiled the Hello World example for the M4 core. I now have the generated .bin firmware file.

Please provide the correct U-Boot commands and boot sequence to load and start this M4 .bin firmware from U-Boot? And how to check M4 console ?


#imx8mq

#m4

#cortex-m4

#boot_m4

#UBoot

#yocto

#uboot-commands


i.MX 8 Family | i.MX 8QuadMax (8QM) | 8QuadPlusLinuxYocto ProjectRe: i.MX8M Quad – M4 Core Boot Steps and Required U-Boot Commands

Hello,

Step-by-Step U-Boot Commands

1. Prepare the SD Card

Copy your compiled .bin file (e.g., hello_world.bin) to the FAT/boot partition (partition 1) of the SD card before inserting it into the EVK.

2. Stop U-Boot Autoboot

Power on the board and immediately press any key to interrupt autoboot at the U-Boot prompt.

3. Option A — TCM Execution (Recommended for MCUXpresso SDK apps)

This is the standard method for MCUXpresso SDK Hello World examples, which are linked to run from TCM at 0x1FFE0000 (alias 0x7E0000

# Step 1: Load .bin from SD card FAT partition into a DDR staging buffer
u-boot=> fatload mmc 1:1 0x48000000 hello_world.bin

# Step 2: Copy the image from DDR staging buffer into the M4's TCM
u-boot=> cp.b 0x48000000 0x7e0000 0x20000

# Step 3: (Optional but recommended) Flush data cache before starting M4
u-boot=> dcache flush

# Step 4: Release M4 from reset and start execution from TCM
u-boot=> bootaux 0x7e0000
 

You should see output like:

## Starting auxiliary core stack = 0x20020000, pc = 0x1FFE0305...
 
 

 

3. Option B — DDR Execution

If your binary is linked to run from DDR (e.g., 0x80000000

u-boot=> fatload mmc 1:1 0x80000000 hello_world.bin
u-boot=> dcache flush
u-boot=> bootaux 0x80000000

 

Important: Use 0x7e0000 (TCM) or 0x80000000 (DDR) depending on the linker script used when you compiled the MCUXpresso SDK app. For the default Hello World example, TCM (0x7e0000) is the correct target.

Optional: Clear Resource Table Area (for Hello World / bare-metal)

If your image does not have an RPMsg resource table (like a simple hello_world.bin), clear the resource table area to avoid garbage values that could confuse Linux later:

u-boot=> mw 0xb80ff000 0 4

Optional: Run prepare_mcore (When Linux Will Also Boot)

If you plan to continue booting Linux after starting the M4, run this additional command before bootaux. It configures clocks so Linux does not disable M4-used clocks:

u-boot=> fatload mmc 1:1 0x48000000 hello_world.bin
u-boot=> cp.b 0x48000000 0x7e0000 0x20000
u-boot=> run prepare_mcore
u-boot=> bootaux 0x7e0000
 
 

Checking the M4 Console

The i.MX8MQ EVK uses an FTDI USB-serial chip that enumerates two separate COM ports when connected to the PC:

Port Core
Lower number (e.g., COM9 / /dev/ttyUSB0) Cortex-A53 (U-Boot / Linux console)
Higher number (e.g., COM10 / /dev/ttyUSB1) Cortex-M4 console
 
 
 

Settings for both ports: 115200 baud, 8 data bits, No parity, 1 stop bit (115200 8N1).

Open two separate terminal windows (e.g., TeraTerm, minicom, PuTTY):

  • Terminal 1 → Lower COM port → for U-Boot commands
  • Terminal 2 → Higher COM port → to see M4 Hello World output

Quick Reference: Automation via Environment Variables

You can save these as U-Boot environment variables for convenience:

u-boot=> setenv m4_image hello_world.bin
u-boot=> setenv m4_loadaddr 0x7e0000
u-boot=> setenv load_m4_image "fatload mmc '${mmcdev}':'${mmcpart}' 0x48000000 '${m4_image}'; cp.b 0x48000000 0x7e0000 0x20000"
u-boot=> setenv run_m4_image "run load_m4_image; bootaux '${m4_loadaddr}'"
u-boot=> saveenv
# Then simply run:
u-boot=> run run_m4_image
 
 

Key Reference Documents

Regards


Tags (1)
No ratings
Version history
Last update:
a week ago
Updated by: