rp2040 RESET behavior of WDT / (Soft_)RESET & machine.reset_cause constants (incomplete) #16188
Unanswered
Flipje1955
asked this question in
RP2040 / Pico
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
was playing with MP reset to understand how to best control a Pico running various interfaces from a Rasp Pi (Tkinter GUI). There might be a situation that the Pico becomes unstable or unresponsive and the "master" needs to address that situation. I noticed that the effect of the WDT watchdogtimer differs from machine.reset(). WDT brings into a state of "Connection lost -- EOF" whilst reset() reports "MPY: soft reboot" (a message I had expected to see when applying a machine.soft_reset()). The WDT documentation refers to ".... and resetting the system" without further qualifactions but to me suggesting the effect of machine.reset().
If I use machine.soft_reset(), the system reports (twice) "MPY: soft reboot".
Is this indeed the intended behavior, concretely that I must still reset the system once I allow / cannot prevent a WDT to expire ?
As a side comment: machine.reset() prints the following message TWICE (using different fonts):
"MicroPython v1.24.0 on 2024-10-25; Raspberry Pi Pico2 with RP2350
Type "help()" for more information.
Related to the above: using machine.reset_cause(). Looking at the output of print(dir(machine)), I see the constants "PWRON_RESET" and "WDT_RESET". Not for example "SOFT_RESET". Possibly something missing or are the three other constants documented not applicable to a Rp2040 ?
As a potential use_case: should I be able to pull the rp2040's "RUN" pin low and then read-back that action using machine.reset_cause() ? You have a smart way to retain that event even through the hard reset ?
Platform: Running: MicroPython v1.24.0 on 2024-10-25 Raspberry Pi Pico with RP2040
Thank you for any advice / explanation.
Beta Was this translation helpful? Give feedback.
All reactions