cancel
Showing results for 
Search instead for 
Did you mean: 

initilize ttyRPMSG0 and ttyRPMSG1

TArre.1
Associate III

Hello!

I am trying to replicate the workshop STM32MP1 - 11 Inter-Processor Communication Lab Example. I create a new STM32 project and copy all the data from the lab example. Then I connect the device (STM32MP157C-DK2) but the /dev/ttyRPMSG0 does not initialize (so I can´t send message between processors):

  • My program

0693W00000UolVfQAJ.png

  • STM32MP1 - 11 Inter-Processor Communication Lab Example

 0693W00000UolVuQAJ.pngI create my program in STM32CubeIDE version 1.10.1.

How can I initilize ttyRPMSG0 and ttyRPMSG1?

Thanks!

10 REPLIES 10
Erwan SZYMANSKI
ST Employee

Hello @TArre.1​,

Some questions to better understand your issue.

Which version of OpenSTLinux do you use ? 4.0 ?

In your example, does it mean that you cannot see ttyRPMSGX in "/dev/" folder from Linux side ?

Kind regards,

Erwan.

(PS: note that coprocessor communication mechanism has a little bit changed with OSTL4.0, so if you use it, be sure to have the right M4 firmware package in front of your A7 Linux baseline)

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
TArre.1
Associate III

I am using OpenSTLinux 4.0.1 version.

Exactly. I initialize in main.c program (in STM32CubeIDE) the vitual uarts:

  huart0.rvdev = &rvdev;

  print_string("Virtual UART0 OpenAMP-rpmsg channel creation\r\n");

  if (VIRT_UART_Init(&huart0) != VIRT_UART_OK) {

   print_string("VIRT_UART_Init UART0 failed.\r\n");

   while(1){}

  }

  huart1.rvdev = &rvdev;

  print_string("Virtual UART1 OpenAMP-rpmsg channel creation\r\n");

  if (VIRT_UART_Init(&huart1) != VIRT_UART_OK) {

   print_string("VIRT_UART_Init UART1 failed.\r\n");

  while(1){}

  }

Then, I run .elf file on the STM32MP157C-DK2 board but in "/dev/" folder I cannot see ttyRPMSGX.

How can I do it?

Thanks!

@TArre.1​ ,

On a personal example of co-processor communication, I have exactly the same logs as yours so it seems that the initialization logs are normal.

Can you share me your main.c file (from M4 side) ? I would like to check if something is going wrong somewhere.

Do you also know the Cube Firmware package version that you are using ?

Kind regards,

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

A simple test that you can do is to open your virt_uart.c file (Middlewares/Third_Party/OpenAMP/virtual_driver), and check that you have the following line at lines 48-49:

/* this string will be sent to remote processor */
#define RPMSG_SERVICE_NAME              "rpmsg-tty"

If you do not see it, for sure you do not have the right version of this file, and it causes the same trouble as you can see right now.

Kind regards,

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi Erwan,

I enclose the program that I have created (STM32CubeIDE 1.10.1).

I have verified that the lines 48-49 that you mention are in my program. I don't know if I have forgotten some step to be able to access "/dev/RPMSGx".

Thanks!

Hello @TArre.1​,

How did you deploy your Linux side on the target ? Are you sure that your device tree is the MX generated one ? I ask you this because IPCC node activated in Linux (A7) device tree is mandatory to make the coprocessor work.

Did you follow this article with an MX machine creation ?

With activating the following dynamic printk, you can check if IPCC is functionnal + the different rpmsg:

echo -n 'file stm32-ipcc.c +p' > /sys/kernel/debug/dynamic_debug/control

echo -n 'file virtio_rpmsg_bus.c +p' > /sys/kernel/debug/dynamic_debug/control

echo -n 'file virtio_ring.c +p' > /sys/kernel/debug/dynamic_debug/control

Kind regards,

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi Erwan,

I just created a new project in the STM32CubeIDE and copied the main.c from the example in workshop 11. Then I tried to follow the steps in the slides to send messages between processors.

So, once the program is created, what are the steps to follow to send messages between processors?

Thanks!

Hello @TArre.1​,

The different steps are explained in the following wiki article: https://wiki.st.com/stm32mpu/wiki/Getting_started/STM32MP1_boards/STM32MP157x-DK2/Develop_on_Arm%C2%AE_Cortex%C2%AE-M4/Modify,_rebuild_and_reload_a_firmware

Note that due to copro architecture, it is mandatory that the A7 cortex send the first message to initialize the communication. In the article example, this is made by the first "Hello Virtual UART0" message.

Kind regards,

Erwan.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Thank you Erwan, I will do the example you sent me to see if I can send messages between processors ;)