0

Trinket M0 Storage Size
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket M0 Storage Size

by Foamyguy on Wed Jan 30, 2019 3:08 pm

My company deployed several (>100) Trinket M0 boards to serve a specific purpose within a larger hardware fixture. I am in the process of looking at ones returned to us as bad to see what is going on with them.

I have one Trinket M0 that is reporting 47kb of total disk space:
Image

However all the rest of "normal" the Trinket M0 boards show 59kb total space:
Image

I noticed this other forum post reporting a very similar issue:
viewtopic.php?f=52&t=142951&p=707969&hilit=storage#p707969

In that case it looks like it was resolved by using storage.erase_filesystem() and then reloading circuit python.

I attempted the same fix on this board. The erasing seemed to work fine, I didn't get any errors, and the storage is now empty. Before this command the size reported was 44kb, so the available space did increase slightly to 47kb. But it hasn't increased to the full amount available on the other boards.

I've tried re-flashing circuit python a few times, as well as flashing the arduino uf2 file and then going back to circuit python after that. None of these seemed to have any affect on the file system size.

Is there anything else that I can try in order to restore the filesystem to the full size? If we can't get the board back to the full size is there cause for concern enough to not use the board? If our code can fit on the remaining space would the board be expected to behave normally beyond the filesystem size, or is it likely damaged more trouble than it's worth to attempt to use again?

Thank you

Foamyguy
 
Posts: 11
Joined: Mon May 26, 2014 4:24 pm

Re: Trinket M0 Storage Size

by adafruit_support_carter on Wed Jan 30, 2019 7:39 pm

Seems like generally you are doing things correctly. Were you using the same version of CircuitPython for each when you reflashed them? You can check what the current version is by looking in the file boot_out.txt in the CIRCUITPY folder. See if there is a difference there between the boards that report as different sizes.

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

Re: Trinket M0 Storage Size

by Foamyguy on Thu Jan 31, 2019 11:59 am

The normally working boards that report 59kb total size are on whichever version was loaded out of the box. The boot_out.txt file is always empty on these boards as far as I can tell. If I connect via serial and enter the REPL the boards print "Adafruit CircuitPython 2.0.0 on 2017-09-12;"

The board that is report 47kb that I've reflashed a few times is currently on version 2.3.1 but I have also tried 2.1.0 and 2.2.4. All of them seem to have the same results, the filesystem size does not change.

I did go ahead and try flashing version 2.3.1 to one of the normally working boards and it is still reporting the same 59kb total storage space.

A little more background on the board exhibiting the symptoms:

When we initially deployed the boards we loaded our main.py file, and a libs folder containing the adafruit_hid, adafruit_dotstar, and neopixel libraries to the board. With all of that loaded we were using up about 46kb of space. All of the boards were tested in the final build of the fixture before they left our facility so I know this board was working normally at one time. This board came back to us because it was malfunctioning, upon looking into it I realized the malfunction was caused by main.py throwing an exception due to not finding the libraries we were importing. Looking at the storage on that unit, sure enough the lib folder was gone. In fact everything except main.py and the .Trash-1000 directory was gone. My best guess is that some portion of the storage got corrupted which is leading to the total size being reported smaller, and lead to those other files being deleted or otherwise unusable. The board was initially showing 44kb of total space which is just under the amount that we were using, after I ran the erase_filesystem() function in REPL the first time it bumped up to 47kb which gives us just enough room. Though we don't need the Win7 driver really so we could delete that and have some more overhead.

Is there any other information I can provide diagnostic-wise that could help understand the root cause?

Foamyguy
 
Posts: 11
Joined: Mon May 26, 2014 4:24 pm

Re: Trinket M0 Storage Size

by adafruit_support_carter on Thu Jan 31, 2019 1:42 pm

File system corruption is something we see happen for various reasons. In general, simply reflashing the CP firmware does not fix the file system. Whatever is currently in place for the file system, corrupted or not, is simply used again. So fixing a corrupt file system is a secondary step - which is what you are doing when you run storage.erase_filesystem(). However, if you flash the same version of the CP firmware and then run storage.erase_filesystem() to clean the file system, the boards should all be in the same state at that point.

So just wanted to make sure you were using the same CP version through out. As of right now, 4.x is in beta, so 3.1.2 is your latest release version.

Is there a reason you are still using 2.x?

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

Re: Trinket M0 Storage Size

by Foamyguy on Thu Jan 31, 2019 2:03 pm

I found another board exhibiting similar symptoms.

When I got this one back it was showing 59kb total storage space, but only about 14kb unused storage which is the proper size once our main.py and libraries are loaded onto the board. But when I open the storage the only file present was an empty boot_out.txt, all of the other files were gone.

I flashed Circuit Python 2.3.1 and connected via Serial to enter the REPL and ran the storage.erase_filesystem() command. After running that the board is now reporting 47kb.

On a whim I also grabbed a brand new Trinket M0 that hasn't been used before. I flashed 2.3.1 to it as well and ran the storage.erase_filesystem() command. After doing that this brand new board is reporting 47kb now as well. Based on that I am starting to suspect that having 47kb of storage is not necessarily a "problem", as you noted the space can differ across different versions I assumed 59kb was "correct" because that is how they were out of the box. But those ones out of the box were running 2.0.0 I had to flash them to 2.3.1 in order to use the storage.erase_filesystem() command. So perhaps the "correct" amount of storage for version 2.3.1 is actually 47kb and I just hadn't noticed because I hadn't ever tried a brand new board and flash then erase it before doing anything else.

Is there any place I could look to get confirmation of the "correct" storage size for different versions of Circuit Python?

EDIT:

Re: Is there a reason you are still using 2.x?

There is not a specific reason we are using the 2.x branch. We just used the boards out of the box without updating the firmware because we had so many to set up and our code seemed to work fine on them in the state they were in when we got them. I ended up upgrading to 2.3.1 on these ones because I think I saw reference somewhere online of it being the version where the erase_filesystem() function was added.

Foamyguy
 
Posts: 11
Joined: Mon May 26, 2014 4:24 pm

Re: Trinket M0 Storage Size

by adafruit_support_carter on Thu Jan 31, 2019 2:26 pm

Is there any place I could look to get confirmation of the "correct" storage size for different versions of Circuit Python?

It *might* be in the release notes between the versions:
https://github.com/adafruit/circuitpython/releases
but also might be an under the hood fine tuning detail that wasn't really meant for users to ever have to worry about.

If you're able to, I'd upgrade to the latest version of CP. You might start running into library compatibility issues also trying to maintain 2.x. Unless you've also frozen your library bundles at a certain release.

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

Re: Trinket M0 Storage Size

by HelloPlanet on Sun Jun 16, 2019 1:04 am

Hello Support Team,

I'm having same issue here, i bought trinket M0 from mouser,
when trying things out along the tutorial, I updated it to CiruitPython 4.0.1,
then when putting essential file package to the board, there's not enough space.

I followed various solutions in this post and referred post
viewtopic.php?f=52&t=142951&p=707969&hilit=storage#p707969
and went through troubleshooting page
https://learn.adafruit.com/welcome-to-c ... eshooting#

but my trinket still show a total storage of 47kB.

What i have tried:
update to 4.0.1 and storage.erase_filesystem(),
downgrade to 3.1.2 and storage.erase_filesystem(),
downgrade to 2.3.1 and storage.erase_filesystem(),
it did erase everything, but there's no change in total space.

what i have also tried:
update to 4.0.1 and erase_m0.uf2 then adafruit-circuitpython-trinket_m0-en_US-4.0.1.uf2
same procedure with 3.1.2, 2.3.1.

But there's no luck, either.

Anything i can do to fix this board? Thanks.

HelloPlanet
 
Posts: 4
Joined: Thu Mar 14, 2019 12:27 am

Re: Trinket M0 Storage Size

by adafruit_support_carter on Mon Jun 17, 2019 11:56 am

@HelloPlanet Please start a new thread for your issue.

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

Please be positive and constructive with your questions and comments.