Skip to content
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

Raspberry Pi Pico 2 can't enter Safe Mode #9710

Open
Supermath101 opened this issue Oct 11, 2024 · 3 comments
Open

Raspberry Pi Pico 2 can't enter Safe Mode #9710

Supermath101 opened this issue Oct 11, 2024 · 3 comments
Milestone

Comments

@Supermath101
Copy link

CircuitPython version

Adafruit CircuitPython 9.2.0-beta.0 on 2024-09-17; Raspberry Pi Pico 2 with rp2350a

Code/REPL

# boot.py
import usb_cdc
usb_cdc.disable()

Behavior

After power-cycling the Raspberry Pi Pico 2, as instructed in #990 (comment), the boot.py still runs.

Description

I was expecting a REPL prompt similar to this, but more applicable to the actual situation:

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

You are in safe mode because:
The power dipped. Make sure you are providing enough power.
Press reset to exit safe mode.

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

Adafruit CircuitPython 8.1.0 on 2023-03-30; Adafruit Feather RP2040 with rp2040

https://learn.adafruit.com/circuitpython-safe-mode/overview

However, I was instead met with no REPL, as the boot.py disabled the REPL.

Additional information

No response

@dhalbert
Copy link
Collaborator

I have reproduced this. I'm thinking that the magic word that detects repeated resets is not being saved for some reason (does reset on the RP2350 clear RAM)?

@Supermath101
Copy link
Author

Supermath101 commented Oct 11, 2024

I have reproduced this. I'm thinking that the magic word that detects repeated resets is not being saved for some reason (does reset on the RP2350 clear RAM)?

If that's actually the situation, maybe Safe Mode could be changed to require pressing BOOTSEL during the initial 700ms timeframe? At least on the original Pico, the BOOTSEL button could be read, albeit slowly: https://arduino-pico.readthedocs.io/en/stable/bootsel.html

@tannewt tannewt added this to the 9.x.x milestone Oct 15, 2024
@jepler
Copy link
Member

jepler commented Oct 18, 2024

I investigated this but didn't find a solution

  • I looked for differences between our link files & the official one. There were differences, but trying to harmonize them (where it comes to the uninitialized data section) didn't solve anything
  • Under a picoprobe debugger, if I use the debugger to reset (ctrl-c break and then issue the gdb command "run") during the safe mode window, it works
  • In the repl, programmatically resetting to safe mode works, which also goes by the same "saved word" method
  • pressing the feather rp2350 reset button breaks the debugger connection so I can't see what happens in gdb
  • I noticed we have the rp2350 "pico bootsel via double reset" code linking in but eliminating it didn't do anything

I looked for any related issues reported against pico-sdk but came up empty.

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

No branches or pull requests

4 participants