Rpmsg demo issue on Apalis iMX8QM

Dear Support Team,

we are testing the rpmsg_lite_str_echo_rtos demo included in NXP MCUXpresso SDK 2.5.2 MIMX8QM6xxxFF and meet below issue, the Linux BSP running on Cortex-Ax cores is latest Ycoto Linux console image v3.04, kindly please help advise?

./ Testing process
a. set up HW /related UARTs according to the developer article - FreeRTOS on the Cortex-M4s of a Apalis iMX8 | Toradex Developer Center

b. SDK toolchain use gcc-arm-none-eabi-7-2018-q2-update.

c. compile and test the “hello_world” demo under boards/mekmimx8qm/demo_apps/hello_world folder and it works well.

c. compile and test “rpmsg_str_echo” demo under boards/mekmimx8qm/multicore_examples/rpmsg_lite_str_echo_rtos/ folder. the RPMSG seems didn’t link up successfully, detailed logs are as below:

./ Cortex-A Debug console output

...
Apalis iMX8 # fatload mmc 2 ${loadaddr} m4_image.bin && dcache flush && bootaux ${loadaddr} 0
20112 bytes read in 21 ms (934.6 KiB/s)
## Starting auxiliary core at 0x80280000 ...
Power on M4 and MU
Copy M4 image from 0x80280000 to TCML 0x34fe0000
Start M4 0
bootaux complete
Apalis iMX8 # run bootcmd
...
Apalis-iMX8_Console-Image 3.0b4.254 20200421

apalis-imx8 login: root
Last login: Tue Apr 21 04:37:00 UTC 2020 on tty7
root@apalis-imx8:~# dmesg |grep rpmsg
[    0.000000] OF: reserved mem: initialized node rpmsg_dma@0x90400000, compatible id shared-dma-pool
[    0.236547] imx rpmsg driver is registered.
[    0.354999] imx-rpmsg 90000000.rpmsg: assigned reserved memory node rpmsg_dma@0x90400000
[    0.355402] virtio_rpmsg_bus virtio0: rpmsg host is online
[    0.355784] virtio_rpmsg_bus virtio1: rpmsg host is online
[    0.355833] virtio_rpmsg_bus virtio1: creating channel rpmsg-virtual-tty-channel addr 0x1e
[    0.357018] imx-rpmsg 90100000.rpmsg1: assigned reserved memory node rpmsg_dma@0x90400000
[    0.357398] virtio_rpmsg_bus virtio2: rpmsg host is online
[    0.378310] virtio_rpmsg_bus virtio3: rpmsg host is online
root@apalis-imx8:~# modprobe imx_rpmsg_tty
[   41.182443] imx_rpmsg_tty virtio1.rpmsg-virtual-tty-channel.-1.30: new channel: 0x400 -> 0x1e!
[   41.191316] Install rpmsg tty driver!
root@apalis-imx8:~# echo test > /dev/ttyRPMSG30

./ Cortex-M4 debug console output:

RPMSG String Echo FreeRTOS RTOS API Demo...

./ per some debugging the M4 demo code just stay at below function in main_remote.c waiting for link up.
while (!rpmsg_lite_is_link_up(my_rpmsg))

d. Also tested the same demo on M4_1, the output log is slightly different as below, but the communication is also failed.
./ Cortex-A Debug console output

...
Apalis iMX8 # fatload mmc 2 ${loadaddr} m4_1_image.bin && dcache flush && bootaux ${loadaddr} 1
27984 bytes read in 21 ms (1.3 MiB/s)
## Starting auxiliary core at 0x80280000 ...
Power on M4 and MU
Copy M4 image from 0x80280000 to TCML 0x38fe0000
Start M4 1
bootaux complete
Apalis iMX8 # run bootcmd
...
Apalis-iMX8_Console-Image 3.0b4.254 20200421

apalis-imx8 login: root
Last login: Tue Apr 21 04:36:59 UTC 2020 on tty7
root@apalis-imx8:~# dmesg |grep rpmsg
[    0.000000] OF: reserved mem: initialized node rpmsg_dma@0x90400000, compatible id shared-dma-pool
[    0.236647] imx rpmsg driver is registered.
[    0.354566] imx-rpmsg 90000000.rpmsg: assigned reserved memory node rpmsg_dma@0x90400000
[    0.354967] virtio_rpmsg_bus virtio0: rpmsg host is online
[    0.375904] virtio_rpmsg_bus virtio1: rpmsg host is online
[    0.377004] imx-rpmsg 90100000.rpmsg1: assigned reserved memory node rpmsg_dma@0x90400000
[    0.377383] virtio_rpmsg_bus virtio2: rpmsg host is online
[    0.377756] virtio_rpmsg_bus virtio3: rpmsg host is online
[    0.377821] virtio_rpmsg_bus virtio3: creating channel rpmsg-virtual-tty-channel-1 addr 0x1f
[    0.380174] virtio_rpmsg_bus virtio2: creating channel rpmsg-vehicle-channel addr 0x1
[    0.380262] virtio_rpmsg_bus virtio2: creating channel rpmsg-i2c-channel addr 0x2
[    0.430476] i2c-rpmsg virtio2.rpmsg-i2c-channel.-1.2: new channel: 0x400 -> 0x2!
root@apalis-imx8:~# modprobe imx_rpmsg_tty
[  112.431756] imx_rpmsg_tty virtio3.rpmsg-virtual-tty-channel-1.-1.31: new channel: 0x400 -> 0x1f!
[  112.440790] Install rpmsg tty driver!
root@apalis-imx8:~# echo test > /dev/ttyRPMSG31 

./ Cortex-M4 debug console output:

RPMSG String Echo FreeRTOS RTOS API Demo...

Nameservice sent, ready for incoming messages...
app_srtm: AUTO and I2C service registered

Thanks and Best Regards

Hai

Hi Hai,

can you also provide the M4 source code you are using?

Best Matthias

Hi Matthias,

I have found the problem that the M4 UARTs have conflict with linux uart1, and need to modify the linux device tree to remove related pinmux according to the patch as below. Have ignored this at the first time because the datasheet claims the the M4 Uarts are the dedicated uart.

Now both the str and pingpong rpmsg demo works well as expected for both M40 and M41.

diff --git a/arch/arm64/boot/dts/freescale/fsl-imx8qm-apalis-eval.dtsi b/arch/arm64/boot/dts/freescale/fsl-imx8qm-apalis-eval.dtsi
index 6153e6ad1b46..511905f276f6 100644
--- a/arch/arm64/boot/dts/freescale/fsl-imx8qm-apalis-eval.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-imx8qm-apalis-eval.dtsi
@@ -260,7 +260,7 @@

 /* Apalis UART4 */
 &lpuart2 {
-       status = "okay";
+       status = "disabled";
 };

 /* Apalis UART2 */
@@ -364,12 +364,12 @@

 /* Apalis PWM3, MXM3 pin 6 */
 &pwm0 {
-       status = "okay";
+       status = "disabled";
 };

 /* Apalis PWM4, MXM3 pin 8 */
 &pwm1 {
-       status = "okay";
+       status = "disabled";
 };

 /* Apalis PWM1, MXM3 pin 2 */
diff --git a/arch/arm64/boot/dts/freescale/fsl-imx8qm-apalis-v1.1.dtsi b/arch/arm64/boot/dts/freescale/fsl-imx8qm-apalis-v1.1.dtsi
index 6f5e5d9b62c2..3ad8a3345a68 100644
--- a/arch/arm64/boot/dts/freescale/fsl-imx8qm-apalis-v1.1.dtsi
+++ b/arch/arm64/boot/dts/freescale/fsl-imx8qm-apalis-v1.1.dtsi
@@ -412,7 +412,7 @@
        pinctrl-0 = <&pinctrl_cam1_gpios>, <&pinctrl_dap1_gpios>,
                    <&pinctrl_esai0_gpios>, <&pinctrl_fec2_gpios>,
                    <&pinctrl_gpio34>, <&pinctrl_gpio_usbh_oc_n>,
-                   <&pinctrl_lpuart1ctrl>, <&pinctrl_lvds0_i2c0_gpio>,
+                   <&pinctrl_lvds0_i2c0_gpio>,
                    <&pinctrl_lvds1_i2c0_gpios>, <&pinctrl_mipi_dsi_0_1_en>,
                    <&pinctrl_mipi_dsi1_gpios>, <&pinctrl_mlb_gpios>,
                    <&pinctrl_qspi1a_gpios>, <&pinctrl_sata1_act>,

Thanks and Best Regards

Hai

Hi @hai.tx ,

I have the same problem as Matthias and I tried your solution using TorizonCore Builder.

First I created a Device Tree Overlay disabling the uart2, pwm0 and pwm1. The DTO was correctly built and deployed but the problem persisted. Then I modified the Device Tree modifying the dtsi files on the device-tree/dts-arm64 folder and disabled again the uart and pwm and modified the iomux like you suggested. The new DT was compiled and deployed successfully, however, the example didn’t work. Do you know what might be happenning?

I’m using the NXP SDK version 2.9 and my setup is:

Apalis iMX8QM V1.0B

Apalis Eva Board V1.1A

TorizonCore 5.3.0-devel-20210627+build.336

Cheers,

Juan

Hi Juan,

the patch here only work with BSP 3.x, for BSP 5.x please refer to below ticket -