Skip to content
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

serial.c: force DTR serial connection flag to ON for Windows clients #1163

Merged
merged 1 commit into from
May 24, 2024

Conversation

AlexandraTrifan
Copy link
Contributor

@AlexandraTrifan AlexandraTrifan commented May 8, 2024

PR Description

On Linux and MacOS the serial connection handler has the DTR flag configured as ON by default.
The Windows handler has it OFF by default, which prevents a successful serial connection because the driver expects it to be ON.
This issue can be reproduced using UART over USB. The first serial connection through libiio will block while initializing due to this flag. Using a different terminal emulator for the first connection will set the DTR flag to ON. Any subsequent libiio connection (prior to a reset) will be functional.

Serial connection opening is handled separately for Windows (can be checked in libserialport: https://github.com/sigrokproject/libserialport/blob/master/serialport.c#L488 and https://github.com/sigrokproject/libserialport/blob/master/serialport.c#L549 ).

PR Type

  • Bug fix (a change that fixes an issue)
  • New feature (a change that adds new functionality)
  • Breaking change (a change that affects other repos or cause CIs to fail)

PR Checklist

  • I have conducted a self-review of my own code changes
  • I have commented new code, particulary complex or unclear areas
  • I have checked that I did not intoduced new warnings or errors (CI output)
  • I have checked that components that use libiio did not get broken
  • I have updated the documentation accordingly (GitHub Pages, READMEs, etc)

On Linux and MacOS the serial connection handler has the DTR flag
configured as ON by default. The Windows handler has it OFF by default,
which prevents a successful serial connection because the driver expects
it to be ON.
This issue can be reproduced using UART over USB.

Signed-off-by: AlexandraTrifan <Alexandra.Trifan@analog.com>
@AlexandraTrifan AlexandraTrifan merged commit 0d1d8cb into main May 24, 2024
24 of 26 checks passed
@AlexandraTrifan AlexandraTrifan deleted the altrifan/fix-serial-dtr branch May 24, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants