Disk space error

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
User avatar
workless
Posts: 13
Joined: Sat Mar 24, 2018 7:03 pm
Location: Vancouver, BC

Disk space error

Post by workless » Sat Mar 31, 2018 1:44 am

I've been merrily coding on a PyBoard for a day or two including in assembler (crashing things quite a few times) and suddenly now getting file system errors:

- Syntax errors in script files that were too long
- When I try to move a new file to the flash drive it says "Not enough disk space to copy "pow.py". Additional 4 KB of disk space is required to copy this file. You can manage disk space by removing items..."

Now, when I look at the PYBFLASH in OS X Finder I notice the status bar says:
8 items, 235.7 MB available
(...which sounds a bit unlikely).

Here are the files currently showing on the flash:
  • array_funcs.py 9 KB
    boot.py 203 bytes
    exp.py 997 bytes
    main.py 32 bytes
    pybcdc.inf 3 KB
    README.txt 528 bytes
    SKIPSD 120 bytes
    timers.py 311 bytes
Have I corrupted the flash? How would I remedy that?
What should I do in terms of trouble-shooting this?

User avatar
workless
Posts: 13
Joined: Sat Mar 24, 2018 7:03 pm
Location: Vancouver, BC

Re: Disk space error

Post by workless » Sat Mar 31, 2018 2:30 am

I found the correct documentation on how to factory reset now:

http://docs.micropython.org/en/v1.8.6/p ... ight=reset

Everything is back to factory state. I guess I need to me more careful about memory addressing...

Although Finder still says there is 235.8 MB available on the FLASH drive.

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Disk space error

Post by pythoncoder » Sat Mar 31, 2018 8:44 am

What does

Code: Select all

uos.statvfs('/flash')[1]*uos.statvfs('/flash')[2]
tell you? I see 97280 bytes.

In general sharing the drive with a PC is itself a source of file corruption because the USB spec assumes that slave devices are passive. I disable sharing in boot.py and use rshell for communication.
Peter Hinch
Index to my micropython libraries.

User avatar
workless
Posts: 13
Joined: Sat Mar 24, 2018 7:03 pm
Location: Vancouver, BC

Re: Disk space error

Post by workless » Mon Apr 02, 2018 5:12 pm

pythoncoder wrote:
Sat Mar 31, 2018 8:44 am
What does

Code: Select all

uos.statvfs('/flash')[1]*uos.statvfs('/flash')[2]
tell you? I see 97280 bytes.
That does return 97280.

I have also noticed that when the FLASH drive first mounts it says 69k for a few seconds before switching to 235.7 MB. Maybe I shouldn't be concerned - is it just my computer getting confused with the size of the flash drive?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Disk space error

Post by pythoncoder » Tue Apr 03, 2018 6:41 am

uos.statvfs is telling the truth so the fault seems to be on your computer, but I've no experience of Apple kit so I can't offer any useful suggestions.
Peter Hinch
Index to my micropython libraries.

Post Reply