Skip to content

OSError on large files #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maholli opened this issue Feb 24, 2019 · 3 comments · Fixed by #11
Closed

OSError on large files #9

maholli opened this issue Feb 24, 2019 · 3 comments · Fixed by #11

Comments

@maholli
Copy link

maholli commented Feb 24, 2019

I've been using miniesptool with files on an SD card (too large for internal flash).

It usually works, but I've ran into:

Traceback (most recent call last):
  File "main.py", line 74, in <module>
  File "adafruit_miniesptool.py", line 423, in flash_file
  File "adafruit_miniesptool.py", line 410, in flash_file
OSError: [Errno 5] Input/output error

when the file is greater than ~1.5MB. The OSError: [Errno 5] appears to be generic. Line 410 where the error occurs is when CP tries to read file contents (after opening).

I've found that reducing the FLASH_WRITE_SIZE from 0x400 to 0x200 on

resolves my issue. I also tried adding a gc.collect() prior to the file.read() call, but that didn't seem to help.

@ladyada
Copy link
Member

ladyada commented Mar 12, 2019

@maholli yeah this is a bug in the SD card library but im ok fixing it here for now - can you submit a PR?

@evaherrada
Copy link
Collaborator

@ladyada I'm not sure if this is still wanted, but since it was a really quick fix, I made a PR using the code that @maholli wrote.

ladyada added a commit that referenced this issue May 16, 2019
Fixed OSError from #9 using @maholli's code
@ladyada
Copy link
Member

ladyada commented May 16, 2019

oh yeah that makes sense. thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants