How to Enable RS485 on UARTB with RTS pin control (aster carrier board,iMX6ULL Colibri)

Hi, I want to enable RS485 serial communication on the UART_B with aster carrier board and iMX6ULL colibri.

Could anyone please provide the steps and necessary configuration required to enable RS485 serial communication on UART_B?

I am looking for device tree modification required.

Thanks in advance for your support and guidance.

Shyam Parmar

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:


Hello,

To enable RS485 serial communication on UART_B with the Aster carrier board and iMX6ULL Colibri module, you’ll need to modify the device tree. Here are the general steps and necessary configurations:

  1. Locate the Device Tree Source (DTS) File: First, identify the DTS file for your specific hardware configuration. For the iMX6ULL Colibri with an Aster carrier board, the file is likely named something similar to imx6ull-colibri-aster.dts.

  2. Modify the Device Tree: You need to add or modify the node for UART_B to include RS485 configuration parameters. Below is an example snippet that you might add to the UART_B node:

    &uart2 {
        compatible = "fsl,imx6ul-uart", "fsl,imx21-uart";
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_uart2>;
        rs485-rts-delay = <1 1>;
        linux,rs485-enabled-at-boot-time;
        status = "okay";
    };
    

    In this example, &uart2 should correspond to the alias of UART_B in the device tree. The rs485-rts-delay property sets the RTS delay before and after transmission. The linux,rs485-enabled-at-boot-time property ensures RS485 mode is enabled from boot.

  3. Configure Pin Multiplexing: Ensure the pins are correctly configured for UART_B and RS485. This might involve setting up the correct pin functions in the pinctrl_uart2 node:

    pinctrl_uart2: uart2grp {
        fsl,pins = <
            MX6UL_PAD_UART2_RX_DATA__UART2_DCE_RX 0x1b0b1
            MX6UL_PAD_UART2_TX_DATA__UART2_DCE_TX 0x1b0b1
            MX6UL_PAD_UART2_RTS_B__UART2_DCE_RTS 0x1b0b1
        >;
    };
    

    Adjust the pin configurations according to your specific needs and the Aster carrier board’s schematic.

  4. Recompile the Device Tree: After making the necessary modifications, recompile the device tree blob (DTB) using the appropriate cross-compilation tools for your development environment.

  5. Deploy the New Device Tree Blob: Replace

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

Set up the Torizon IDE Extension Environment | Toradex Developer Center.

Hi, I already tried but RTS pin is not toggling,only data receive not transmit.

Hello @shyamparmar,

It is possible you are missing the CTS configuration:

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_UART2_CTS_B__UART2_DTE_RTS	0x1b0b1 /* SODIMM 32 */
		MX6UL_PAD_UART2_RTS_B__UART2_DTE_CTS	0x1b0b1 /* SODIMM 34 */
	>;
};

Please note that this is already configured in the device tree.

Best Regards,
Bruno

Hello @bruno.tx

Thank you for your response.

I have already tried the suggested pin configuration, but it’s still not working as expected.

I have connected UART_B(Tx,Rx,Rts) to the RS485 IC - max485 .

I am only using RTS for control and not using the CTS pin in this setup.

Could you Please Provide more detailed instructions or any additional steps to ensure proper RS485 communication with RTS pin control on UART_B?

Thank you for your help.

Best regards,
shyam parmar

hello, @bruno.tx please reply

Hi @shyamparmar

Have you checked this article with specific instructions and configurations to use RS485 on the UART?

If you have a colibri evaluation board,

it’s recommended that you firstly validade your device tree in a known hardware setup before moving to with a custom setup, you can verify the RS-485 wiring schematics of the colibri evaluation board in the technical details page.

You can also check other posts with a similar problem

Dear Toradex community Thank you for your time. This issue is resolved.