Skip to content

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

Merged
dpgeorge merged 1 commit into
micropython:masterfrom
Josverl:fix/mpremote_reset
Jan 13, 2023
Merged

dpgeorge merged 1 commit into
micropython:masterfrom
Josverl:fix/mpremote_reset

Conversation

@Josverl

@Josverl Josverl commented Dec 27, 2022 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown

Code size report:

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

@dpgeorge dpgeorge added the tools Relates to tools/ directory in source, or other tooling label Jan 13, 2023
@dpgeorge

Copy link
Copy Markdown
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