This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625: am625: problem uart RS485 kernel 6

Part Number: AM625

Hi,

I'm using the new SDK 09.00.00.03 (17 Jul 2023) with kernel 6.1.33.
I have problems using a uart like RS485. 

There doesn't appear to be support from the 8250_omap.c driver.

Do you confirm this? Is there a patch to include support?


Best Regards
Domenico Acri
  • Hi Domenico,

    I have assigned your query to our expert. As its Thanksgiving week, responses will be delayed when they return to office.

    In the meantime, I found this other issue, see if it helps:

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1211082/am625-rs485-issue

    Best Regards,

    Suren

  • Hi Domenico,

    Yes, RS485 is supported in SDK9.0 for AM625.

    Please provide the details of the problem you have.

  • Hi,

    thanks a lot for the answer.

    The main problem is how to I configure a uart as RS485.

    The device tree node is as follows:

    &wkup_uart0 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&wkup_uart0_pins_default>;
    uart-has-rtscts;
    };

    I disabled wkup_uart from SYSFW firmware.

    With kernel 5.10.168 with SDK 8.0, the RS485 is working,

    and mode was configured by this flags via IOCTL:

    /* Don't forget to read first the current state of the RS-485 options with ioctl.
    If You don't do this, You will destroy the rs485conf.delay_rts_last_char_tx
    parameter which is automatically calculated by the driver when You opens the
    port device. */
    if (ioctl (fd, TIOCGRS485, &rs485conf) < 0)
    {
    printf("Error: TIOCGRS485 ioctl not supported.\n");
    }

    /* Enable RS-485 mode: */
    rs485conf.flags |= SER_RS485_ENABLED;

    With kernel 6, I have this error:

    Error: TIOCGRS485 ioctl not supported

    in the driver 8250_omap.c, seems to be missing the register that enables flow controls,

    which is instead present in the old kernel:

    if (rs485->flags & SER_RS485_ENABLED)
    priv->mdr3 |= UART_OMAP_MDR3_DIR_EN;
    else
    priv->mdr3 &= ~UART_OMAP_MDR3_DIR_EN;

    Am I missing something?

    BR

    Domenico Acri

  • Hi Domenico,

    priv->mdr3 |= UART_OMAP_MDR3_DIR_EN;

    This is for native RS485 DE pin support. The driver should work for RS485 even without this.

    Have you re-compiled your UART program with kernel 6.1 header files? The "struct rs485" has be changed from kernel 5.10 to 6.1, so your user space program should be re-compiled with the corresponding kernel headers.