2021-10-27 01:21 AM
Hello,
I am working with STM32MP157C-DK2 board and trying to pass messages between the CM4 and the CPU (main processor) using the OpenAMP framework over the com ports ttyRPMSG0 and ttyRPMSG1. On the CPU I have the openstlinux-weston image, and a C program for reading and sending messages through ttyRPMSG ports. In this program for interacting with the ports, I pretty much followed this example. Here is my communication setup:
The CM4 firmware setups and configure OpenAMP and VIRT_UARTs very much as in the OpenAMP_TTY_echo. Here is the issue that I want to resolve.
- The CM4 receives the messages sent from CPU.
- However, on the CPU side, receiving messages only works if in a terminal I run
echo 'some text' > /dev/ttyRPMSG1
This is quite annoying. Encapsulating this command in a shell script and launching a
systemd service does not work (in the sens that the CPU does not receive msgs over the ttyRPMSG1).
What I am looking for:
Kind regards
Solved! Go to Solution.
2021-10-29 05:40 AM
Hi @Jatala ,
As you can read in this old post ( https://community.st.com/s/question/0D50X0000BaMkj0SQC/virtuart-or-rpmsg-framework-on-m4-cannot-send-messages-until-a7-host-sends-a-message ) this is an on purpose OpenAMP design decision.
To establish a RPMsg channel both side has to be ready to communicate.
when a new service is created, The receiver has to send a first message to communicate is own address. So you have at least to send an acknowledge dummy message.
if you are using the TTY over rpmsg, you have to send a first message from your Linux application
The rule in this ST use case is that the Linux application has to send the first message. this message will be received by the remote application. So it can be a dummy or a normal message. It depends of your implementation. So either you discard the first one or you can also implement something similar to the UART flow control:
Typically this is managed by some C applicative code. Not through terminal command.
Hope it help,
Olivier
2021-10-29 05:40 AM
Hi @Jatala ,
As you can read in this old post ( https://community.st.com/s/question/0D50X0000BaMkj0SQC/virtuart-or-rpmsg-framework-on-m4-cannot-send-messages-until-a7-host-sends-a-message ) this is an on purpose OpenAMP design decision.
To establish a RPMsg channel both side has to be ready to communicate.
when a new service is created, The receiver has to send a first message to communicate is own address. So you have at least to send an acknowledge dummy message.
if you are using the TTY over rpmsg, you have to send a first message from your Linux application
The rule in this ST use case is that the Linux application has to send the first message. this message will be received by the remote application. So it can be a dummy or a normal message. It depends of your implementation. So either you discard the first one or you can also implement something similar to the UART flow control:
Typically this is managed by some C applicative code. Not through terminal command.
Hope it help,
Olivier
2021-11-03 02:45 AM
Hi @Community member
Thanks, it did the trick. Previously I also tried sending the dummy message from the C/C++ program using the QProcess, essentially executing the terminal command, as QProcess::execute("echo 'dummy msg' > /dev/ttyRPMSG1"); but even though the command was executed successfully, the RPMSG channel was not enabled.
Kind regards
Jatala