0

OSError: [Errno 5]
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

OSError: [Errno 5]

by gingle on Mon Aug 12, 2019 11:38 am

I am using Metro M4 Express and have the following single line in code.py: from adafruit_bus_device.spi_device import SPIDevice
I am getting code.py output "OSError: [Errno 5] Input/output error" when I reboot but not when I copy the code line to REPL. I am using Adafruit CircuitPython 4.0.2 on 2019-06-27; Adafruit Metro M4 Express with samd51j1. I have the same error with CircuitPython 5.0.0-alpha. Is there a solution to this problem?

gingle
 
Posts: 21
Joined: Tue Mar 07, 2017 2:46 pm

Re: OSError: [Errno 5]

by adafruit_support_carter on Mon Aug 12, 2019 2:33 pm

Do you have any other .py files in your CIRCUITPY folder? If so, what are they.

adafruit_support_carter
 
Posts: 13216
Joined: Tue Nov 29, 2016 2:45 pm

Re: OSError: [Errno 5]

by gingle on Mon Aug 12, 2019 4:08 pm

I have two boards that I am working with 1) the metro-m4-express and 2) a board based on the Metro-M4-Express. Both show the identical problem. There are no py files on either except for code.py. I have attached both files.
Attachments
My board.jpg
My board.jpg (28.41 KiB) Viewed 96 times
Metro-M4-Express.jpg
Metro-M4-Express.jpg (26.61 KiB) Viewed 96 times

gingle
 
Posts: 21
Joined: Tue Mar 07, 2017 2:46 pm

Re: OSError: [Errno 5]

by adafruit_support_carter on Mon Aug 12, 2019 4:14 pm

I can't recreate this issue. Can you post the full message that gets printed out on your setup.

This is my code.py:
Code: Select all | TOGGLE FULL SIZE
from adafruit_bus_device.spi_device import SPIDevice

and then I soft reboot (CTRL-D) from REPL:
Code: Select all | TOGGLE FULL SIZE
Adafruit CircuitPython 4.0.2 on 2019-06-27; Adafruit Metro M4 Express with samd51j19
>>>
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:



Press any key to enter the REPL. Use CTRL-D to reload.


and it runs without issue.

adafruit_support_carter
 
Posts: 13216
Joined: Tue Nov 29, 2016 2:45 pm

Re: OSError: [Errno 5]

by gingle on Mon Aug 12, 2019 7:43 pm

I tried it again and it worked ok the first time. I then uploaded code.py and put a <CR> in the first line of code.py. When I saved the file to Metro it showed Errno 5. I then went to REPL and did a CTRL-D and it booted ok. It seems that a save in the auto-reload is the problem. I am using TextPad as my editor in Win10. My serial terminal is Tera Term VT. My code.py is "from adafruit_bus_device.spi_device import SPIDevice". I am also getting a corrupted code.py when I download it several times. property>tools will repair the drive but I loose code.py.

soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
OSError: [Errno 5] Input/output error



Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.2 on 2019-06-27; Adafruit Metro M4 Express with samd51j19
>>>
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:



Press any key to enter the REPL. Use CTRL-D to reload.

gingle
 
Posts: 21
Joined: Tue Mar 07, 2017 2:46 pm

Re: OSError: [Errno 5]

by adafruit_support_carter on Mon Aug 12, 2019 8:51 pm

This sounds like an issue with delayed writes when saving the file from your text editor - TextPad. See here for more info:
https://learn.adafruit.com/welcome-to-c ... g-code-7-9
There's a list of known good text editors.

You may want to try installing and using Mu.
https://learn.adafruit.com/welcome-to-c ... -mu-editor

adafruit_support_carter
 
Posts: 13216
Joined: Tue Nov 29, 2016 2:45 pm

Re: OSError: [Errno 5]

by gingle on Tue Aug 13, 2019 11:16 am

You are absolutely right. I switched to Mu and everything works OK. Thanks for the help.

gingle
 
Posts: 21
Joined: Tue Mar 07, 2017 2:46 pm

Re: OSError: [Errno 5]

by adafruit_support_carter on Tue Aug 13, 2019 1:10 pm

Cool. Glad that helped, and it was something simple. Thanks for letting us know. Have fun!

adafruit_support_carter
 
Posts: 13216
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.