Skip to main content
Visitor II
March 23, 2020
Solved

How to enable hardware flow control (rs485)?

  • March 23, 2020
  • 2 replies
  • 3727 views

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)?

    This topic has been closed for replies.
    Best answer by ASido

    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)

    2 replies

    Technical Moderator
    March 23, 2020

    ​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

    ASidoAuthor
    Visitor II
    March 24, 2020

    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

    ASidoAuthorAnswer
    Visitor II
    March 25, 2020

    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)