Problem with pingpong example on torizon and imx8mm

Hi all ,
We start to work with Torizon Os Easy Pairing 7.2.0 and Verdin iMX8M Mini DualLite 1GB.

We started by launching the Hello World demo on the M4 side, and we encountered no problems.
We then tried the “pingpong” example, but we encountered some problems…

Ok to launch from the M4 side, and we have the message

> RPMSG Ping-Pong FreeRTOS RTOS API Demo...
> RPMSG Share Base Addr is 0xb8000000

but we never had the following message :

> Link is up!
> Nameservice announce sent.

we certainly forgot something but what, here are the steps:

  • we load the firmware on U-boot:

setenv load_cmd “ext4load mmc 0:1”
setenv m4image “/home/root/rpmsg_lite_pingpong_rtos_linux_remote.bin”
setenv m4image_size 10000
setenv loadm4image “${load_cmd} ${loadaddr} ${m4image}”
setenv m4boot “${loadm4image}; cp.b ${loadaddr} 0x7e0000 ${m4image_size}; dcache flush; bootaux 0x7e0000”
saveenv
run m4boot

  • we modify the file /sysroot/boot/ostree/torizon-*/dtb/overlays.txt :
    fdt_overlays=verdin-imx8mm_dsi-to-hdmi_overlay.dtbo verdin-imx8mm_spidev_overlay.dtbo verdin-imx8mm_hmp_overlay.dtbo

  • we load the kernel module :

sudo modprobe imx_rpmsg_pingpong

And nothing else …
Any suggestions ? someone to help us ?

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!

It seems you’re encountering an issue with RPMsg communication due to a missing HMP (Heterogeneous Multi-Processing) overlay. Let’s walk through the steps to resolve this:

  1. Apply the HMP Device Tree Overlay: You need to apply the HMP device tree overlay to enable RPMsg communication. Use the following overlay:

    verdin-imx8mm_hmp_overlay.dtbo
    

    You can find more details in the Toradex documentation.

  2. Verify the RPMsg Driver: Ensure that the RPMsg driver is loaded by checking the system messages:

    # dmesg | grep -i rpmsg
    [    0.045742] imx rpmsg driver is registered.
    

    This confirms that the driver is active.

  3. Load the Kernel Module for Pingpong Example: After applying the overlay and loading the firmware, load the kernel module for the pingpong example:

    # sudo modprobe imx_rpmsg_pingpong
    
  4. Check Cortex-M4 Messages: When everything is configured correctly, you should see the following messages on the Cortex-M4:

    RPMSG Ping-Pong FreeRTOS RTOS API Demo...
    RPMSG Share Base Addr is 0xb8000000
    Link is up!
    Nameservice announce sent.
    

If you’re using Torizon OS 7, there are known issues with RPMsg functionality that might require additional kernel command line arguments. For more information, please refer to the Toradex community discussion regarding these specific kernel arguments for Verdin iMX8MM users.

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

Best regards,
Toradex AI Assistant.

Hello @slou26,

Sorry for the delay on this topic, I will try to reproduce the problem here.

Best Regards,
Bruno

1 Like

Hi @bruno.tx ,

Have you been able to try on your side?
Thanks

Hello @slou26,

Unfortunately not yet.
I should be able to test this today and give you a response by tomorrow at the latest.

Best Regards,
Bruno

Hello @slou26,

At this point I have been able to reproduce the issue.
I will look into possible solutions.
It is likely related to some issue with RPMSG, but I need to do more testing.

Best Regards,
Bruno

Hi @bruno.tx ,
Do you have any news ?

Tks
Regards,

Hello @slou26,

Sorry for the delay here.
I was able to get this to work by adding a kernel argument which avoids the M4 core from being stopped when Linux boots.

Can you try to set the following variable as well in u-boot?

setenv tdxargs clk-imx8mm.mcore_booted=1
saveenv

Best Regards,
Bruno

Tks @bruno.tx for your reply, but always the same thing on my side .

Verdin iMX8MM # printenv tdxargs
tdxargs=clk-imx8mm.mcore_booted=1

I never had a “link up” :frowning:
In overlay.txt , did you remove all the overlays and leave only “verdin-imx8mm_hmp_overlay.dtbo” ?

What is the content in your overlay.txt ?

@bruno.tx ,

Going through the steps in my first post, do you see anything that would prevent the connection between the two cores? I don’t understand why?
It doesn’t work even with your modification.
tks

Hello @slou26,

Since @bruno.tx is out of the office for a few days, I’m taking over your case. I could reproduce the issue and solve it with some tweaks in the device tree overlay file and the source code of the ping-pong demo. The problem was that the overlay does not use the address base for a 2GB RAM. So I had to change the addresses in the overlay file and also in the SDK_25_03_00_MIMX8MM3xxxLZ/boards/evkmimx8mm/multicore_examples/rpmsg_lite_pingpong_rtos_linux/remote/board.h file.
The following are the changes:

board.h file:
..............................................
..............................................
/* Shared memory base for RPMsg communication. */
#define VDEV0_VRING_BASE      (0x78000000U)
..............................................
..............................................

verdin-imx8mm_hmp_overlay.dts (please use branch toradex_6.6-2.2.x-imx)file:

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
 * Copyright 2022 Toradex
 */

// Enable RPMSG and the M4 driver

/dts-v1/;
/plugin/;

#include <dt-bindings/clock/imx8mm-clock.h>

/ {
        compatible = "toradex,verdin-imx8mm";
};

&{/} {
        #address-cells = <2>;
        #size-cells = <2>;
        imx8mm-cm4 {
                compatible = "fsl,imx8mm-cm4";
                rsc-da = <0xb8000000>;
                clocks = <&clk IMX8MM_CLK_M4_DIV>;
                mbox-names = "tx", "rx", "rxdb";
                mboxes = <&mu 0 1
                          &mu 1 1
                          &mu 3 1>;
                memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>, <&rsc_table>, <&m4_reserved>;
                syscon = <&src>;
                fsl,startup-delay-ms = <500>;
        };
};

&uart4 {
        status = "disabled";
};

&resmem {
        #address-cells = <2>;
        #size-cells = <2>;

        m4_reserved: m4@80000000 {
                reg = <0 0x80000000 0 0x1000000>;
                no-map;
        };

        vdev0vring0: vdev0vring0@78000000 {
                reg = <0 0x78000000 0 0x8000>;
                no-map;
        };

        vdev0vring1: vdev0vring1@78008000 {
                reg = <0 0x78008000 0 0x8000>;
                no-map;
        };

        rsc_table: rsc-table@780ff000 {
                reg = <0 0x780ff000 0 0x1000>;
                no-map;
        };

        vdevbuffer: vdevbuffer@78400000 {
                compatible = "shared-dma-pool";
                reg = <0 0x78400000 0 0x100000>;
                no-map;
        };

};

It should work after you have recompiled these files and applied them to the target. I will also inform our team to update the documentation on this. Thanks for reporting this!

Thanks for you reply.
Now , it works fine …