adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
Other
4.09k stars 1.21k forks source link

Reset while boot.py running (blue status LED) deletes boot.py file #4715

Open kattni opened 3 years ago

kattni commented 3 years ago

This is on an ItsyBitsy RP2040.

Currently running:

Adafruit CircuitPython 7.0.0-alpha.1-1025-g30c7aa8fc on 2021-05-05; Adafruit ItsyBitsy RP2040 with rp2040

code.py and boot.py It doesn't matter what you add to code.py - I added another line simply to verify the behavior.

code.py contains the following:

print("Hello World!")
print("Another line of code.")

boot.py is empty.

To reproduce: Click the reset button. When the LED turns blue to indicate boot.py is running, press reset again.

Results: The board reboots, mounts as CIRCUITPY. No boot.py is present, it has been deleted. The contents of code.py are reset to only the initial print(Hello World!).

Possibly related results with different code.py and boot.py

I began this with a slightly updated version of the Storage boot.py and code.py found here.

By doing the same steps above to reproduce, two times, I was able to replicate the following results: The board reboots, mounts as NO_NAME, with no files on it. I was able to connect to the serial console and REPL. Running storage.erase_filesystem() restored the CIRCUITPY drive, with no contents.

tannewt commented 3 years ago

This might be related to having the FS writeable and being writing boot output to boot_out.txt.