Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix 1200-bps touch DTR handling (Windows)#2234

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
cmaglie merged 1 commit intoarduino:0.32.xfromcmaglie:fix_touch_dtr_handling
Jun 30, 2023

Conversation

@cmaglie
Copy link
Member

@cmagliecmaglie commentedJun 30, 2023
edited
Loading

Please check if the PR fulfills these requirements

Seehow to contribute

  • The PR has no duplicates (please search among thePull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

This PR disables the step that sets DTR low on the 1200-bps touch subroutine.

This is the reason why it was originally introduced:arduino/Arduino@a6909bd

Fix auto-reset on Leonardo-derived boards from Linux hostsAlso renamed the touchPort() function, as it's now unambiguouslysingle-purpose.The 1200bps reset from Linux hosts wasn't working with these newerJSSC-based versions. Adding a step which explicitly sets DTR low (via aTIOCMSET ioctl clearing DTR) fixes this.I'm fairly sure the reason why this worked on older Arduino with librxtxand not with jssc is that librxtx appears to keep HUPCL in the termioflags, but jssc appears to remove it. If HUPCL ("hangup on close") isset, it causes DTR to be explicitly pulled low on close.

Why we are removing it now?

  • Windows does preserve the state of the RTS/DTR bits on the next opening of the serial port.
  • The serial library used in the Arduino IDE 1.8.x has a bug when trying to set DTR=false, on successive opening of the port the DTR line is set back high by the USB serial driver. This works differently from the serial library we use in the Arduino CLI, which sets DTR=false for good and this setting is preserved on the next opening of the port.
  • Having the serial port left in a state with DTR=false may cause problems with tools uploading later.

It may probably be applied to all OS but, for now, it will be disabled only for Windows to reduce the testing surface.

What is the current behavior?

Upload may fail on some boards (arduino/ArduinoCore-renesas#10).

What is the new behavior?

Uploads should be successful...

Does this PR introduce a breaking change, and istitled accordingly?

No, in theory. A lot of testing is required to be sure.

Other information

The reason why it was originally introduced:arduino/Arduino@a6909bdWhy we are removing it now?* Windows does preserve the state of the RTS/DTR bits on successive  opening of the serial port.* The serial library used in the Arduino IDE 1.8.x has a bug when trying  to set DTR=false, on successive opening of the port the DTR line is  set back high by the USB serial driver. This works differently from  the serial library we use in the Arduino CLI, that sets DTR=false for  good and this change is preserved on the successive opening of the  port.* Having the serial port left in a state with DTR=false may cause  problems to tools uploading later.It may probably completely removed, but for now, to reduce the testingsurface, it will be disabled only for Windows.
@cmagliecmaglie self-assigned thisJun 30, 2023
@cmaglie
Copy link
MemberAuthor

Failing checks are OK ✅. They are happening because this PR is against an old release branch.
It will be eventually cherry-picked onmaster.

@cmagliecmaglie added topic: codeRelated to content of the project itself type: imperfectionPerceived defect in any part of project priority: highResolution is a high priority criticality: highestOf highest impact labelsJun 30, 2023
@cmagliecmaglie merged commitb08dbd5 intoarduino:0.32.xJun 30, 2023
@cmagliecmaglie deleted the fix_touch_dtr_handling branchJune 30, 2023 11:39
kittaakos pushed a commit to arduino/arduino-ide that referenced this pull requestJun 30, 2023
Ref:arduino/arduino-cli#2234Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit to arduino/arduino-ide that referenced this pull requestJun 30, 2023
Ref:arduino/arduino-cli#2234Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
kittaakos pushed a commit to arduino/arduino-ide that referenced this pull requestJun 30, 2023
Ref:arduino/arduino-cli#2234Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
cmaglie added a commit that referenced this pull requestJun 30, 2023
The reason why it was originally introduced:arduino/Arduino@a6909bdWhy we are removing it now?* Windows does preserve the state of the RTS/DTR bits on successive  opening of the serial port.* The serial library used in the Arduino IDE 1.8.x has a bug when trying  to set DTR=false, on successive opening of the port the DTR line is  set back high by the USB serial driver. This works differently from  the serial library we use in the Arduino CLI, that sets DTR=false for  good and this change is preserved on the successive opening of the  port.* Having the serial port left in a state with DTR=false may cause  problems to tools uploading later.It may probably completely removed, but for now, to reduce the testingsurface, it will be disabled only for Windows.
cmaglie added a commit that referenced this pull requestJun 30, 2023
The reason why it was originally introduced:arduino/Arduino@a6909bdWhy we are removing it now?* Windows does preserve the state of the RTS/DTR bits on successive  opening of the serial port.* The serial library used in the Arduino IDE 1.8.x has a bug when trying  to set DTR=false, on successive opening of the port the DTR line is  set back high by the USB serial driver. This works differently from  the serial library we use in the Arduino CLI, that sets DTR=false for  good and this change is preserved on the successive opening of the  port.* Having the serial port left in a state with DTR=false may cause  problems to tools uploading later.It may probably completely removed, but for now, to reduce the testingsurface, it will be disabled only for Windows.
@per1234per1234 added the os: windowsSpecific to Windows operating system labelJun 30, 2023
fabik111 pushed a commit to fabik111/arduino-cli that referenced this pull requestAug 29, 2025
The reason why it was originally introduced:arduino/Arduino@a6909bdWhy we are removing it now?* Windows does preserve the state of the RTS/DTR bits on successive  opening of the serial port.* The serial library used in the Arduino IDE 1.8.x has a bug when trying  to set DTR=false, on successive opening of the port the DTR line is  set back high by the USB serial driver. This works differently from  the serial library we use in the Arduino CLI, that sets DTR=false for  good and this change is preserved on the successive opening of the  port.* Having the serial port left in a state with DTR=false may cause  problems to tools uploading later.It may probably completely removed, but for now, to reduce the testingsurface, it will be disabled only for Windows.
cmaglie added a commit that referenced this pull requestSep 1, 2025
The reason why it was originally introduced:arduino/Arduino@a6909bdWhy we are removing it now?* Windows does preserve the state of the RTS/DTR bits on successive  opening of the serial port.* The serial library used in the Arduino IDE 1.8.x has a bug when trying  to set DTR=false, on successive opening of the port the DTR line is  set back high by the USB serial driver. This works differently from  the serial library we use in the Arduino CLI, that sets DTR=false for  good and this change is preserved on the successive opening of the  port.* Having the serial port left in a state with DTR=false may cause  problems to tools uploading later.It may probably completely removed, but for now, to reduce the testingsurface, it will be disabled only for Windows.Co-authored-by: Cristian Maglie <c.maglie@arduino.cc>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@umbynosumbynosumbynos approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

@cmagliecmaglie

Labels

criticality: highestOf highest impactos: windowsSpecific to Windows operating systempriority: highResolution is a high prioritytopic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@cmaglie@umbynos@per1234

[8]ページ先頭

©2009-2025 Movatter.jp