2022-10-18 05:51 AM
Next problem with my board is the RS485. I can send bytes, but can't receive because after sending once the DE stays always high. Without sending receive of course works.
&uart5 {
status = "okay";
pinctrl-names = "default", "sleep","idle";
pinctrl-0 = <&uart5_pins_a>;
pinctrl-1 = <&uart5_sleep_pins_a>;
pinctrl-2 = <&uart5_idle_pins_a>;
rts-gpios = <&gpioc 6 GPIO_ACTIVE_HIGH>;
rs485-rts-delay = <0 0>;
linux,rs485-enabled-at-boot-time;
};
uart5_pins_a: uart5-0 {
pins1 {
pinmux = <STM32_PINMUX('B', 6, AF12)>; /* UART5_TX */
bias-disable;
drive-push-pull;
slew-rate = <0>;
};
pins2 {
pinmux = <STM32_PINMUX('B', 5, AF12)>; /* UART5_RX */
bias-pull-up;
};
};
uart5_idle_pins_a: uart5-idle-0 {
pins1 {
pinmux = <STM32_PINMUX('B', 6, ANALOG)>; /* UART5_TX */
};
pins2 {
pinmux = <STM32_PINMUX('B', 5, AF8)>; /* UART5_RX */
bias-pull-up;
};
};
uart5_sleep_pins_a: uart5-sleep-0 {
pins {
pinmux = <STM32_PINMUX('B', 6, ANALOG)>, /* UART5_TX */
<STM32_PINMUX('B', 5, ANALOG)>; /* UART5_RX */
};
};
I also tried setting these with ioctl but the result is always the same. What am I doing wrong?
2022-10-20 11:35 PM
Could some one help me with this @Community member @Gregory PLANCHON ?
I'm using kernel 5.10.
2022-10-21 04:07 AM
The moment I open the port (open( /dev/ttySTM2, O_RDWR | O_NOCTTY | O_NONBLOCK ) the control signal goes high and stays high.
I also tried with rs485-rts-active-low;, but then the signal will stay low and can't send anything. I also back ported the stm32-usart.c from 5.15 but it didn't make any difference. For me it seems that it is stuck in sending mode, but why?
And why is the flag SER_RS485_RX_DURING_TX always set on? It also didn't work if I commented it out.
2022-10-23 11:21 PM
I tried the uart7 where I have possibility to use hardware control pin and it works. So it seems that the RTS control is just broken in your driver if using other pins. @Community member @Gregory PLANCHON Any plans on fixing this?