Skip to main content
HLee.21
Associate II
April 4, 2022
Question

How to setup rs485 with linux,rs485-enabled-at-boot-time?

  • April 4, 2022
  • 3 replies
  • 4032 views

This is how I would like to use rs485:

&usart3{
	pinctrl-names = "default", "sleep";
	pinctrl-0 = <&usart3_pins_mx>;
	pinctrl-1 = <&usart3_sleep_pins_mx>;
	status = "okay";
	uart-has-rtscts;
	linux,rs485-enabled-at-boot-time;
	rs485-rts-delay-ns = <800 300>;
};

But it does not work.

The setup function stm32_usart_config_rs485() in drivers/tty/serial/stm32-usart.c does not get executed. This seems wrong. Could you elaborate on this?

When configuring rs485 from userland by using the ioctl, the setup function stm32_usart_config_rs485() does get executed and rs485 does work.

This topic has been closed for replies.

3 replies

HLee.21
HLee.21Author
Associate II
May 6, 2022

*ping*?

Olivier GALLIEN
Technical Moderator
May 31, 2022

Hi @HLee.21​ ,

Sorry for late reply.

This issue has been escalated internally as ticket #BZ129026 and is currently under analyze.

Keep you posted

Olivier

Olivier GALLIEN 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.
ST Employee
June 7, 2022

Hi @HLee.21​ ,

I did some tests with the RS485 and it works for me.

The drivers uses stm32_usart_config_reg_rs485() and needs to be initialized before being used with the command "stty -F /dev/ttySTM1 2000000 -echo -icanon -onlcr" on the STM32 board and on the host by modifying the PATH.

I hope it can help you.

Do not hesitate to come back to me if necessary.

Grégory

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.