M7 access with RPMSG

Hi ,
the specific hardware and software we are working on.
Verdin iMX8M Plus quad 4GB WB IT V1.1A
Verdin Development Carrier Board V1.1A
Torizon OS 5.7.0-build

I’m working on RPMsg (IPC) and am encountering a couple of issues:

  1. Issue with Switching Examples: I followed the instructions from this link and successfully ran the hello_world example. However, when I switch to another example, the hello_world example continues to run. I only changed this line and saved the environment:
#setenv cm_image "/ostree/deploy/torizon/var/*.bin
#saveenv
  • Currently, I rename the other file as hello_world.bin to get it working. Could you provide a fixed solution for this issue?

2.* Issue with rpmsg_lite_str_echo_rtos: I tried running rpmsg_lite_str_echo_rtos, but it doesn’t function correctly. While debugging, it gets stuck in the rpmsg_lite_wait_for_link_up function in main_remote.c. I haven’t changed the device tree, and running the following command shows:

resistertorizon@verdin-imx8mp-15289313:~$ dmesg | grep -i rpmsg
[    0.051821] imx rpmsg driver is registered.

Could you please provide assistance with these issues and prioritize this thread?

Regards,
Debashis

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


:handshake: Hi, Debashis

Issue 1: Switching Examples

The issue you’re encountering with switching examples is likely due to the environment variable not being updated correctly. Here’s a step-by-step guide to ensure the correct binary is loaded:

  1. Set the Environment Variable:
    Make sure you set the environment variable correctly to point to the new binary. For example:

    setenv cm_image "/ostree/deploy/torizon/var/new_example.bin"
    saveenv
    
  2. Verify the Environment Variable:
    After setting the environment variable, verify it to ensure it has been updated:

    printenv cm_image
    
  3. Reboot the System:
    Reboot the system to ensure the new settings take effect:

    reboot
    

If the issue persists, you might want to manually load the binary using U-Boot commands to ensure the correct binary is being executed.

Issue 2: rpmsg_lite_str_echo_rtos Stuck in rpmsg_lite_wait_for_link_up

The issue with rpmsg_lite_str_echo_rtos getting stuck in rpmsg_lite_wait_for_link_up is likely due to the RPMsg channel not being correctly established. Here are some steps to troubleshoot and resolve this issue:

  1. Device Tree Modifications:
    Ensure that the device tree is correctly modified to allocate the necessary RAM buffers for RPMsg. This is crucial for the RPMsg communication to work properly.

  2. Check Kernel Module:
    Ensure that the RPMsg kernel module is loaded correctly. You can do this by checking the dmesg logs:

    dmesg | grep -i rpmsg
    
  3. Load the Kernel Module Manually:
    If the module is not loaded, you can load it manually:

    modprobe imx_rpmsg_tty
    
  4. Verify RPMsg Configuration:
    Ensure that the RPMsg configuration is correct on both the Linux and Cortex-M sides. The dmesg logs should show that the RPMsg driver is registered and the channel is created.

  5. Debugging:
    If the issue persists, you might want to add additional debug prints in the main_remote.c file to understand where it is getting stuck.

By following these steps, you should be able to resolve the issues

Hi ,
I got my first question answer you can only look into the 2nd one.

we have to change in this environment because that variable is copied hear once for further changes we have to again copy it.

  • load_cm_image=ext4load mmc 2:1 0x44500000 /ostree/deploy/torizon/var/hello_world.bin

Regards,
Debashis

Hi ,

I have tried the same thing in torizon core 6 + version this is the details

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           5.15.148-rt74-6.8.0-devel+git.284966e8d6ee #1-TorizonCore SMP PREEMPT_RT Tue Aug 9 12:56:10 UTC 2022
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/c8988380e872e0f58ac7f5d645d3f598152857a3da68b0fbb9565b321121d604/0
Distro name:              NAME="TorizonCore with PREEMPT_RT"
Distro version:           VERSION_ID=6.8.0-devel-202408-build.25
Distro variant:           VARIANT="Docker"
Hostname:                 verdin-imx8mp-15141339
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin iMX8M Plus WB on Verdin Development Board
Toradex version:          0058 V1.1A
Serial number:            15141339
Processor arch:           aarch64
------------------------------------------------------------

When attempting to run the same steps that worked in TorizonCore 5.x, I encounter a boot loop when using TorizonCore 6+. I have provided a comparison of the boot logs in this link. The left side of the comparison shows the booting loop issue (with M7 and A53 core)

Verdin iMX8MP # echo ${cm_boot}
ext4load mmc 2:1 0x48200000 /ostree/deploy/torizon/var/rpmsg_lite_str_echo_rtos.bin; cp.b 0x48200000 0x7e0000 20000; dcache flush; mw.w 0x550ff000 0 64;bootaux 0x7e0000

Verdin iMX8MP # echo ${bootcmd}
run cm_boot; run bootcmd_mmc2

while the right side shows a successful boot without the M7 core(only A53 cores boot ).

Verdin iMX8MP # echo ${bootcmd}
run bootcmd_mmc2

when I run only run cm_boot I can able to see that the M7 core is running but stuck in the same function loop rpmsg_lite_wait_for_link_up

Can you please assist with resolving this issue as soon as possible?

Regards,
Debashis

Hi Toradex Team,

I’ve resolved the issues I previously mentioned (i refer to some other threads and solve it)

  1. add the overlay for verdin-imx8mp_hmp_overlay.dtbo default its not added .
  2. add custom device tree for giving ownership for M7 core

Am I correct ?

Now, I’d like to ask for your guidance on implementing continuous send and receive the data(custom data) with any cpp code with some IPC(Inter-Process Communication) library if its available can you guide me with that ?

Best regards,
Debashis

Hi @Debashis200,
Nice to hear that you were able to solve the issues.
Unfortunately,there are no demos available from Toradex for M7, whetever demos are there, those are from the NXP only which are provided in the SDK

Hi Sahil,

I received a link to the RPMsg guide from you: . when I go through this link I saw a git repo which may be about the IPC Library for linux. Could you provide more details about this GitHub repository:?

Regards,
Debashis

Hi @Debashis200 ,
The repository shared is not created/maintained by Toradex, its from NXP.
Please go through the README file present there itself.

Hi Sahil,

I’m working on accessing the GPIO pins on the M7 core. Currently, I’m using example code to blink an LED, which works fine for 1 second, but stops once the A53 core boots up. I understand this issue is related to ownership.

I’ve attempted to resolve this by modifying the custom device tree(given in Rpmsg to disable ownership for uart4) for RPMsg used for UART4. Specifically, I disabled the GPIO ownership and added the following entry:

&gpio5 {
    status = "disabled";
};

However, this hasn’t resolved the issue. I have uploaded the steps I followed for compiling and modifying the device tree. I’m trying to access SODIMM_200, which corresponds to GPIO5 pin 7.

Could you provide guidance on how to achieve this?

Regards,
Debashis

devicetree.txt (754 Bytes)
custom_svaya_m7_overlay.dts (1.5 KB)

Hi @Debashis200,

Referring to the datasheet of Verdin iMX8MP, SODIMM_200 is used as a MOSI pin in SPI1, try disabling the ecspi1 node and test.

Hi Sahil,

I try with including this line

&ecspi1 {
    status = "disabled";
};

&gpio5{
    status = "disabled";
};

but even if its not working and after i try disabling this gpio5 the Ethernet port are not detecting in ifconfig

By the way i try to watchdog example , it show the same behavior but it works fine with when i run separately with out A53 core to boot

using this

run cm_boot

Regards,
Debashis

Hi Sahil,

I want to know that in future if we want to change any pin for any functionality we have to check that that pin is allocated to any other peripheral or not then we have to change accordingly.

Can you give some basic understanding about this or any link to understand this.

And 1 more thing how can i give a single gpio pin access to M7 .

Regards,
Debashis

Hi @Debashis200

the following topics on the community give you some interesting tips on how to handle GPIO pins on iMX8M-Plus platfrom: