Imx_rpmsg_tty on i.MX8

I tried to load the module imx_rpmsg_tty on the system above. No errors were reported however there were no progress messages or device info reported and no devices created in /dev. What might I be missing?

I have a basic function running in the M4 core but it is waiting for the link to come up so I can’t tell what is happening there.

Hi @Andy.McClernon

Thanks for writing to the Toradex Support!

Could you provide the software version of your module?
Did you have a look here?

Best regards,
Jaski

Hi Jaski

Software versions are:

SCFW b929edfe, SECO-FW 27167ff2, IMX-MKIMAGE d7f9440d, ATF bb209a0  
U-Boot 2018.03-toradex_imx_v2018.03_4.14.98_2.3.0_bringup+gd626574ba1  

Linux version 4.14.170-3.0.4+gbaa6c24240a4 (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP PREEMPT Tue Apr 21 04:11:13 UTC 2020

I looked at the page you linked. It is not the M4 or FreeRTOS that I have the problem with. It is the module imx_rpmsg_tty (same issue with imx_rpmsg_pingpong) on Linux on the main cores. When I install the driver (using modprobe imx_rpmsg_tty) there is no output on stdout as expected nor is there a device created in /dev as expected.

Regards
Andy.

Hi

Thanks for the information.

It is not the M4 or FreeRTOS that I have the problem with.

Sure but you need to have a running code on M4_0 or M4_1 for having a rpmsg device in Linux. Which example did you run on which core?
Could you share the code?

Thanks and best regards,
Jaski

I have a small piece of test code with a mix from freertos_hello and pingpong running on M4_0. I have attached zip file with the code, the make files are specific to my directory structure I hope you can modify it to suit. I have attached the m4 image too. There is a small blocking task that exits if you enter the string “Exit”. The M4 code runs up until it is waiting for the link to get up.link text

screenshots from linux and M4 serial ports…
link text

Hi @Andy.McClernon

Thanks very much for the files.

I will try to reproduce this on my place and come back to you till Friday. Thanks for your patience.

Best regards,
Jaski

Hi @Andy.McClernon!

Did you make any changes to the device tree on your image?

While testing your freertos_hello_m40.elf firmware, I noticed the Linux kernel hangs while booting just after loading the HDMI firmware. My guess is that you’re probably using something there on the M4 core that Linux is also trying to use.

Did you disable any hardware that might be shared on the device tree? The most common culprits would be some UARTs or SPI.

Yes I did. I disabled the control signals on UART1 which conflicted with M4_0 uart tx and rx. The dtb and a little history can be found here…

Hi @Andy.McClernon !

Sorry for the delay. I was able to get the RPMsg demo working.

I’ve used the rpmsg_lite_str_echo_rtos demo from the MCUXpresso SDK. I’ve uploaded the resulting m4_image.bin here: https://share.toradex.com/g3z689caam593fz

I’ve loaded the M4 firmware from U-Boot via TFTP using:

Apalis iMX8 # tftp ${loadaddr} m4_image.bin

Alternatively, this can also be done via an SD card:

Apalis iMX8 # fatload mmc 2 ${loadaddr} m4_image.bin.

Then run

Apalis iMX8 # dcache flush && bootaux ${loadaddr} 0

You should see the following output on U-Boot:

## Starting auxiliary core at 0x80280000 ... 
Power on M4 and MU Copy
M4 image from 0x80280000 to TCML
0x34fe0000 Start M4 0 bootaux complete

And the following output on the M4 UART:

RPMSG String Echo FreeRTOS RTOS API Demo...

Then on U-Boot, run

Apalis iMX8 # boot

Once Linux boots, load the imx_rpmsg_tty module:

# modprobe imx_rpmsg_tty

You should not get any immediate output on stdout, at least that’s what happened here.

The output of dmesg | grep rpmsg should show something like:

apalis-imx8-06506336:~$ dmesg | grep rpmsg
[    0.000000] OF: reserved mem: initialized node rpmsg_dma@0x90400000, compatible id shared-dma-pool
[    0.272372] imx rpmsg driver is registered.
[    0.405467] imx-rpmsg 90000000.rpmsg: assigned reserved memory node rpmsg_dma@0x90400000
[    0.405875] virtio_rpmsg_bus virtio0: rpmsg host is online
[    0.406246] virtio_rpmsg_bus virtio1: rpmsg host is online
[    0.406313] virtio_rpmsg_bus virtio1: creating channel rpmsg-virtual-tty-channel addr 0x1e
[    0.407422] imx-rpmsg 90100000.rpmsg1: assigned reserved memory node rpmsg_dma@0x90400000
[    0.407791] virtio_rpmsg_bus virtio2: rpmsg host is online
[    0.428692] virtio_rpmsg_bus virtio3: rpmsg host is online
[   60.168417] imx_rpmsg_tty virtio1.rpmsg-virtual-tty-channel.-1.30: new channel: 0x400 -> 0x1e!
[   60.168623] Install rpmsg tty driver!

Notice that these last couple of lines came up when modprobing imx_rpmsg_tty.

At that point, the M4 UART should look like:

RPMSG String Echo FreeRTOS RTOS API Demo...

Nameservice sent, ready for incoming messages...
Get Message From Master Side : "hello world!" [len : 12]

Two TTY devices got enumerated here:

-rw-r--r-- 1 root root        18 Jun 18 14:07 /dev/ttyRPMSG
crw-rw---- 1 root dialout 235, 0 Jun 18 14:07 /dev/ttyRPMSG30

I was able to exchange messages with the M4 by using /dev/ttyRPMSG30:

# echo "Hello from Linux!" > /dev/ttyRPMSG30

Then the M4 UART should receive it like:

RPMSG String Echo FreeRTOS RTOS API Demo...

Nameservice sent, ready for incoming messages...
Get Message From Master Side : "hello world!" [len : 12]
Get Message From Master Side : "Hello from Linux!" [len : 17]
Get New Line From Master Side

Can you please try and validate these steps?

That is great, that is all working as expected now. Thank you for your help.

Hi @Andy.McClernon!

Nice! Glad that it’s working now.

Please feel free to reach out if you have any further questions.

Hi @gustavo.tx

I’m taking the opportunity to re-open this thread as I’m struggling to run the same demo on my setup.
I’m also using an Apalis imx8 QM, BSP3 and your m4_image.bin binary.

I’m getting to the points where:

  • M4 boots and shows RPMSG String Echo FreeRTOS RTOS API Demo...
  • dmesg | grep rpmsg shows the exact same output as your example above
  • modprobing imx_rpmsg_tty creates /dev/ttyRPMSG30 but no /dev/ttyRPMSG
  • M4 does not show Nameservice sent, ready for incoming messages... neither the Hello world message from Linux

It looks like the rpmsg channel is correctly established but the it fails to exchange data.

What is your opinion?

I’m quite lost at the moment, any ideas or directions would be very appreciated :slight_smile:

,

Hello @gmi!

On current kernel versions (5.4), the imx_rpmsg_tty module indeed creates /dev/ttyRPMSG30 instead of /dev/ttyRPMSG. You should use that TTY device.

First of all, I suggest you to use our latest BSP 5.1.0, for which we have a production release, or the upcoming BSP 5.2.0.

What is the result when you try to write to the tty? Such as echo "My message" > /dev/ttyRPMSG30? Does this output something on the M4 UART?

Other than that, it would be useful to have a full dmesg log from your side.

I am also not able to get this example working.
I’m able to load the M4-0 bin file and get similar output as you posted.
When I load the Linux driver [modprobe imx_rpmsg_tty] I am not getting any messages that you are showing from dmesg. I actually don’t get a single message.

I’m running Linux apalis-imx8 5.4.77-0+git.1266d0110fce

modinfo imx_rpmsg_tty
filename: /lib/modules/5.4.77-0+git.1266d0110fce/kernel/drivers/rpmsg/imx_rpmsg_tty.ko
license: GPL v2
description: iMX virtio remote processor messaging tty driver
author: Freescale Semiconductor, Inc.
depends:
intree: Y
name: imx_rpmsg_tty
vermagic: 5.4.77-0+git.1266d0110fce SMP preempt mod_unload modversions aarch64

Sorry, I’d answered at the wrong place…

Hi all

This Rpmsg demo issue on Apalis iMX8QM - Technical Support - Toradex Community fixed my issue. Looks like it has not been merged into BSP5.

Thanks for the feedback.