Unable to use RS485 in UARTB

Hello Team,
I want to enable RS485 in UARTB & C with gpio pin as enable pin for that i made changes in imx6ull-colibri.dtsi

/* Colibri UART_B */
&uart2 {
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_uart2>;
rts-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
rs485-rts-delay = <0 0>;
// uart-has-rtscts;

imx6ull-colibri.dtsi ‘’’ pinctrl_uart2: uart2grp { fsl,pins = < MX6UL_PAD_UART2_TX_DATA__UART2_DTE_RX 0x1b0b1 /* SODIMM 36 / MX6UL_PAD_UART2_RX_DATA__UART2_DTE_TX 0x1b0b1 / SODIMM 38 */ MX6UL_PAD_GPIO1_IO01__GPIO1_IO01 0x3000 /SODIMM 63/
and in imx6ull-colibri-aster.dtsi

&uart2 {
status = “okay”;

after that i compile and deploy kernel and rebuild image but i am not getting effect in UARTB, help me with steps how to do and and how to test it

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


To enable RS-485 on UARTB and C on the i.MX6ULL Colibri module with a GPIO pin as the enable pin, your device tree modifications seem mostly correct. However, there are a few points and steps we should review to ensure proper functionality:

  1. Device Tree Configuration: Ensure that your device tree changes for enabling RS-485 mode are correctly applied. Your configuration for &uart2 with rts-gpios, rs485-rts-delay, and fsl,dte-mode is a good start. The rs485-rts-active-high and linux,rs485-enabled-at-boot-time properties in imx6ull-colibri-aster.dtsi are also correctly set for enabling RS-485 at boot time and defining the RTS line’s active level.

  2. Testing RS-485 Functionality: After deploying your kernel with the modified device tree, you can test RS-485 functionality in several ways:

    • Using the Serial Port: You can use a terminal program like minicom or picocom to open the serial port and try communicating with an RS-485 device. Ensure you configure the serial port settings (baud rate, parity, stop bits) to match those of your RS-485 device.
    • Using ioctl Calls in a Custom Program: As mentioned in the context, you can control RS-485 settings (like enabling RS-485 mode, setting RTS pin logic levels, and enabling receiver during transmission) by making ioctl calls in a C program. This method gives you fine-grained control over the RS-485 settings and is useful for debugging or when you need to dynamically change RS-485 parameters.
  3. Troubleshooting:

    • Verify GPIO Configuration: Ensure that the GPIO pin used for RTS (&gpio1 1 GPIO_ACTIVE_HIGH) is not being used by another peripheral or system function. Conflicts can prevent proper operation.
    • Kernel Support: Confirm that your kernel version supports the RS-485 features you are trying to use. While the device tree properties you’ve set should not harm older kernels, functionality like rs485-rts-delay might not work as expected if the kernel doesn’t fully support it.
    • Hardware Setup: Double-check your hardware connections, including the RS-485 transceiver and any termination resistors required for your RS-485 network. Improper hardware setup can lead to communication issues.

If after following these steps

Please, also check if these links can help you solve your problem:

UART (Linux) | Toradex Developer Center.