Due to high demand expect some shipping delays at this time, orders may not ship for 3-4 business days. On MLK Day no orders will be shipped.
0

OSError 5 in code.py
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

OSError 5 in code.py

by edoarado on Wed Dec 01, 2021 3:29 pm

Hi

My CLUE shows an "OSError: [Errno 5] error Input/output" (Spanish version of circuitPython 7.0) in the "code.py" file.
I'm unable to run any program and everything I tried to modify or delete the code.py file was unsuccessful.
I reloaded the circuitPython UF2 but nothing changed.

Mu editor shows a message to run "chkdsk" to check for corrupt data, but I don't know how to proceed.
I'm running Windows 10 and Linux Mint 20.2 Cinnamon.

Thanks in advance for any help.

edoarado
 
Posts: 3
Joined: Wed Dec 01, 2021 3:09 pm

Re: OSError 5 in code.py

by danhalbert on Thu Dec 02, 2021 1:11 pm

Try erasing and reformatting the filesystem by typing this in the REPL:
Code: Select all | TOGGLE FULL SIZE
import storage
storage.erase_filesystem()

The board will reset and you will have a fresh CIRCUITPY. Then save your code.py again as usual.

What editor are you using?

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

Re: OSError 5 in code.py

by edoarado on Thu Dec 02, 2021 6:27 pm

Thanks danhalbert

Your code worked like a charm. Problem solved.

The editor I was using when the problem appeared was Mu under Windows 10.

Again, thank you very much.

edoarado
 
Posts: 3
Joined: Wed Dec 01, 2021 3:09 pm

Re: OSError 5 in code.py

by danhalbert on Thu Dec 02, 2021 6:31 pm

Glad it's working!

If you reset the board before a write has been completed, it can cause the CIRCUITPY to become corrupted. If you copied a file to to CIRCUITPY with Explorer, or something besides the editor, Windows might only partially update the drive. It can sometimes take tens of seconds to update. Doing an "Eject" forces out everything right away. Mu does the right thing and also forces everything out right away.

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

Re: OSError 5 in code.py

by edoarado on Fri Dec 03, 2021 2:02 pm

Thanks again for your clarification.
I don't remember doing anything wrong, but ... who knows.

I will keep that in mind.

Best regards

edoarado
 
Posts: 3
Joined: Wed Dec 01, 2021 3:09 pm

Please be positive and constructive with your questions and comments.