Dear Toradex Community,
I am building an application with a Apalis iMX8 on which both the M4Fs communicate with a separate CAN Bus to our product. On those I use FreeRTOS and they communicate with each other using the Message Unit.
Now I would like to also broadcast the received CAN Data from both of the M4Fs to the Linux-System. For this purpose I try to use RPMSG.
I tried to follow the readme.txt in the rpmsg_lite_str_echo_rtos example in the multicore folder of the SDK from NXP and your page Communicating between cores with RPMsg .
My problem now is that the RPMSG never appears as a TTY.
Until now I did the following steps:
In the device Tree File imx8qm.dsti i changed the status of both rpmsg0 and rpmsg1 to "okay", then i compiled and uploaded the device tree using TCBuilder
The problem now is i never see a TTY in /dev and when inspecting dmesg i get several errors like this: virtio_rpmsg_bus: probe of virtio0 failed with error -12
Do you have any suggestions on how to deal with RPMSG using Torizon?
Thank you in advance!
I made this overlay works on BSP 6.3. Could you please check if it looks like yours or test it on TorizonCore 6 as well? It should work. This will enable the RPMsg channels and then, after the modprobe, you should see the tty devices appears in your module.
Dear @hfranco.tx ,
Thanks for your answer.
Specifically I am using TorizonCore 5.7.0 build 17. and not TC6
I tried to apply your Overlay as is, but the disabling of &lsio_pwm0 and &lsio_pwm1 result in the error Failed to apply '/tmp/tmptfa45zdx': FDT_ERR_NOTFOUND .
Thus, I replaced the groupnames with &pwm0 and &pwm1. Like this I can build the devicetree. However, I don’t know if this has any imapct on RPMSG.
Now I applied the adapted Overlay and the virtio error does not appear anymore. In dmesg i get these lines, which looks promising:
Nevertheless, the RPMSG TTY still does not appear in /dev. After the modprobe, I checked using lsmod and i get this line, which indicate that it is not used by anything:
Hi @hfranco.tx ,
Thanks for the suggestion. I tried your overlay, but the TTY still does not seem to appear. In dmesg I get exactly the same lines as previously.
Maybe I am overseeing it in /dev, as I am not sure whats the actual name of it. How exactly should it appear?
I am also not sure if this is related, and if it is even new, but i get the following Error while booting:
## Flattened Device Tree blob at 83000000
Booting using the fdt blob at 0x83000000
Loading Ramdisk to fcd8c000, end fd64d32f ... OK
ERROR: reserving fdt memory region failed (addr=95000000 size=400000)
Loading Device Tree to 00000000fcd3f000, end 00000000fcd8bfff ... OK
Another question: Does the RPMSG on the M4 side has to be active for it to appear in /dev? And am I right, that the RPMSGLite Library on the M4 side is compatible with the normal RPMSG Protocol on the Linux side, as long as the memory area is correctly specified?
Here I copied this file to /boot/ostree/<hash>/dtb/overlays and then edited the /boot/ostree/<hash>/dtb/overlays.txt file to include the name of this overlay, apalis-imx8_hmp_overlay.dtbo.
Next, I’ve compiled and loaded the M4 binary called rpmsg_lite_str_echo_rtos_m40.bin inside the multicore example folder.
For more information on how to load your binary, please check these guides:
Dear @hfranco.tx
Many thanks for the support, I successfully loaded the M4 Image and now get the same behavior as yours. I think the problem was, that the M4 Program was not running previously.
Best regards,
Julian
and it works to start rpmsg on boot and it also runs on the M4_1 core I’m using with rpmsg_lite_str_echo_rtos_m41.bin.
[ 0.090626] 001: imx rpmsg driver is registered.
[ 3.392638] 004: imx-rpmsg 90000000.rpmsg0: assigned reserved memory node vdevbuffer
[ 3.393432] 004: virtio_rpmsg_bus virtio0: Registered as RPMsg char device.
[ 3.415331] 004: virtio_rpmsg_bus virtio0: rpmsg host is online
[ 3.415856] 004: virtio_rpmsg_bus virtio1: Registered as RPMsg char device.
[ 3.439356] 004: virtio_rpmsg_bus virtio1: rpmsg host is online
[ 3.439777] 004: imx-rpmsg 90100000.rpmsg1: assigned reserved memory node vdevbuffer
[ 3.440563] 004: virtio_rpmsg_bus virtio2: Registered as RPMsg char device.
[ 3.440649] 004: virtio_rpmsg_bus virtio2: rpmsg host is online
[ 3.441408] 004: virtio_rpmsg_bus virtio3: Registered as RPMsg char device.
[ 3.441436] 004: virtio_rpmsg_bus virtio3: rpmsg host is online
[ 3.441482] 000: virtio_rpmsg_bus virtio3: creating channel rpmsg-virtual-tty-channel-1 addr 0x1f
[ 3.441538] 000: virtio_rpmsg_bus virtio3: Remote has announced service rpmsg-virtual-tty-channel-1, 31.
[ 3.442160] 000: virtio_rpmsg_bus virtio2: creating channel rpmsg-i2c-channel addr 0x1
[ 3.442184] 000: virtio_rpmsg_bus virtio2: Remote has announced service rpmsg-i2c-channel, 1.
but my problem is how to enable tty rpmsg on /dev because after I load the imx_rpmsg_tty module there is no output and on /dev there is no ttyRPMSG…
so what have i not done yet to be able to achieve the same situation as you did because i think the problem in the linux kernel config that is related to the rpmsg has been activated. please give me a clue or suggestion.
root@apalis-imx8-14904109:~# zcat /proc/config.gz |grep -i "rpmsg"
CONFIG_GPIO_IMX_RPMSG=y
CONFIG_REGULATOR_PF1550_RPMSG=y
CONFIG_SND_SOC_FSL_RPMSG_I2S=y
CONFIG_SND_SOC_IMX_PCM_RPMSG=y
CONFIG_SND_SOC_IMX_I2S_RPMSG=y
CONFIG_SND_SOC_IMX_RPMSG=y
CONFIG_SND_SOC_RPMSG_WM8960=y
CONFIG_SND_SOC_RPMSG_WM8960_I2C=y
CONFIG_SND_SOC_RPMSG_CS42XX8=y
CONFIG_SND_SOC_RPMSG_AK4497=y
# CONFIG_RTC_DRV_IMX_RPMSG is not set
# Rpmsg drivers
CONFIG_RPMSG=y
CONFIG_RPMSG_CHAR=y
CONFIG_RPMSG_QCOM_GLINK_NATIVE=y
CONFIG_RPMSG_QCOM_GLINK_RPM=y
CONFIG_RPMSG_VIRTIO=y
CONFIG_RPMSG_VIRTIO_CHAR=y
CONFIG_HAVE_IMX_RPMSG=y
CONFIG_IMX_RPMSG_PINGPONG=m
CONFIG_IMX_RPMSG_TTY=m
# end of Rpmsg drivers