Skip to content

tools/pyboard.py : Set DTR on Windows to avoid ESPxx hard reset. #10347

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

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

Josverl
Copy link
Contributor

@Josverl Josverl commented Dec 27, 2022

Fixes #9659

Based on @mgsb's proposal in #9659 (comment) with added logic to only apply the fix to Windows hosts

Tests

Tested on :

Host MCU result
Windows ESP32
Windows ESP8266
Windows PYBD v1
Windows rp2
Windows samd
Ubuntu 22.04 ESP32
Ubuntu 22.04 ESP8266
Ubuntu 22.04 PYBD v1
Ubuntu 22.04 rp2
Ubuntu 22.04 samd

As there are currently no tests for mpremote in the repo I have created a stand alone test for this using pytest :
https://gist.github.com/Josverl/57159ee096dc941f294c745056fe341c

Happy to add test, but currently the build / test process for mpremote is not clear to me

@github-actions
Copy link

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 

@Josverl Josverl force-pushed the fix/mpremote_reset branch 6 times, most recently from 909e595 to c6d82e4 Compare December 27, 2022 20:32
@dpgeorge dpgeorge added the tools Relates to tools/ directory in source, or other tooling label Jan 13, 2023
Fixes issue micropython#9659.

Signed-off-by: Jos Verlinde <Jos.Verlinde@Microsoft.com>
@dpgeorge
Copy link
Member

Thanks for this, it's a decent solution to the problem (even if it is only specific to ESP devices).

Regarding tests: it would be good to add tests for mpremote, and run them as part of CI. Probably the best way to do that would be to get mpremote working with the unix port (where the unix port acts in a special way like a bare-metal board and supports soft reset). But even if that existed it wouldn't help with the issue here, which is specific to Windows and serial ports. So I'm not really sure how to integrate such hardware-specific tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Relates to tools/ directory in source, or other tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mpremote: on ESPxxx all mpremote commands are followed by a hard reboot
2 participants