Black Lives Matter - Action and Equality.
0

CircuitPython program prevents drive from mounting
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

CircuitPython program prevents drive from mounting

by kmevans on Wed May 20, 2020 1:08 am

I have a very simple CircuitPython program which prevents the CIRCUITPY drive from mounting. I had to erase my drive to recover. (I posted a separate question about that in the ItsyBity M4 section.) Anyways I don't want to post this program here, as it might cause someone to lose data. How can I best communicate this with the developers? Maybe it's ok to post publicly since things like storage.erase_filesystem() are documented, but I'm afraid someone won't believe me and will just paste the code into Mu without thinking.

kmevans
 
Posts: 26
Joined: Mon Feb 06, 2017 4:32 pm

Re: CircuitPython program prevents drive from mounting

by dastels on Wed May 20, 2020 8:29 am

I think if you make sure to clearly warn about what you see it doing, then if they try it it's on them.

But a better way to get it in front of the developers is the #circuitpython topic on the Adafruit Discord server. See https://learn.adafruit.com/welcome-to-the-community

Dave

dastels
 
Posts: 2473
Joined: Tue Oct 20, 2015 3:22 pm

Re: CircuitPython program prevents drive from mounting

by kmevans on Wed May 20, 2020 12:41 pm

Thanks - I've now posted about this on discord, but I'll put it here too.

Warning- before anyone tries this please make sure that you have a backup of your CIRCUITPY drive, and you know how to run a flash eraser specific to your CircuitPython board. e.g. https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/troubleshooting

I am using a Mac running 10.14.6 connected to an ItsyBitsy M4 Express running "Adafruit CircuitPython 5.3.0 on 2020-04-29; Adafruit ItsyBitsy M4 Express with samd51g19"

I found that it I put this simple program into code.py, then my ItsyBitsy will not mount as a drive. To recover I had to enter bootloader mode, erase the drive, and then reload CircuitPython. Maybe there's a better way to recover, or there's something unique about my setup which causes this. I'm suspicious that the bignum code is not giving time to other code involved in handling the USB subsystem. (If I had a hacked version of CircuitPython which didn't load code.py, then that could be loaded to enable a mount and cleanup.)

Code: Select all | TOGGLE FULL SIZE
print("The waiting game")
i = 0
while True:
    print("Looping {}".format(i))
    i = i + 1
    a = 2**(65536*2)

kmevans
 
Posts: 26
Joined: Mon Feb 06, 2017 4:32 pm

Re: CircuitPython program prevents drive from mounting

by kmevans on Sat May 23, 2020 4:47 pm

Dan Halbert mentioned safe mode in the github issue that I opened, and indeed it is useful for recovering from this sort of problem. It's described on https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/troubleshooting

kmevans
 
Posts: 26
Joined: Mon Feb 06, 2017 4:32 pm

Re: CircuitPython program prevents drive from mounting

by danhalbert on Sun May 24, 2020 8:36 am


danhalbert
 
Posts: 2024
Joined: Tue Aug 08, 2017 12:37 pm

Please be positive and constructive with your questions and comments.