-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Update esptool reset method #6429
Conversation
For a first PR, you did pretty well! Normally the boards.txt or an astyle problem hits users. |
I think @d-a-v is the expert on this, but he's on vacation for another week, so do please be patient. |
No issue, this PR still need some work and more information about how the ck method can be supported with esptool.py Will be rebased when ready for merge |
tools/boards.txt.py
Outdated
( '.menu.ResetMethod.nodemcu.upload.resetmethod', 'nodemcu' ), | ||
( '.menu.ResetMethod.dtr', 'dtr' ), | ||
( '.menu.ResetMethod.dtr.upload.resetmethod', '--before default_reset --after hard_reset' ), | ||
( '.menu.ResetMethod.nodtr', 'no dtr' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention the old names with something like this:
dtr (aka nodemcu)
no dtr (aka ck)
so users are not lost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, added changes.
c785994
to
725344a
Compare
@f5soh, you'll need to pull in master to fix the compile problems the CI system is having. For some reason I can't do it for you from the website just now. |
725344a
to
76d327c
Compare
Seems the build.py need update for tests: Line 55 in 901410f
|
Ah, yeah. You'll need to fix that in your PR, too. There was also just 2 nights ago an update to the Arduino.cc executable nightly build which changes the FQBN format. See #6461 . Double whammy. |
@f5soh Would you mind renaming back the internal fqbn part to what it currently is ( |
32d3387
to
fb31335
Compare
I keep all previous resetmethod names and simply translate them to new esptool.py options. I can squash reset method changes in one commit for better clarity. |
@@ -1075,7 +1077,7 @@ | |||
|
|||
'flash_erase_menu': collections.OrderedDict([ | |||
( '.menu.wipe.none', 'Only Sketch' ), | |||
( '.menu.wipe.none.upload.erase_cmd', 'version' ), | |||
( '.menu.wipe.none.upload.erase_cmd', 'flash_id' ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am concerned about this change.
flash_id
asks for a connection to the esp, while version
is a no-op which is what we need in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take a board without reset circuit and version as first default command as you want :
- "Only sketch" works only with the "no dtr" reset method
- "Flash erase" works only with the "no dtr, no sync" reset method or second programming step will fail.
Do we really want the user change the reset method every time the erasing flash option is changed ?
With flash_id, both "Only sketch" and "Flash erase" works with "no dtr, no sync" reset method.
As described, this is a workaround needed since the esptool do the erasing and programming in two consecutive commands. May need also the "no dtr, no sync" reset method for all "ck" boards.
Does anyone know what's wrong here? after I upload the code successfully, below that it says Leaving... Hard resetting via RTS pin.. |
What is pending here? |
I'd merge but release is too soon, feedback from users with issues is welcome. |
@f5soh |
5313300
to
fa5c2f0
Compare
@d-a-v There are more users using NodeMCU and wemos minis than users using ESP-01 devices with special programmer(s). There is no standard ESP-01 programmer. I have two different types... No change in behaviour of this two. One works as before (reset). IMHO: Merging this PR will solve more problems, than it maybe! generates |
@Jason2866 This PR is not mergeable as-is and I don't know why. |
The issue I described in version 2.5.2 does not work when ESP8266 uses auto-reset #6631 is that when using the ESP8266 in conjunction with auto-reset circuitry (using DTR to set the ESP8266 in programming mode, and automatic restoring to normal mode after program download) there needs to be a hard (power-off power-on) reset to run the ESP8266 in normal mode. |
and why don't you try the 2.6.1 which has this fix? |
Oh I am so sorry, of course I will try it, and asap! I am not sufficiently familiar yet with the workings of Github, my apologies for undue inconvenience. |
Related to #6296
This is my first PR here, so be patient :)
Since 2.5.1 the upload tool moved to esptool.py, reset methods are deprecated and all boards use in fact the default_reset with dtr.
First commit update the reset methods available:
Second commit is a workaround because the flash erase and write_flash is done in two commands and allow the two consecutive commands using 'no dtr, no_sync' without a reset circuit on board.
This workaround will not be needed if esptool.py handle the erase and write in one command.