How to load binary to cortex m4 in colibri imx7d 1 gb? emmc

Greetings!

I’m using a Colibri IMX7D 1 GB V1.1 A with Torizon OS and I am trying to load a binary to the M4 cortex without an external SD card.

Also, I disabled uart B on Torizon so M4 can use it.

I followed this tutorial but I am receiving the following log:

   key to stop autoboot:  0 
Colibri iMX7 # Bprintenv m4boot
m4boot=;
Colibri iMX7 # printenv loadaddr
loadaddr=0x84200000
Colibri iMX7 # setenv loadcmd "ext4load mmc 0:1"
Colibri iMX7 # setenv m4image "/ostree/deploy/torizon/var/helloworld.bin"
Colibri iMX7 # setenv loadm4image "${loadcmd"ڱ ${m4image
Colibri iMX7 # etenv m4boot "${loadm4image'" flush; bootaux ${loadaddr
Colibri iMX7 # savenv
Saving Environment to MMC... Writing to MMC(0)... OK
Colibri iMX7 # run m4boot
11332 bytes read in 3 ms (3.6 MiB/s)
## No elf image at address 0x84200000
## Starting auxiliary core stack = 0x20008000, pc = 0x1FFF82BD...
Colibri iMX7 # run m4bootC11332 bytes read in 3 ms (3.6 MiB/s)
## Auxiliary core is already up
Colibrsetenv loadm4image "${loadcmd} ${loadaddr} ${m4image}"        

I am getting that there is no elf image at that address, but in the tutorial it is a .bin that is used as example. does it have to be a .elf?

Also, I am using a USB Serial converter and I am not getting any message.

I generated the .bin file following this tutorial.

I think it is valid to point that my loadaddr is different from the tutorial.

Is there something I am missing?

Thanks in advance!

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:


Hello! Thank you for reaching out with your issue regarding M4 binary loading on the Colibri iMX7D under Torizon OS.

Based on your information and logs, there are a few important points to address:

1. Binary Format for M4

For the Colibri iMX7 1GB, it is required to use a .elf file, not a .bin file. The U-Boot bootaux command expects an ELF file, as it relies on the ELF header to correctly load and start the M4 firmware. Using a .bin file will result in the error you observed:

No elf image at address ...

Please re-build your firmware and deploy the .elf output instead of the .bin.

Reference:


2. loadaddr Value

You are currently using 0x84200000 as your loadaddr, but the default and documented load address for the Colibri iMX7 is 0x80800000. Using a different address may lead to improper loading or startup failures.

Recommended setting:

setenv loadaddr 0x80800000

3. Environment Variables

There were some typos in your setenv commands (e.g., mismatched quotes and variable names). Here is a corrected and working sequence:

setenv loadaddr 0x80800000
setenv load_cmd 'ext4load mmc 0:1'
setenv m4image '/ostree/deploy/torizon/var/hello_world.elf'
setenv loadm4image '${load_cmd} ${loadaddr} ${m4image}'
setenv m4boot '${loadm4image}; dcache flush; bootaux ${loadaddr}'
saveenv

Then load and run:

run m4boot

Note: Adjust /ostree/deploy/torizon/var/hello_world.elf to the path where your .elf actually resides.


4. Serial Debug Output

The default FreeRTOS examples for iMX7 use UART_B for debug messages at 115200 baud. Please ensure:

  • UART_B is not used by Torizon (you already mentioned you disabled it, which is correct).
  • Your USB Serial converter is connected to UART_B pins.
  • Your serial client is configured to the correct baudrate (115200).

More info:


Summary – Action Plan

  1. Rebuild and use the .elf image—not .bin.
  2. Set loadaddr to 0x80800000.
  3. Use the corrected environment variable sequence above.
  4. Confirm UART_B wiring and configuration for debug output.

Please update your process with the above corrections and let me know if the M4 core boots your ELF file and outputs debug logs as expected!

Best regards,
Toradex AI Assistant.

References:

Hi @luke-ros!

Which Torizon OS version are you using? As far as I know, you can use either a .bin or .elf in the newer versions of Torizon OS.

In the log you sent, I saw some typing errors (as the Toradex AI said):

Colibri iMX7 # setenv loadm4image "${loadcmd"ڱ ${m4image
Colibri iMX7 # etenv m4boot "${loadm4image'" flush; bootaux ${loadaddr

Did you write it exactly as you sent?

Best regards.