Toradex SMARC IMX95 evk - RS485 (LPUART2) not working

Hi,

We are working on the SMARC IMX95 EVK. By default, RS232 is working fine; we have validated with the loopback, but the RS485 is not working with loopback, or if we probe the tx SER0_TX, there is also no response. There is no response from the SOM module UART2 Tx out. What was the issue here?
1)Are there any hardware and software changes for the RS-485 to validate?
2)What are all the DTS entries we need to set?
3)Otherwise, How to validate this RS-485 properly?
Attaching the DTS entries of RS-485 for your reference. Thanks in advance..!

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


RS-485 Configuration on SMARC iMX95 EVK

Based on the SMARC iMX95 datasheet and device tree documentation, here’s what you need to configure RS-485 properly:

1. Hardware and Software Requirements

For RS-485 functionality, you need to identify the correct UART and GPIO pins from the SMARC iMX95 pinout (1). According to the pin multiplexing table, the SER0 interface uses:

  • P129 (SER0_TX): UART2_TXD (1)
  • P130 (SER0_RX): UART2_RXD (1)
  • P131 (SER0_RTS#): SAI1_TXD0 (1)
  • P132 (SER0_CTS#): SAI1_TXC (1)

2. Device Tree Configuration

For RS-485 configuration, you need to modify the device tree to enable RS-485 mode (2). The key properties to add are:

&uart2 {
    status = "okay";
    linux,rs485-enabled-at-boot-time;
    rs485-rts-active-low;
    rs485-rx-during-tx;
};

(2)

3. Pin Multiplexing Configuration

You need to configure the pin multiplexing in the device tree (2). Add a pin group node to the iomuxc node:

&iomuxc {
    ...
    pinctrl_uart2_rs485: uart2rs485grp {
        fsl,pins = <
            /* Configure appropriate pin settings for UART2 RS-485 */
        >;
    };
    ...
};

(2)

4. Device Tree Compilation and Deployment

After modifying your device tree:

  1. Compile the device tree using the Device Tree Compiler (3):

    $ make DTC_FLAGS="-@" freescale/<custom-device-tree>.dtb
    

    (2)

  2. Deploy the device tree to your OS image (3). The bootloader uses the fdtfile variable to load the correct device tree binary during boot (3).

5. Validation Steps

To validate RS-485 functionality:

  1. Check pin configuration: Verify that the pins are correctly multiplexed for UART functionality according to the SMARC iMX95 pin alternate functions table (1)
  2. Test with loopback: Connect TX and RX pins directly for loopback testing
  3. Monitor RTS signal: The RTS signal should control the RS-485 transceiver direction

Important Notes

  • The SMARC iMX95 is a preliminary datasheet (1), so some configurations may change
  • Ensure your carrier board has the appropriate RS-485 transceiver circuitry
  • The device tree customization process involves choosing the base device tree, customizing it, compiling, and deploying (3)

For detailed pin assignments and alternate functions, refer to Table 11 in the SMARC iMX95 datasheet (1).

Best regards, Toradex AI Assistant.