0

Circuit Playground Express corrupted memory space error
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Circuit Playground Express corrupted memory space error

by creatorbyte on Fri Apr 12, 2019 5:33 pm

Hello, I’m new to circuit python and the circuit playground express. I have experience with Arduino and ESP32 though so don’t hesitate to give me complex explanations if any are needed.

I just received my first circuit playground express(CPE in future references for brevity). I am intending to use it to teach the basics of microcontrollers and computer programming to some fourth graders. However, just a few hours after I received it while I was teaching myself circuit python and creating some example sketches for the students when the CPE stopped running the sketches and would not update when I saved the sketch again. I tried removing my code.py file to replace it with a different sketch but I’m not even able to delete the code.py file. Every time I delete the file it disappears but when I refresh the file explorer page(using windows 10) the file reappears. I’m unable to overwrite it and I get errors saying that that particular memory location is corrupt or inaccessible. I can create or delete files elsewhere in the system so I’m not sure what the problem is. I’ve tried pressing the reset button, I’ve tried reflashing the CPE, I’ve tried just about everything I can think of and it still has the same problem. Can you offer some advice or instructions on how to deal with this problem?

creatorbyte
 
Posts: 19
Joined: Sun Dec 30, 2018 7:59 pm

Re: Circuit Playground Express corrupted memory space error

by danhalbert on Mon Apr 15, 2019 10:45 am

Hi, sorry for your troubles. Read this troubleshooting guide about reformatting CIRCUITPY: https://learn.adafruit.com/welcome-to-c ... sues-20-20

Also, what editor are you using to edit your programs on CIRCUITPY, or are you editing locally and then copying over. Windows has issues about writing data to CIRCUITPY promptly. Please read about safely editing code, including editor suggestions: https://learn.adafruit.com/adafruit-cir ... iting-code

For your students, Mu is probably the best choice as an editor: it's easy to use, and it also has a built-in serial connection to the Python REPL.

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

Re: Circuit Playground Express corrupted memory space error

by creatorbyte on Mon Apr 15, 2019 11:54 am

I will take a look at the guide later today or as soon as I can. I have a feeling that the issue is probably related to a problem that occurred during a file write. I am using the MU editor but I may have copied a sketch file from my desktop and told it to overwrite the current sketch. Would that cause an issue?

creatorbyte
 
Posts: 19
Joined: Sun Dec 30, 2018 7:59 pm

Re: Circuit Playground Express corrupted memory space error

by danhalbert on Mon Apr 15, 2019 12:08 pm

If you copied a file and then reset the board or unplugged before the copy completed (which can take up to 90 seconds), then, yes, CIRCUITPY could get corrupted. On Windows, if you do an operation through the Explorer, you can always "Eject" or "Safe Remove" the drive. It doesn't actually unmount it, but it does force all the data out.

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

Re: Circuit Playground Express corrupted memory space error

by creatorbyte on Mon Apr 15, 2019 12:22 pm

Hmmm.... that information should probably be more prominently featured in the guides. I hadn’t read that at all until today :-) I’m sure that’s what caused the issue. Based on the guide you gave me, I will have to reformat the board and reload it with circuit python.

Thanks for your help. I will try to reformat it later tonight when I get home and see if that fixes it. I already tried reinstalling circuit python before I wrote the first forum post and that didn’t fix the issue.

creatorbyte
 
Posts: 19
Joined: Sun Dec 30, 2018 7:59 pm

Re: Circuit Playground Express corrupted memory space error

by danhalbert on Mon Apr 15, 2019 12:33 pm

You don't need to reload circuitpython. Just do the `import storage; storage.erase_filesystem()` thing (AFTER saving your work, if possible). CircuitPython itself will not be erased, just the contents of CIRCUITPY.

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

Re: Circuit Playground Express corrupted memory space error

by creatorbyte on Tue May 14, 2019 6:47 pm

Thanks. That fixed the problem. I totally forgot to come back and let you know :-)

creatorbyte
 
Posts: 19
Joined: Sun Dec 30, 2018 7:59 pm

Please be positive and constructive with your questions and comments.