You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ESP32S2: cpu.reset_reason is wrong when resetting from button or microcontroller #4304
The ESP32S2 gives POWER_ON as a reset reason when pressing the reset button (I expected RESET_PIN). microcontroller.reset() gets a WATCHDOG reset reason (expected SOFTWARE).
Tested on MagTag (latest) and ttgo (beta 2), printing out microcontroller.cpu.reset_reason.
Ah I was thinking something like that might be going on with the reset button. That's too bad.
I tried latest S3, and compiled current main on the Magtag. Adafruit CircuitPython 6.2.0-beta.2-230-g64192b0eb on 2021-03-01; Adafruit MagTag with ESP32S2
I tried manually calling microcontroller.reset() in the REPL.
I also used this code on battery to exclude the possibility of USB messing with it.
I get WATCHDOG in both cases. (Well, except on first boot).
importboardimportdisplayioimportmicrocontrollerimportterminalioimporttimefromadafruit_display_textimportlabeldisplay=board.DISPLAYsplash=displayio.Group(max_size=10)
display.show(splash)
text=label.Label(
terminalio.FONT,
scale=3,
color= (255,255,255),
x=display.width//2,
y=display.height//2-10,
max_glyphs=50,
anchor_point= (0.5, 0.5),
)
splash.append(text)
print(microcontroller.cpu.reset_reason)
text.text=str(microcontroller.cpu.reset_reason)[28:]
display.refresh()
forxinrange(20):
print(microcontroller.cpu.reset_reason)
time.sleep(1)
microcontroller.reset() # <--- should result in the screen changing to SOFTWARE
@microdev1 do you use the UF2 bootloader ? It seems to be what makes the difference.
I get the same result as you when I rease_flash and install Circuitpython from the bin.
Activity
anecdata commentedon Mar 2, 2021
Possibly related: #3858
microdev1 commentedon Mar 2, 2021
POWER_ONstatus.SOFTWAREas reset reason when usingmicrocontroller.reset(). Can you try with current main.Neradoc commentedon Mar 2, 2021
Ah I was thinking something like that might be going on with the reset button. That's too bad.
I tried latest S3, and compiled current main on the Magtag.
Adafruit CircuitPython 6.2.0-beta.2-230-g64192b0eb on 2021-03-01; Adafruit MagTag with ESP32S2I tried manually calling
microcontroller.reset()in the REPL.I also used this code on battery to exclude the possibility of USB messing with it.
I get
WATCHDOGin both cases. (Well, except on first boot).microdev1 commentedon Mar 2, 2021
Still unable to replicate this. Tried both in
REPLandcode.py.Neradoc commentedon May 15, 2021
@microdev1 do you use the UF2 bootloader ? It seems to be what makes the difference.
I get the same result as you when I rease_flash and install Circuitpython from the bin.
microdev1 commentedon May 15, 2021
Yup! I get
WATCHDOGwith UF2 and the expectedSOFTWAREwith non-UF2 build.microdev1 commentedon Jul 19, 2021
I just tested this with
TinyUF2 0.5.0and this seems to be fixed.dhalbert commentedon Jul 19, 2021
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.