Running CM4s and Linux on Apalis iMX8QM

Hello,

I’m attempting to run two Cortex M4s and Linux (Yocto BSP 7.2) simultaneously. On the M4s, I have a simple example that prints text on the debug consoles in a loop (hello world). I’ve applied the two overlays mentioned at How to Run Hello World on the Cortex-M | Toradex Developer Center.

Here’s a breakdown of the overlay application process:

  • Executing script at 9d480000

  • Loading DeviceTree: imx8qm-apalis-v1.1-eval.dtb

  • 176892 bytes read in 6 ms (28.1 MiB/s)

  • 184 bytes read in 0 ms

  • Working FDT set to 9d400000

  • Applying Overlay: apalis-imx8_hdmi_overlay.dtbo

  • 2205 bytes read in 1 ms (2.1 MiB/s)

  • Applying Overlay: apalis-imx8_spi1_spidev_overlay.dtbo

  • 551 bytes read in 1 ms (538.1 KiB/s)

  • Applying Overlay: apalis-imx8_spi2_spidev_overlay.dtbo

  • 551 bytes read in 1 ms (538.1 KiB/s)

  • Applying Overlay: disable_spi0_can0_overlay.dtbo

  • 299 bytes read in 2 ms (145.5 KiB/s)

  • Applying Overlay: overlayCM4_1.dtbo

  • 593 bytes read in 2 ms (289.1 KiB/s)

  • Applying Overlay: overlayCM4_0.dtbo

  • 1543 bytes read in 2 ms (752.9 KiB/s)

However, when I boot Linux using the run bootcmd command, the M4s stop printing, and I assume they’re no longer running.

Could you please provide some advice on how to ensure that the M4s run in parallel with Linux?

Thanks,
Florin

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 Florin,

Thank you for your detailed description. What you’re experiencing is a known issue when running both Cortex-M4s and Linux with BSP 7.x (Linux kernel 6.6) on the Apalis iMX8 platform. Community reports confirm that with BSP 7.x, attempting to launch both Linux and M4 firmware together can cause faults (notably, a reboot with a reported SCFW fault), making the M4 cores stop running after Linux boots (1).

Advice and Recommended Solutions:

  1. Use BSP 6.x (Linux kernel 5.15):
    BSP 6 has been reported to work reliably for concurrent execution of Linux and both M4 cores. If your use-case requires both Linux and M4 to run together, it is strongly recommended to use BSP 6.x for the time being.

  2. Device Tree Overlays:
    It looks like your overlays are being correctly applied. For reference on custom overlays, you can see the documentation here:
    Development: Writing a Custom DTO

  3. Test M4 Standalone First:
    To ensure your firmware is functional, you can initially boot only the M4 cores without Linux, verify their operation, and then introduce Linux (on BSP 6) for parallel operation.

Summary:
Due to a confirmed issue with the current BSP 7.x (kernel 6.6), running both Linux and the M4s simultaneously is not stable on the Apalis iMX8. For consistent operation, please downgrade to BSP 6.x. If you need to continue with the latest BSP, be aware that the issue is under investigation and a stable solution is not yet available.

More details can be found in the community discussion:
https://community.toradex.com/t/cortex-m4-issue-on-imx8qm-stuck-boot/26950

If you have further questions on configuration or the migration process, feel free to ask!

Best regards,
Toradex AI Assistant.

Hi @Florin

This page and these overlays were tested on BSP 6, so to make it work for BSP 7 you may need to tweak it a bit.


If you are running the hello world inside the loop example.
The M4 core is actually still running your script and printing it, but the UART pin is claimed by A-core Linux, so the M4 core can’t really write the print values.