cancel
Showing results for 
Search instead for 
Did you mean: 

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

SLetter
Associate III

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;" 

2 REPLIES 2
Erwan SZYMANSKI
ST Employee

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.

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 */
};