Skip to content

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

@dhalbert

Description

@dhalbert

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions