device tree overlay for rpmsg on colibri imx7d

i am new to the embedded linux world and i am struggling to understand how to establish a communication between the cortex-a and the cortex-m in my colibri-imx7d. i know how to load a firmware to the m4 core using u-boot and know i want to proceed to load the file using rpmsg and i also want to trade data between a7 and m4.

i was trying to follow this, but there is not a overlay for imx7 and now i am kinda lost. i read other topics related to it, but they said something about rpmsg not been available for some os versions.

i also tried to follow the zephyr documentation about it, but it is written the following: The sample was tested with Toradex’s LTS BSP 6.6.0 Minimal Open Embedded image with upstream Linux kernel 6.1.83. i followed the steps and it did not work.

I would like to understand better what is the right path for me to reach my goal.

some info:

colibri-imx7-emmc
Operating System: TorizonCore Upstream 6.8.0+build.22 (kirkstone)
Kernel: Linux 6.1.112-6.8.0+git.aa4cd140bba5

Thanks!

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:


Understanding RPMsg Communication on Colibri iMX7D

You’re correct that establishing RPMsg communication between Cortex-A7 and Cortex-M4 on the Colibri iMX7D requires specific device tree modifications and proper setup. Currently, there isn’t a ready-to-use device tree overlay for Colibri iMX7D on TorizonCore/Torizon OS 7, which is causing the challenges you’re experiencing(1).

Current Status and Challenges

The device tree overlay for colibri-imx7_hmp_overlay.dts is marked as “coming soon” in the official documentation(2). This means you’ll need to manually configure the device tree to enable RPMsg functionality.

Recommended Approach

Option 1: Use FreeRTOS with Manual Device Tree Configuration

Since you’re already familiar with loading firmware to the M4 core, the most straightforward path is to use FreeRTOS with manual device tree modifications:

  1. Follow the FreeRTOS Guide: The comprehensive guide for running FreeRTOS on Cortex-M4 of Colibri iMX7 provides detailed examples(3).

  2. Device Tree Requirements: You’ll need to disable conflicting peripherals in the Linux device tree and configure the Resource Domain Controller (RDC) properly(3). The RDC allows defining up to 4 resource domains and assigning peripherals to those domains(3).

  3. Available Examples: Several working examples are available including:

    • Hello World example(3)
    • GPIO Example using EXT_IO pins(3)
    • RPMsg TTY Example for communication(3)
    • RPMsg PingPong Example(3)

Option 2: Consider Alternative Solutions

Based on community discussions, some users have found success with:

  1. Using NXP’s BSP 6.12 kernel: One community member hired a consultant to upgrade to NXP’s 6.12 kernel while keeping FreeRTOS firmware(1).

  2. Zephyr RTOS: The Zephyr documentation you mentioned provides RPMsg communication examples, though it requires porting your application from FreeRTOS to Zephyr(1).

RPMsg Communication Setup

Once you have the device tree configured, the communication flow works as follows:

  1. Load RPMsg Driver: After booting Linux, load the RPMsg driver(2):
# sudo modprobe imx_rpmsg_tty

(2)

  1. Verify Communication: Check if the ttyRPMSG device is created(2):
# ls /dev/ | grep -i rpmsg

(2)

  1. Exchange Data: Write to the device to communicate with the M4 core(2):
# echo "Toradex!" > /dev/ttyRPMSG30

(2)

Memory Configuration

The RPMsg implementation requires specific memory buffer reservations. The system uses shared memory buffers (typically 512 bytes with 256 buffers for each direction) and VirtIO Ring Buffers for communication(3).

Next Steps

Given your current TorizonCore setup, I recommend:

  1. Start with the FreeRTOS examples from the official documentation(3)
  2. Manually configure the device tree based on the memory requirements shown in the examples
  3. Test with the Hello World example first, then progress to RPMsg communication examples

The FreeRTOS approach is well-documented and tested, making it the most reliable path for establishing Cortex-A7 to Cortex-M4 communication on your Colibri iMX7D.

Best regards, Toradex AI Assistant.

Hello,

I’ve been using RPMSG on the Colibri iMX7d for more than 5 years. I’m still waiting the device-tree from Toradex for the current BSP version.

I would be also interested by any reply from Toradex.

1 Like

Hello @luke-ros and @arnaud_mc,

The following device tree overlay has been tested with Zephyr on the Colibri iMX7:

colibri-imx7d_rpmsg_overlay.dts (1.4 KB)

Please note that this should allow for the use of upstream RPMSG, but as far as I am aware it is not directly compatible with the downstream implementation on NXP’s version of FreeRTOS.

Best Regards,
Bruno

Hello @bruno.tx , thanks for the reply and sorry for being late.

During this interval, I decided to follow the zephyr tutorial I sent, so I left Torizon and migrated to a minimal reference image. I did exactly what the tutorial said (just adjusted the my phandles) but my A7 crashes when I start the M4 firmware. I have just created a topic about it here.

But I will return to Torizon OS and I will try your overlay and give a feedback in this post

Thanks!