-
Notifications
You must be signed in to change notification settings - Fork 1.3k
ESP32S2: cpu.reset_reason is wrong when resetting from button or microcontroller #4304
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
Comments
Possibly related: #3858 |
|
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. I get import board
import displayio
import microcontroller
import terminalio
import time
from adafruit_display_text import label
display = board.DISPLAY
splash = 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()
for x in range(20):
print(microcontroller.cpu.reset_reason)
time.sleep(1)
microcontroller.reset() # <--- should result in the screen changing to SOFTWARE |
Still unable to replicate this. Tried both in Adafruit CircuitPython 6.2.0-beta.2-230-g64192b0eb on 2021-03-02; microS2 with ESP32S2
>>> import microcontroller
>>> microcontroller.reset()
# <--- Reset --->
>>> microcontroller.cpu.reset_reason
microcontroller.ResetReason.SOFTWARE |
@microdev1 do you use the UF2 bootloader ? It seems to be what makes the difference. |
Yup! I get |
I just tested this with |
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. |
The ESP32S2 gives
POWER_ON
as a reset reason when pressing the reset button (I expected RESET_PIN).microcontroller.reset()
gets aWATCHDOG
reset reason (expectedSOFTWARE
).Tested on MagTag (latest) and ttgo (beta 2), printing out
microcontroller.cpu.reset_reason
.The text was updated successfully, but these errors were encountered: