Skip to main content
SLetter
Associate III
July 31, 2024
Question

Can I Use rts-gpios in the Device Tree or is it not supported

  • July 31, 2024
  • 1 reply
  • 1401 views

stm32mp157f, I need to use uart5 to drive an rs485 but the hardware supplied DE pin is already in use.  So I need to configure a different GPIO to use.  If the device tree binding rts-gpios is supported, then the task is simplified. We can modify the board to use the gpio.  Follow up to that, if it is supported do I still add "linux,rs485-enabled-at-boot-time;" 

1 reply

Erwan SZYMANSKI
Technical Moderator
July 31, 2024

Hello @SLetter ,
Please double check your device tree and pinctrl configuration. You can get inspired by such community post that already deals with you topic : https://community.st.com/t5/stm32-mpus-products/how-to-enable-hardware-flow-control-rs485/td-p/277263

Kind regards,
Erwan.

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.
SLetter
SLetterAuthor
Associate III
August 13, 2024

I don't see where this addresses my question, perhaps I don't understand?  I am aware that I can do this with some coding in kernel but my understanding was that most of what I would need to do was already done if you include rts-gpios in the devtree definition for the uart.  

My current dts entry:

uart5_pins_mx: uart5_mx-0 {
     pins1 {
     pinmux = <STM32_PINMUX('B', 12, AF14)>; /* UART5_RX */
     bias-disable;
     };
     pins2 {
     pinmux = <STM32_PINMUX('B', 13, AF14)>; /* UART5_TX */
     bias-disable;
     drive-push-pull;
     slew-rate = <0>;
     };
};

# idle and sleep not included for brevity

&uart5{
     pinctrl-names = "default", "idle", "sleep";
     pinctrl-0 = <&uart5_pins_mx>;
     pinctrl-1 = <&uart5_idle_pins_mx>;
     pinctrl-2 = <&uart5_sleep_pins_mx>;
     status = "okay";

     /* USER CODE BEGIN uart5 */
     linux,rs485-enabled-at-boot-time;
     rts-gpios = <&gpiof 3 GPIO_ACTIVE_HIGH>;
     /* USER CODE END uart5 */
};