cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable hardware flow control (rs485)?

ASido
Associate II

I am using the STM32MP157C-DK2 board. I fixed the stm32mp157a-dk1 file as shown below

0693W000000UTzhQAG.png

Generated the device tree blobs (* .dtb) and updated the device tree blob on the board.

I sent an echo "hello!" > /dev/ttySTM1

0693W000000UU1YQAW.png

and I see that the RTS pin is held for too long, I think that this pin is held all the time while the file is open by the operating system. 

0693W000000UTxgQAG.pngThen I launched the Modbus-RTU test application. reception and transmission work correctly, but the RTS pin does not switch. The RTS pin was pressed to the ground when I launched the application and released when I closed the application.

0693W000000UTxlQAG.pngHow to enable hardware flow control (rs485)?

1 ACCEPTED SOLUTION

Accepted Solutions
ASido
Associate II

I found the answer here https://www.kernel.org/doc/Documentation/serial/serial-rs485.txt. it was necessary to fill out the rs485conf structure and call ioctl (fd, TIOCSRS485 and & rs485conf)

View solution in original post

3 REPLIES 3
Olivier GALLIEN
ST Employee

​Hi @ASido​ 

As first assumption your problem looks similar to this post :

https://community.st.com/s/question/0D50X0000BQOvVxSQL/cant-get-the-rts-line-working-on-stm32mp1-in-linux-stm32mp157cdk2

"st,hw-flow-ctrl;" properties missing in your Device Tree ?

Can you please tell me which version of OpenSTLinux you are using ?

Thanks,

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.

Hi OlivierG (ST Employee)

>As first assumption your problem looks similar to this post :

https://community.st.com/s/question/0D50X0000BQOvVxSQL/cant-get-the-rts-line-working-on-stm32mp1-in-linux-stm32mp157cdk2

yes i saw this post

>"st,hw-flow-ctrl;" properties missing in your Device Tree ?

yes, it was seen in my question

>Can you please tell me which version of OpenSTLinux you are using ?

1.2.0

I did as it is written here: https://wiki.st.com/stm32mpu/wiki/Serial_TTY_device_tree_configuration#Activation_of_a_USART_or_UART_instance and https://wiki.st.com/stm32mpu/wiki/How_to_use_TTY_with_User_Terminal#Purpose

Reception and transmission are working correctly, but the RTS output is not working properly. this can be seen in the screenshots in my question

ASido
Associate II

I found the answer here https://www.kernel.org/doc/Documentation/serial/serial-rs485.txt. it was necessary to fill out the rs485conf structure and call ioctl (fd, TIOCSRS485 and & rs485conf)