2024-07-31 07:56 AM
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;"
2024-07-31 12:00 PM
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.
2024-08-13 05:25 AM - edited 2024-08-13 05:26 AM
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 */
};