Skip to main content
JOhn1
Associate II
Jun 28, 2022 9:26 AM UTC
Solved

aliasing serial ports to names like (rs232, etc.)

Hi, Is there any way to give a more meaningful name to a serial port with the device tree, so that is shows up in the linux kernel?

Right now, in a device tree, it is possible to choose an alias in the alias node. But they do show up as ttySTMx in the /dev directory.

Is there a way to make it work so that it gets a more intutive name like rs232?

  • For my specific layout some serial ports are connected to a specific interface.
/ {
 
	aliases {
		serial1 = &usart1;
	};
 
}; /*root*/
// Instead
/ {
	aliases {
		rs232 = &usart1;
	};
 
}; /*root*/

This topic has been closed for replies.
Olivier GALLIEN
Olivier GALLIENBest answer
ST Technical Moderator
Jul 11, 2022 5:27 AM UTC

Hi @JOhn​ ,

Serial name presented by the SoC is defined in the serial driver source code :

drivers/tty/serial/stm32-usart.h:#define STM32_SERIAL_NAME "ttySTM"

Olivier

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.

1 reply

Olivier GALLIEN
Olivier GALLIENBest answer
ST Technical Moderator
Jul 11, 2022 5:27 AM UTC

Hi @JOhn​ ,

Serial name presented by the SoC is defined in the serial driver source code :

drivers/tty/serial/stm32-usart.h:#define STM32_SERIAL_NAME "ttySTM"

Olivier

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.