mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* CH341 RTS/CTS flow control disabled in driver?
@ 2024-03-14 22:13 Cameron Williams
  2024-03-15  8:01 ` Johan Hovold
  0 siblings, 1 reply; 2+ messages in thread
From: Cameron Williams @ 2024-03-14 22:13 UTC (permalink / raw)
  To: linux-usb, linux-kernel

Hi all.

I am wondering if anyone knows anything regarding the RTS/CTS lines on the CH341 (maybe CH340 though I have no chip example).
I have two CH341-based devices, both a generic 3V3 uart and also an all-in-one type device with SPI/I2C.

From my tests, neither of them seem to have RTS/CTS respected, and I don't believe they are fake?

My test procedure is as follows:
1) Have nothing connected except TxD/RxD via a jumper.
2) Open `statserial` to check the status of the lines. On all devices, RTS is set to 1 and CTS is set to 0.
3) Open PuTTY, ttyUSB0, 9600 baud, RTS/CTS flow control. Data should not flow as CTS is not high. Close PuTTY.
4) Open PuTTY again, same settings, but with no flow control. Characters buffered from step 3 should now appear thanks to the loopback in step 1.

Alternatively, for step 3 and 4, set Picocom to use RTS/CTS, send some data, then disable flow control, and the buffered data will now flow.

Using an (albeit fake) FTDI device, and PL2303 based device, they both work as expected.
A CP2102 doesn't like to exit with stuff already in the buffer (just hangs PuTTY), but thats a separate issue, and at least it is respecting CTS/RTS.

However with both CH341 devices I have, on step 3, the data flows regardless. Checking in statserial, CTS is indeed still set to 0.

Is this intended behaviour? Looking through the source I can see RTS/DTR should be supported, but it just doesn't seem to work.

If anyone wants to look at it I'm happy to help debug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: CH341 RTS/CTS flow control disabled in driver?
  2024-03-14 22:13 CH341 RTS/CTS flow control disabled in driver? Cameron Williams
@ 2024-03-15  8:01 ` Johan Hovold
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hovold @ 2024-03-15  8:01 UTC (permalink / raw)
  To: Cameron Williams; +Cc: linux-usb, linux-kernel

On Thu, Mar 14, 2024 at 10:13:03PM +0000, Cameron Williams wrote:

> I am wondering if anyone knows anything regarding the RTS/CTS lines on
> the CH341 (maybe CH340 though I have no chip example).

> From my tests, neither of them seem to have RTS/CTS respected, and I
> don't believe they are fake?

> Is this intended behaviour? Looking through the source I can see
> RTS/DTR should be supported, but it just doesn't seem to work.

The driver does not implement hardware flow control (CRTSCTS) so this is
expected behaviour.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-15  8:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-14 22:13 CH341 RTS/CTS flow control disabled in driver? Cameron Williams
2024-03-15  8:01 ` Johan Hovold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®