RPMSG does not work on IMX8M-Plus

I bought the Verdin module and development board a few weeks ago.
And then tried and run modprobe imx-rpmsg-tty, but nothing happened and no /dev/ttyRPMSG was created.

Please tell me how to enable imx-rpmsg-tty.

Thanks and regards, Takeo

Hi, communicty.

Let me give you an update information.

The following message is a part of /proc/config.gz.

#
# Remoteproc drivers
#
CONFIG_REMOTEPROC=y
CONFIG_IMX_REMOTEPROC=y
# end of Remoteproc drivers

#
# Rpmsg drivers
#
CONFIG_RPMSG=y
# CONFIG_RPMSG_CHAR is not set
# CONFIG_RPMSG_QCOM_GLINK_RPM is not set
CONFIG_RPMSG_VIRTIO=y
CONFIG_HAVE_IMX_RPMSG=y
CONFIG_IMX_RPMSG_PINGPONG=m
CONFIG_IMX_RPMSG_TTY=m
# end of Rpmsg drivers

I tried setenv fdt_file ā€œimx8mp-evk-rpmsg.dtbā€ in u-boot command prompt.
(reference document:Getting Started with MCUXpresso SDK for EVK-MIMX8MP.pdf)

Verdin iMX8MP # boot
Run CMD11 1.8V switch
73024 bytes read in 16 ms (4.4 MiB/s)
## Starting auxiliary core stack = 0x20020000, pc = 0x0000052D...
Run CMD11 1.8V switch
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
5771 bytes read in 16 ms (351.6 KiB/s)
## Executing script at 46000000
Loading DeviceTree: imx8mp-evk-rpmsg.dtb
83630 bytes read in 16 ms (5 MiB/s)
86 bytes read in 8 ms (9.8 KiB/s)
Applying Overlay: verdin-imx8mp_native-hdmi_overlay.dtbo
1860 bytes read in 19 ms (94.7 KiB/s)
failed on fdt_overlay_apply(): FDT_ERR_NOTFOUND
Applying Overlay: verdin-imx8mp_lt8912_overlay.dtbo
2007 bytes read in 19 ms (102.5 KiB/s)
failed on fdt_overlay_apply(): FDT_ERR_BADMAGIC
base fdt does did not have a /__symbols__ node
make sure you've compiled with -@
10251654 bytes read in 140 ms (69.8 MiB/s)
Uncompressed size: 24334848 = 0x1735200
Bootargs: root=PARTUUID=9bb93f13-02 ro rootwait console=ttymxc2,115200 console=tty1 consoleblank=0 earlycon
ERROR: Did not find a cmdline Flattened Device Tree
FDT and ATAGS support not compiled in - hanging
### ERROR ### Please RESET the board ###

additionally, I tried exclude overlay.
As a result, reserving fdt memory region failed (addr=550ff000 size=1000).

Verdin iMX8MP # boot
Run CMD11 1.8V switch
73024 bytes read in 16 ms (4.4 MiB/s)
## Starting auxiliary core stack = 0x20020000, pc = 0x0000052D...
Run CMD11 1.8V switch
switch to partitions #0, OK
mmc1 is current device
Scanning mmc 1:1...
Found U-Boot script /boot.scr
5771 bytes read in 15 ms (375 KiB/s)
## Executing script at 46000000
Loading DeviceTree: imx8mp-evk-rpmsg.dtb
83630 bytes read in 16 ms (5 MiB/s)
0 bytes read in 6 ms (0 Bytes/s)
10251654 bytes read in 140 ms (69.8 MiB/s)
Uncompressed size: 24334848 = 0x1735200
Bootargs: root=PARTUUID=9bb93f13-02 ro rootwait console=ttymxc2,115200 console=tty1 consoleblank=0 earlycon
## Flattened Device Tree blob at 43000000
   Booting using the fdt blob at 0x43000000
ERROR: reserving fdt memory region failed (addr=550ff000 size=1000)
ERROR: Failed to allocate 0x38000 bytes below 0x100000000.
device tree - allocation error
FDT creation failed! hanging...### ERROR ### Please RESET the board ###

Best regards, Takeo

Hi @deepimpact , thanks for reaching out. Currently RPMSG is not fully tested and unsupported, however this seems to be enable already in the Verdin iMX8M Plus, so you should not need to enable another device tree (However the changes might be incomplete): imx8mp-verdin.dtsi Ā« freescale Ā« dts Ā« boot Ā« arm64 Ā« arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules

Do you get any kernel messages when launching the modprobe command? This would help.

Also, the imx8mp-evk-rpmsg device tree is for NXPā€™s Evaluation Board so this wonā€™t work in the Verdin iMX8M Plus. You should have to use an overlay that will comply with the memory allocation used in the Verdin iMX8M Plus.

Here you have another user that could successfully use RPMSG in Apalis iMX8 (with a iMX8 QM) where the M4 core is already supported: Imx_rpmsg_tty on i.MX8 - Technical Support - Toradex Community

Here are more details on the device tree that we know it works for the Apalis iMX8:
https://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm64/boot/dts/freescale/imx8-apalis-v1.1.dtsi?h=toradex_5.4-2.3.x-imx#n185

I hope this helps.

Kind regards,
Alvaro.

Hi, Alvaro.

Thank you for your reply.
I tried that you pointed out. But the problem is not solved yet.

so you should not need to enable
another device tree (However the
changes might be incomplete):
imx8mp-verdin.dtsi Ā« freescale Ā« dts Ā« boot Ā« arm64 Ā« arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules

There is a slight difference between ā€œyour imx8mp-verdin.dtsiā€ and ā€œmy imx8mp-verdin.dtsiā€.
So, I tried again. but /dev/ttyRPMSG was not created.


Do you get any kernel messages when
launching the modprobe command? This
would help.
I checked ā€œmodeprobe imx_rpmsg_ttyā€ command log, and it returned nothing.


root@verdin-imx8mp:~# modprobe imx_rpmsg_tty

root@verdin-imx8mp:~#

root@verdin-imx8mp:~# dmesg | grep rpmsg

[ 0.079684] imx rpmsg driver is registered.

root@verdin-imx8mp:~#


You should have to use an overlay that
will comply with the memory allocation
used in the Verdin iMX8M Plus.
What should I do specifically ?


Here you have another user that could
successfully use RPMSG in Apalis iMX8
(with a iMX8 QM) where the M4 core is
already supported: Here are more
details on the device tree that we
know it works for the Apalis iMX8:
Which point should I focus on?


Also, the imx8mp-evk-rpmsg device tree
is for NXPā€™s Evaluation Board so this
wonā€™t work in the Verdin iMX8M Plus.
What was wrong in the imx8mp-evk-rpmsg.dts?link text
What should I fix ?



Best regards, Takeo.

Hi Takeo, we are currently checking internally. We might need to check with NXP as this functionality might not be completely implemented from their side. Please wait a little longer. Sorry for the inconvenience.

Hi Alvaro.

I understand. Please tell me the confirmation result at a later date.


By the way, There is one thing that makes me wonder.

source file

oe-core/build/tmp/work-shared/verdin-imx8mp/kernel-source/drivres/remoteproc/imx_rproc.c

![alt text][1]


[1]: https://share.toradex.com/oqnu9ndaa3ef7xx?direct

[Point of view]
compatible = ā€œfsl,imx8mp-cm7ā€, .data = &imx_rproc_cfg_imx8mn

I think not imx_rproc_cfg_imx8mn but imx_rproc_cfg_imx8mp.
Thereā€™re no problems, right?

I wish I could figure out the factor of the trouble.

Best regards, Takeo.

Thanks Takeo. We will check your findings and let you know when we have an update.

Hi Alvaro.

Please let me know the current situation on this matter.
Can you have a good news from NXP developer ?

Best regards, Takeo.

Hi Takeo san. Sorry, we donā€™t have any update at the moment. Some of our engineers are on holiday so our resources are a bit limited at the moment. I will try to update you when we have an answer. Thank you for your understanding.

Hi, Alvaro.

Thank you reply. I understand the situation you are in.

However, I have to get the inter-process communication function between CortexA53 an CortexM7. So I considered a back-up plan.


Plan-1 : Instead of RPMSG, I use UART.

Plan-2 : Instead of RPMSG, I use SPI.


**Please let me know if there are other good plan.**

Best regards, Takeo.

Hi Takeo san, yes, should be possible and it is a good idea if RPMSG is not working. I think UART and SPI should be both working in both CortexA and CortexM7. Were you able to run FreeRTOS on the CortexM7?

Hi, Alvaro san.

Yes, I was. Linux is running on Cortex-A53, and FreeRTOS is running on Cortex-M7.

Currently, Cortex A use UART3 and Cortex M use UART1 and UART4.
惻UART1 (for external processor communication)
惻UART3 (for Cortex A Debug output)
惻UART4 (for Cortex M Debug output)

iMX8m plus has only UART1-4(4 channel).
So I have to use UART2 as inter-processing communication (Cortex A and B).
Therefore Cortex A and M use UART2 togetherā€¦ Is this okay ?

For example, If Cortex A need to receive only and Cortex M need to send only, is this no problem ?

Perfect, thanks for the confirmation.

We donā€™t usually recommend changing UART1 and keep it as Cortex A Debug output if possible, but that is completely up to you and your solution.

Hmmm, that setup is a tricky oneā€¦ Iā€™m not sure if the drivers and the internal HW mapping would be OK with using both cores at the same time for the same peripheralā€¦ Iā€™m afraid you will have to try and confirm this by yourself, this behavior is completely untested. If it is not possible, it is very likely one of the SOs will complain that they could not initialize that UART interface. On the other hand, probably there is nothing stopping any core from overriding the information from the other one.

Interesting scenario, please let us know how it goes.

Hi, Alvaro san.

I tried it, but I could not initialize the UART2 interface on FreeRTOS(Cortex M7).

First of all, I got ā€œfreertos_uartā€ example project in MCUXpressoSDK v2.9(MIMX8ML8xxxLZ).
This project is configured to be use UART4. So I changed UART4 to UART2. and executed freertos_uart. But Cortex M7 caused hard fault error directory after CLOCK_EnableClock(kCLOCK_RootUart2) executed.

What is the cause ?
I donā€™t know what to do without you.

Best regards, Takeo.

Hi @gustavo.tx could you please check this? Thanks a lot

Dear Takeo san, did you have the Cortex A core on? Or were you only running only Cortex M7? Do you have a log of the full boot and the error?

Hi, Alvaro san.

Linux was running on Cortex-A53, and FreeRTOS was running on Cortex-M7.


Specifically, I did the follow steps.

  1. I connected Jlink-debugger to the development board.
  2. Power On/Off Switch is ON
  3. Linux log message displayed console. (attach Linux.log)
  4. FreeRTOS firmware started on Jlink-debugger.(Use Visual Studio Code)

    ->FreeRTOS hardfault

I got boot log.

link text


@gustavo.tx could you please check
this? Thanks a lot
Thank you information.
Iā€™ll check it from now on.

Hi Takeo san, could you try without booting Linux? Only FreeRTOS on the CortexM7 (Remember what I mentioned about trying to use the same interface with Linux and FreeRTOS?)

It is very likely UART2 is used by Linux.

Hi Takeo san,

Please check this:

https://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm64/boot/dts/freescale/imx8mp-verdin-dahlia.dtsi?h=toradex_5.4-2.3.x-imx&id=0c3e760d3a576ae36a871bf6265830cbe4655fd7#n186

UART1, 2 and 3 are used by Linux by default.

Here you can check what SODIMM pins are used per each UART:
https://git.toradex.com/cgit/linux-toradex.git/tree/arch/arm64/boot/dts/freescale/imx8mp-verdin.dtsi?h=toradex_5.4-2.3.x-imx&id=0c3e760d3a576ae36a871bf6265830cbe4655fd7#n1161

(UART3 is the UARTA used for Linux debug for example)

Hi, Alvaro san.

Thank you for reply.
You mean Linux hold UART2 resource ?

But I tried without booting linux, the same problem caused.(FreeRTOS hardfault)

  1. I connected Jlink-debugger to the development board.
  2. Power On/Off Switch is ON
  3. Stop u-boot.
  4. FreeRTOS firmware started on Jlink-debugger.(Use Visual Studio Code)
  • FreeRTOS hard fault






    I also disabled UART2 on device tree, but the result didnā€™t change(hard fault).
    &uart2 { status = ā€œdisabledā€; };


I have confirmed device-tree.
Pin assignment is same. From now on, Iā€™ll check the difference in detail.
Thank you.