Rpmsg tty baud rate

When Torizon OS loads imx_rpmsg_tty module, /dev/ttyRPMSG30 can be used to send/receive messages to M7 core.
When I open the serial device on Torizon OS/Linux side I must specify a baud rate.
I know that behind there is a shared memory, so I don’t know if (and how much) the baud rate has effects on the communication.
Is there any specific value I should set?

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

When working with the imx_rpmsg_tty module and /dev/ttyRPMSG30 for communication between the Linux side and the M7 core in Torizon OS, the concept of baud rate differs from traditional UART communication. Since RPMsg is based on shared memory and not on serial transmission lines, the baud rate setting does not affect the speed or reliability of the communication in the same way it does for physical UART connections.

However, when opening the serial device in your application or terminal program, you might still be required to specify a baud rate due to the API or tool expectations. In such cases, you can specify a standard baud rate such as 115200, but it’s important to understand that this value is not used to control the communication speed over the RPMsg channel. The communication speed is instead determined by the efficiency of the shared memory mechanism and the processing power of the involved cores.

In summary, you can set any standard baud rate when opening /dev/ttyRPMSG30 on the Torizon OS/Linux side, as it does not impact the RPMsg communication performance. The key factor is the correct configuration and loading of the imx_rpmsg_tty module, as well as ensuring that your application correctly handles the data exchange over this virtual interface.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

Cortex-M RPMsg Guide | Toradex Developer Center.

Hi @vix !

In addition to the answer @ToradexAI gave, there is a default baudrate given to the TTY abstraction created by the imx_rpmsg_tty driver, as we can see in [1].

We can see from the line 155 from [1] that the tty_std_termios is used to initialize the TTY properties.

Searching for tty_std_termios inside the kernel, we can see that it is defined in [2] and initialized in [3] and from [3], the default baudrate is 38400 bps.

Since the baudrate should have no impact on the usage of RPMsg, there is no need to change it.

[1] imx_rpmsg_tty.c « rpmsg « drivers - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules
[2] tty.h « linux « include - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules
[3] tty_io.c « tty « drivers - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules.


Could you please elaborate here? How are you opening the TTY? What are you using to open it?

For example, directly on the console, by simply using cat /dev/ttyRPMSG30 you should be able to open it without specifying a baudrate. Also, you can use the following command to check the TTY’s current configuration:

stty -F /dev/ttyRPMSG30 -a

Best regards,

I’ve been developing a python app to send/receive data

with serial.Serial("/dev/ttyRPMSG30", 115200, timeout=1) as ser:

Hi @vix !

If your question was answered, please mark the most suitable message as the solution.

Otherwise, please let us know how we can further help you :slight_smile:

Best regards,