Hello!
I'm trying to make RS-485 connection work in half-duplex mode on the i.MX8
Found this very similar problem here: https://community.nxp.com/t5/i-MX-Processors/Does-UART-in-RS485-mode-support-only-9-Bit-mode-for-i-M...
Looks like the solution was to add the rs485-enabled-at-boot-time property in the required uart node in the device tree. I searched in the kernel code and this is checked at the function uart_get_rs485_mode. If the property is present the SER_RS485_ENABLED flag is set
But digging deeper into the code, the function that should actually set the RTS pin to the required value is empty.
That function is mctrl_gpio_set which is called by both the function imx_uart_rts_active and imx_uart_rts_inactive
That can be checked here
I didn't test in my board yet to see if just adding the rs485-enabled-at-boot-time property enables the half-duplex comm. But I'm curious about why is that function empty in the kernel code
Thank you so much!
Hi jose_au_zone
seems it is used in imx.c using "SER_RS485_ENABLED",
if (device_property_read_bool(dev, "linux,rs485-enabled-at-boot-time"))
rs485conf->flags |= SER_RS485_ENABLED;
Best regards
igor
Thanks for the reply. That I know already, but why the function that would change the RTS line to the appropriate level is empty? That's what I wanted to know
Thanks!
>why the function that would change the RTS line to the appropriate level is empty?
imx_uart_start_tx() seems changes the RTS line, it is not empty :
Best regards
igor