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.

Linux/AM3358: AM335x RTS Control of RS485 at boot up

Part Number: AM3358
Other Parts Discussed in Thread: SN65HVD75

Tool/software: Linux

We are using UART 4 and 5 connected to RS485 transceivers and have connected the Tx/RX control lines to their respective RTS signals from the UARTs.

Everything is working as expected when the application is running, however during boot up the RTS lines default to '1' and this enables the RS485 transmitters. I understand why this is happening but I am somewhat stumped as what to do about it.

So my question is what solutions are there to get the system to boot with the RTS lines low until the RS485 mode of the serial driver needs to use them?

Thanks

Ty

  • Can you please specify the AM335x package type and which pins you use for the RTS signals?
  • By the way, UARTx_RTSn signals of AM335x are active low.
  • **I solved my problem while typing up this question, I have posed it for future reference**

    I think I did a poor job of explaining what I am trying to accomplish, I will add more details.

    We have a board where we added RS485 transceivers to UARTs 4 and 5 from our AM3358. I have created a device tree to setup the pinmux to route out Tx, Rx, and RTS from each UART to pads where they connect up to SN65HVD75 RS485 transceivers. The DE and /RE pins from each respective transceiver are tied together and connected to the RTS pin, the RO pin is connected to the Rx and the DI pin is connected to the Tx line of the UART. See my poor mspaint drawing:

    In software I am configuring the 8250 driver to emulate RS485 mode where the driver will control the RTS line depending if transmitting or receiving. The requirement is that the driver runs the RTS line high before transmitting out bytes and then return the line low after the last bit.

    All of the above is working correctly and we have functioning RS485 ports. 

    My problem is that when no application has the com ports open, as during system boot-up, the 8250 serial driver puts the RTS lines to the idle state which as Biser pointed out is High (active low, idle high). This high idle state has the issue of enabling the line drivers of the RS485 transceivers which will cause issues for other devices who want to use the RS485 bus.

    **Solution**

    The latest kernel (4.18.16 at this time) has support in the core serial driver for the device-tree parameter called linux,rs485-enabled-at-boot-time which sets up the UART into RS485 emulation mode during driver probe, so the RTS lines do not go high while the system is booting. You add this parameter to each UART in the device tree to enable this functionality.

    Sorry but the current TI Linux kernel SDK (5.01.00.11 at this time) does not contain these changes and you have to patch it in.