RS-485 Tx Enable .dts configuration?

Hi

I am trying to assign RTS control lines to some serial ports on the Beagle and use them for driving TxEnable on RS-485.

I received an answer Using UART0 and UART5 on Expansion headers P8 and P9 as follows:

Where as serial-omap just handled the RTS/CTS as long as the pin’s where specified, for 8250_omap we need to add a few device tree options:

8250_omap.yaml « serial « bindings « devicetree « Documentation - kernel/git/torvalds/linux.git - Linux kernel source tree 1

aka add, cts-gpios/rts-gpios defines…

    cts-gpios = <&gpioX Y GPIO_ACTIVE_LOW>;
    rts-gpios = <&gpioX Z GPIO_ACTIVE_LOW>;

Unfortunately for me, I don’t understand the task above. .dts? Are we rebuilding the Kernel? Can anyone give me some help or point me to some documentation which describes steps on what I need to do. Does getting some handshake lines on a UART t have to be so complicated?

For my list of questions, please refer to the link above.

Appreciate any help I can get.

Just edit the overlay…

on the Beagle:

git clone https://github.com/beagleboard/bb.org-overlays
cd ./bb.org-overlays

Edit file: such as:

add teh CTS/RTS pins as “gpio” mode 7:

add the cts-gpio/rts-gpios options here:

Build and Install:

make
sudo make install
sudo reboot
1 Like

Hi Robert
Thanks for your assistance. I am sorry to be a burden but I just need a little more help if possible please.
I have done the following:

  1. cloned the beagleboard/bb.org-overlays project
  2. edited the file home\debian/bb.org-overlays/src/arm/BB-UART1-00A0.dts and added (uncommented and changed to mode 7)
    BONE_P9_19 (PIN_OUTPUT | MUX_MODE7)|// uart1_rtsn.uart1_rtsn
    BONE_P9_20 (PIN_INPUT | MUX_MODE7)|// uart1_ctsn.uart1_ctsn
  3. checked lines 59-64 but found they already contained the text you described.
  4. make
  5. sudo make install
  6. rebooted.
    Everything built successfully and no errors were reported.

But when I check my UART1 RTS pin using:

config-pin -q p9.19
Current mode for P9_19 is: default

…there is no change.

I tried changing it to mode0 as for UART1 the the P9 port pin 19 is uart1_rtsn in MODE0 and MODE7 is GPIO.

My test app still cannot manually control RTS and the driver does not automatically drive it for Tx-Enable when I am sending data which is what I am hoping for. (checked on my oscillation).

I think the missing pieces in my understanding might be:

  • confirming expectations: Are we able to get RTS to automatically drive Tx-Enablke when I send data or must I drive it high manually before I send and low after all data is sent?
  • confirming which mode I need to set uart1_rtsn and uart1_ctsn to: mode 0 or 7 for RTS to drive my Tx-Enable
  • confirming if I need to add other parameters to the section in lines 59 - 64? If so, what do I need to add.
  • confirming if I need to add other parameters from your earlier response to the 8250_omap.yaml file. I also don’t understand how this fits in. Do I need to clone this project or do anything with this file.

Thanks and best regards
Michael