-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DTR signal needs to be activated from terminal program #32
Comments
Do you have an example of a serial terminal program that does not customarily set DTR by default, and does not expose this option to the user? |
See also raspberrypi/pico-sdk#932 |
Yes there actually is, check the screenshot in this issue. I think you can find more. Btw, conflict resolved at PR #33. |
All of the screenshots there offer the user a DTR toggle. The International Telecommunications Union document ITU-T Rec V.24 has this to say about DTE behaviour in section 3.11:
Which all but states that a DCE may not transmit data to the host without DTR being asserted. |
When hardware flow control / handshaking is been used you are right. When handshaking is off, those doesn't apply. You can check that handshaking is off on those screenshots. I want to add that USB serial converters behaves same. When handshaking is off, DTR / CTS etc. is ignored. |
DTR is/should be orthogonal to flow control. It controls the state of the overall communication channel, not the temporary line conditions requiring pauses (FIFO fill levels) for which RTS/CTS are most often used. See ITU-T rec V.43 section 4.1: Methods for flow control of transmitted data Circuit 108/2 (DTR) is not included in the associated diagram and not mentioned anywhere in the document. Do you have a source for your assertion? |
What I'm saying is the implementation of DTR creates a flow control, which stops sending data to host like RTS/CTS. These are related to DTR/DSR hardware flow control.
I should add that, if we are using 3rd party software which is using serial port, we don't have any control of DTR, like Android app, we can't expect programmers to turn on DTR in every software nor softwares already exist. I remember when making Windows apps in VS .NET, DTR is OFF by default unless you enable it. It's the same in Linux and Android apps. |
I've encountered this exact problem while trying to use picoprobe as a UART to program a Ox64 microcontroller. The tooling for this uses the DTR and RTS for triggering resets, and so i ended up needing to make this change myself in order to be able to program my devices |
The picoprobe uart doesn't expose flow-control pins at all. Even if it did, you won't get a DTR pin as it's not a hardware mux option. The proposal above is to gate the transmission of UART characters over USB with DTR. |
I see that makes sense. I was just providing a very odd example where the microcontroller i was programming didn't actually require those pins to function, but the tooling was clearing DTR and RTS anyways, i presume for other variants of that chip, causing me issues when I attempted to program. The fix above was something i was actually trying to find for a while. |
Problem:
tud_cdc_connected is using DTR bit which is used in cdc_uart.c If DTR is not set by host (PC terminal or other device), we can't send anything to host.
same issue with #906, #921, #932
I don't think its necessary to check DTR as discussed in here -> hathach/tinyusb
Until user open the serial port, data buffer will be overridden.
src/class/cdc/cdc_device.h
src/class/cdc/cdc_device.h
how to fix
change
tud_cdc_connected()
withtud_ready()
The text was updated successfully, but these errors were encountered: