UART RTS/CTS control problem

I have got the post on mangOH forum:
https://forum.mangoh.io/t/uart-rts-cts-control-problem/1446/13

I want to use RTS/CTS lines to control flow on my designed IoT card. Unfortunately I cannot do it. All technical drawings show RTS/CTS lines, so I have assumed, both UARTS are 4-wire. My assumption was wrong. After your last response, I checked architecture of WP8548, WP7502, WP7504. All 3 processors has got 2 UARTS. UART1 is 8-wire and UART2 is only 2-wire.
I cannot use RTS/CTS lines because:

FX30 has got UART2 on IoT card, so only Rx,Tx are available (no RTS/CTS). FX30S has got RS232 on the back based on UART1, but lines RTS/CTS are dead/unresponsive.

I have got UART1 on mangOH green on IoT0 or IoT1 slot. But I can control only RTS line. I cannot read status of CTS.

mangOH Red has got UART1 on IoT slot, but I don’t know if I can control RTS/CTS lines, because I don’t have the board.

I can NOT use RTS/CTS lines on my IoT card because it will not be working. FX30 has not got MUX to redirect UART1 to IoT. So it will not be working because of design of FX30. mangOH green thinks that CTS line is always set, so my IoT will not be working.

Hi there,
You’re correct, the WP8548 only supports 2 wire on UART2, so there is no real hardware flow control. If you’re building your own kernel, one option is to always enable CTS. The RTS and CTS signals are connected to GPIO and can be configured manually.

Would this help?

BR,
Chris

Hi @cchenry,
I know, I can use GPIO, however I would prefer RTS line. GPIO is not very quick.

On my FX30S I have got file rs_mode. I can switch between RS485 and RS232

echo 0 > /sys/devices/platform/msm_serial_hsl.1/rs_mode
cat /sys/devices/platform/msm_serial_hsl.1/rs_mode
RS232

echo 1 > /sys/devices/platform/msm_serial_hsl.1/rs_mode
cat /sys/devices/platform/msm_serial_hsl.1/rs_mode
RS485

I do not understand this. If I cannot control RTS line why do I need this swich?

The script switches between RS232 and RS485. On the FX30, the hardware between the 2 is shared, so it will:

  • configure GPIO appropriately
  • enables/disables the RS232 transceiver
  • enables/disables the built-in RS485 termination resistor

BR,
Chris

1 Like

Thanks for info. I have one more question. FX30S has got DB9 connector. DB9 is connected to 8-wire UART1. So why I cannot control RTS/CTS line on DB9?

You’re very welcome. The DB9 is indeed connected to the 8-wire UART1, and should support a 4-wire interface, so RTS/CTS should be controlled in hw. (Currently, the WP8548 does not support the full 8-wire interface).

Have you enabled RTS/CTS enabled via stty?

BR,
Chris

Are you talking about stty -F /dev/ttyHSL0 crtscts ? I have turned this on and off. It should be off in my opinion because I want to control RTS/CTS manually and it does not work. I have done similar test with DB9 on FX30S, I have done on mangOH. I described the test HERE . You will also find my source code there. I think FX30 has got 2-wire rs on DB9.

Hi there,
I’m confused, in your mangOH forum post I think you’re discussing controlling the IOT UART, versus now, we’re talking about controlling the DB9 UART.

The mangOH Green routes UART2 to the DB9 and UART1 to the IOT slots, but through UART expanders. The FX30 routes UART1 to the DB9 and UART2 to the IOT slot.

UART1 is configured as a 4-wire UART using the HSL0 driver. Whereas UART2 is a 2-wire UART using the HSL1 driver. It’s confusing because the physical UARTs show 8-wire and 4-wire.

If you want to control RTS/CTS manually, you’d need modify the kernel to not consume the pins. In the FX30, the arch/arm/mach-msm/board-9615-gpiomux.c file is patched on top of the stock WP (mangOH) GPIO configuration for UART2 RTS/CTS.

Please see the patch file:
meta-columbia-x/meta-columbia-x-bsp/recipes-kernel/linux/files/0010-ALPC-167-UART2_CTS-UART2_RTS-Default-Settings.patch
but be aware, some of the other patches are added on top of this one.

Are you building the FX30 source from legato-spm? If so, only R13.1.3.E02 is supported, which isn’t the official released version, R13.1.3.001. The official source code is now available here:

http://downloads.sierrawireless.com/airlink/FX30/FX30_WP8548_full_R13.1.3.001.tar.gz

BR,
Chris

1 Like

Hi Chris,
We build IoT card and we wanted to use RTS line to control flow. IoT’s on mangOH Red and Green are connected to UART1. IoT on FX30 is connected to UART2. Because of this inconsistent, I cannot relay on RTS line. I think FX30 should have MUX to swich UARTs.
mangOH green on IoT0/IoT1 uses UART1 and FX30S on DB9 connector has got UART1. I was thinking why I can control RTS line on mangOH green and I cannot do it on FX30S DB9 connector. Now I understed it.

Many thanks for your help.

Best regards

Bartek