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.

AM4376: RS-485 commutation Issue with Linux SDK 8.02.00.24 (Kernel 5.10)

Part Number: AM4376

Hi Experts

Our customer is developing minor-change model at this time, and they updated SDK (ver. 4.2.0.9 )to the latest Linux SDK version (ver. 08.02.00.24), as well. As the result, customer is encountering missing-commutation issue now. Customer is using omap-serial.c file, when they replaced omap-serial.c (ver. 08.02.00.24) with omap-serial.c  (ver. 4.2.0.9 ), it seemed this issue was resolved.

Since I found out there is similar issue report thread in E2E forum, I share this URL with customer. After that, I receive the following questions.

  1. Customer understood  omap-serial.c has not been maintained for a long time, but, customer is asking TI if it is possible to use omap-serial.c  (ver. 4.2.0.9 ). I believe it is difficult to answer it.. however, can I have your expert’s advice/comments on them, please?
  2. Regarding 8250-omap.c, customer understand it is a new UART driver… customer wants to do RS-485 commutation. In this case, customer is considering that they need to control RTS/CTS. They mean, they need to set “High” to RTS when customer wants to transfer data, and then, they need to set “Low” to RTS when customer wants to receive data. but, it seems it is impossible to control RTS signal. so, customer is asking if there is any solution for this behavior.

can I have your expert’s advice/comments on them, please?

Best regards,

Miyazaki

  • Hi Miyazaki-san,

    Customer understood  omap-serial.c has not been maintained for a long time, but, customer is asking TI if it is possible to use omap-serial.c  (ver. 4.2.0.9 ). I believe it is difficult to answer it.. however, can I have your expert’s advice/comments on them, please?

    We don't have comments on this, since we don't validate this scenario.

    Regarding 8250-omap.c, customer understand it is a new UART driver… customer wants to do RS-485 commutation. In this case, customer is considering that they need to control RTS/CTS. They mean, they need to set “High” to RTS when customer wants to transfer data, and then, they need to set “Low” to RTS when customer wants to receive data. but, it seems it is impossible to control RTS signal. so, customer is asking if there is any solution for this behavior.

    We would need details of the customer's configuration and issue description.

    Is the native RTS pin is used? or a GPIO based RTS pin is used?

    How RS485 mode is configured? Typically it should be enabled in user space application termios settings when open the UART port.

    Is the RTS polarity reversed or it doesn't toggle at all? The RTS polarity can be adjusted using kernel device tree. Please see kernel device tree binding document for details: <kernel-source>/Documentation/devicetree/bindings/serial/rs485.yaml.

  • Hi Bin,

    Thank you for your comments.

    I shared your Expert’s comments with customer and received customer’s feedback. Customer is using SN65HVD10DRG4 as RS-485 transceiver, and it seems AM4376 is always outputting “Low” for RTS. This means, customer is able to just receive data.  In the case of using 8250-omap.c, customer configured it as follows.

    uart2_pins_default: uart2_pins_default {
                  pinctrl-single,pins = <
                                AM4372_IOPAD(0xa54, PIN_OUTPUT | MUX_MODE7 ) /* (R24) spi4_d0.gpio5[5] */
                                AM4372_IOPAD(0x980, PIN_INPUT_PULLUP | MUX_MODE0 ) /* (K21) uart1_rxd.uart1_rxd */
                                AM4372_IOPAD(0x984, PIN_OUTPUT_PULLDOWN | MUX_MODE0 ) /* (L21) uart1_txd.uart1_txd */
                  >;
    };
    
    &uart1 {
                  status = "okay";
                  pinctrl-names = "default";
                  pinctrl-0 = <&uart2_pins_default>;
                  rts-gpios=<&gpio5 5 GPIO_ACTIVE_HIGH>;
                  rs485-rts-active-high;
                  rs485-rts-delay = <1 1>;
                  linux,rs485-enabled-at-boot-time;
    };
    
    

    How RS485 mode is configured? Typically it should be enabled in user space application termios settings when open the UART port.

    Snice “linux,rs485-enabled-at-boot-time;” is set as above, customer supposes AM4376 would boot in RS485 mode. is that correct? Customer is asking if they should need to configure anything additionaly.

    And then, customer is using “stty” as a configuration tool, but customer mentioned stty fails to change to rs485 mode (stty: invalid argument 'rs485'). Therefore, customer would like to know the command to set “RS485 mode” from shell.

    Can we have further your advice/comments on them, please?

    I really appreciate your help as always.

    Best regards,

    Miyazaki

  • Hi Miyazaki-san,

    I am not sure how to use stty command to set to rs485 mode, I never used it. I use the following tool for testing rs485.

    https://github.com/cbrake/linux-serial-test

    By the way, the customer device tree shows GPIO5_5 is used for rs485 DE control. Please ensure the customer is using the kernel from the latest SDK 8.6. We have customers feedback that early version of the kernel 5.10 doesn't fully support GPIO based rs485 DE control. The issue should be fixed in the latest 5.10 kernel.

  • Sorry, I just realized the customer uses AM437x which latest SDK is 8.2.

    Can you please as the customer to test with the following kernel?

    https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tag/?h=08.06.00.007

  • Hi Bin,

    Thank you for your comments.

    I shared your comments with our customer. And I received their feedback. They mentioned it is difficult to update kernel version at this time… but, if it’s possible to create a patch file which is related to RS485, customer mentioned they will be able to evaluate it. Is it possible?   If not so, customer is considering they will use the old version of omap-serial.c and will guarantee it in customer’s  evaluation.

    And then, customer would like to know when omap-serial.c was no longer supported. Would you clarify it, please?

    Best regards,

    Miyazaki

  • Hi Miyazaki-san,

    We won't be able to provide patches for SDK8.2. As you may know, RS485 is not officially supported in Processor SDK (up to SDK8.5) for any Sitara device, so RS485 function hasn't be validated by the Linux software development team. I have been doing my best to help customers enabling RS485 in their projects. However the AM437x doesn't have RS485 transceivers on the EVM, so it is not trivial for me to create the setup, validate again the RS485 function and create the patches for your customer. Please understand.

    With reviewing the kernel source code, the last update in omap-serial.c was in 4/18/2021 (git commit 565e7c98d3328050b5eecc7f0a2ea3681c15657d). But see git commit 6cfd8117f5722689a9125b5b30302dbe9025b663 (linked below) which add AM437x initial support to kernel, 8250-omap.c drvier was used. omap-serial.c has never been used/validated on AM437x.

    https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/arch/arm/boot/dts/am4372.dtsi?id=6cfd8117f5722689a9125b5b30302dbe9025b663#n45

  • Hi Bin,

    Thank you for your clarification.

    I shared your comments with our customer.

    Best regards,

    Miyazaki