Skip to content

ESP32-S2: cannot go into safe mode when using TinyUF2 #4766

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

Closed
dhalbert opened this issue May 15, 2021 · 3 comments
Closed

ESP32-S2: cannot go into safe mode when using TinyUF2 #4766

dhalbert opened this issue May 15, 2021 · 3 comments
Assignees
Labels
Milestone

Comments

@dhalbert
Copy link
Collaborator

dhalbert commented May 15, 2021

7.0.0 latest, with TinyUF2 in use only.

ESP32-S2 does not go into safe mode when requested to do so on a reset.

>>> import microcontroller
>>> microcontroller.on_next_reset(microcontroller.RunMode.SAFE_MODE)
>>> microcontroller.reset()

On reconnect, CircuitPython does not report it's in safe mode.

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 7.0.0-alpha.2-570-g689ec8622 on 2021-05-14; Adafruit Metro ESP32S2 with ESP32S2

We also see this when it tries to force a safe mode reset, for instance when boot.py has specified devices that cause it to run out of endpoints. Normally that is reported by a specific safe-mode reset.

This inability to go into safe mode occurs only when TinyUF2 is in use. If the .bin version of CircuitPython is used, it goes into safe mode as expected:

Auto-reload is off.
Running in safe mode! Not running saved code.

You are in safe mode because:
The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.

Press any key to enter the REPL. Use CTRL-D to reload.

Adafruit CircuitPython 7.0.0-alpha.2-570-g689ec8622 on 2021-05-14; Adafruit Metro ESP32S2 with ESP32S2

Tagging @hathach and @microdev1 for interest.
Other possibly related issues, which are different: #3988, #4304, #3884.

Thanks @Neradoc for noticing the difference.

@dhalbert dhalbert added the bug label May 15, 2021
@dhalbert dhalbert added this to the 7.0.0 milestone May 15, 2021
@ThomasAtBBTF
Copy link

I really would appreciate if you would also look at the:
microcontroller.on_next_reset(microcontroller.RunMode.BOOTLOADER)

@microdev1
Copy link
Collaborator

I just tested this with TinyUF2 0.5.0 and this seems to be fixed.

@dhalbert
Copy link
Collaborator Author

This should be fixed now with the latest TinyUF2. Update your TinyUF2 bootloader to at least 0.5.0, following the instructions here: https://learn.adafruit.com/adafruit-magtag/install-uf2-bootloader. Thanks @microdev1 for testing and @hathach for the TinyUF2 fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants