RPMsg Not Creating /dev/ttyRPMSG0 on Apalis iMX8 (BSP 6.8.0)

Hi,
I am working with the Apalis iMX8 module using the TDX Reference Multimedia Image (BSP 6.8.0) built with Yocto. My goal is to establish communication between Cortex-M4 and Linux using RPMsg.

I have downloaded the SDK for Cortex-M4 from the NXP website and built the rpmsg_lite_str_echo_rtos example application. The application is successfully loaded onto the Cortex-M4_0 processor, and the only output I see on the M4 side is:

RPMSG String Echo FreeRTOS RTOS API Demo...

However, on the Linux side, /dev/ttyRPMSG0 is not created. Running dmesg | grep rpmsg shows:

[ 0.397693] imx rpmsg driver is registered.

Do I need to modify the device tree or provide a device tree overlay to enable RPMsg on Linux? If so, where can I find a working example or the necessary modifications?

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

To enable RPMsg communication between the Cortex-M4 and Linux on your Apalis iMX8 module, you will indeed need to ensure that the device tree is configured to support RPMsg. This typically involves using a device tree overlay to allocate the necessary resources for RPMsg communication.

Here’s a step-by-step guide to help you:

  1. Check for Existing Overlays: First, verify if there is an existing RPMsg overlay for your module. This overlay might be named something like rpmsg-imx8.dts.

  2. Apply the Overlay: Use the fw_setenv command to set the fdt_overlays environment variable in U-Boot to include the RPMsg overlay. For example:

    fw_setenv fdt_overlays <existing_overlays>,rpmsg-imx8.dtbo
    

    Replace <existing_overlays> with any other overlays you are currently using.

  3. Reboot the Module: After applying the overlay, reboot your module to apply the changes.

  4. Load the RPMsg Kernel Module: Once Linux has booted, ensure that the RPMsg kernel module is loaded by running:

    modprobe imx_rpmsg_tty
    
  5. Check dmesg Logs: Use dmesg | grep rpmsg to verify that the RPMsg driver is registered and functioning correctly.

If the /dev/ttyRPMSG0 device still does not appear, double-check the device tree overlay for any errors and ensure that the RPMsg example application on the Cortex-M4 is running correctly. Also, verify that the memory regions used by RPMsg are not being used by other parts of the system.

I hope this helps you get your RPMsg communication up and running!

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

RPMSG on a Toradex Apalis iMX8.

Hi @SruthiSathyan,
Yes, there are some modification needed on the device tree, this post should solve your issue.

I was able to successfully run the rpmsg_lite_str_echo_rtos example on the Apalis iMX8 and could see data using cat /dev/ttyRPMSG30 &. However, when I modified the transmitted data from the received value to a hardcoded one, I stopped receiving anything on cat /dev/ttyRPMSG30 &. Interestingly, I can still see the received message in dmesg.

My ultimate goal is to run a CAN program on Cortex-M4 and transfer the CAN data to Cortex-A via RPMsg, so that a Qt application running on Linux can access this data.
How should I proceed to resolve this issue?

Hi @SruthiSathyan

Sorry, can you explain more.
Where did you modify ?
Please check the rpmsg_lite_str_echo_rtos source code for further debugging.

Next you can test CAN demos and then try to send CAN data via RPMSG virtual port.

For working on CAN on the cortexM4 processor of apalis imx8:
1.Device Tree:
Do I need to modify the Linux device tree to use CAN from the M4 core, or is it accessible if unused by Linux?
2.Classical CAN:
The SDK only provides FlexCAN examples. Can it be configured for classical CAN (11-bit, no CAN FD)? If so, how?
3.CANL / CANH Pins:
Which physical pins correspond to CANL and CANH for use with M4? Which FlexCAN instance maps to which pins?