Factory reset?

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Factory reset?

Post by pythoncoder » Fri Mar 19, 2021 8:57 am

If you update the Pico firmware the filesystem contents is preserved, including main.py. Sooner or later someone is going to write a main.py which crashes the board, by poking RAM locations or by abuse of the inline assembler.

Is there a way to wipe the filesystem of an unbootable board?
Peter Hinch
Index to my micropython libraries.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Factory reset?

Post by dhylands » Fri Mar 19, 2021 1:53 pm

I haven’t tried this yet, but there is an example program included here: https://github.com/raspberrypi/pico-examples called nuke which will erase all of flash.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Factory reset?

Post by Roberthh » Fri Mar 19, 2021 2:24 pm

It happened to me, that I made a main.py which freezed the board. But I wanted to keep the file system. So I created a firmware with a _boot.py, which erased main.py. After that, I could use the previous firmware.

hippy
Posts: 130
Joined: Sat Feb 20, 2021 2:46 pm
Location: UK

Re: Factory reset?

Post by hippy » Sat Mar 20, 2021 12:35 am

This was my solution for removing main.py when it was stopping the REPL being reached, preventing rshell from accessing it, when I wanted something less than nuking everything -

https://www.raspberrypi.org/forums/view ... 6&t=305432

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Factory reset?

Post by pythoncoder » Sat Mar 20, 2021 1:34 pm

Thanks, all. Good solutions.
Peter Hinch
Index to my micropython libraries.

tomskerous
Posts: 1
Joined: Wed Nov 24, 2021 10:30 pm

Re: Factory reset?

Post by tomskerous » Wed Nov 24, 2021 10:34 pm

Thanks everyone. This thread has saved me from giving up after evening one of my adventures with a Plasma 2040.

Post Reply