Pico Lipo Micropython file system size

Hi all,

Using both the Pi Pico Micropython image (v1.15) or the Pimoroni Pico v0.2.2 uf2 I can only see about 1.3 MB of virtual file system whereas with 16 MB of flash I’d expect way more than that. I’m logging hex data at ~ 500 Hz and it’s filling up fast! Any suggestions?

Many thanks,

Nick

I agree.

import gc
print(gc.mem_free())

gives:

%Run -c $EDITOR_CONTENT
187856

With standard or Lipo Pico using the larger Pimoroni UF2 on both

print(gc.mem_free())

Doesn’t gc relate to RAM rather than space on the SPI flash?

@JockNines How are you measuring the file system space? Oddly with my Pico LiPo, when I install CircuitPython Windows reports 14.9MB of space, while with the Pimoroni or official MicroPython firmware it reports 127MB. Not quite sure what the deal is with that. I’m not sure how the MicroPython firmware works but it hides files a lot, if you create them using:

with open ("textfile.txt", "w") as file:
    file.write("Hello world!")

And then use:

import os
os.listdir()

It’ll list the file, even though the file doesn’t show up in Explorer. I can only assume that MicroPython is set up by default to only present a small part of the filesystem rather than the whole thing like CircuitPython does.

While we wait for this to be sorted out those wanting high capacity, but at slower speed, could use an SD card adapter wired directly to the Pico

image

I’ve explained how to do it at the end of this review:
Raspberry Pi Pico - Review | element14 | RoadTests & Reviews

Simple and cheap.

image

Adaptor Pin Name Pico GPIO
1 CS - Chip Select 9
2 MOSI - Master Out Slave In 11
3 GND GND
4 VCC 3V3
5 SCK – SPI Clock 10
6 GND GND
7 MISI – Master In Slave Out 12
8 Not Used
9 Not used

Thanks both. I like the SD card idea even though the application is both mass- and write-speed-sensitive.

I used os.statvfs() to establish the file system size - see snippet below and here.

This suggests there is about 164 kB of free RAM, which isn’t the issue, but also that the file system is only 1408 kB where I’d expect it to be roughly ten times that with the specified 16 MB of flash.

Maybe CircuitPython or mangling my own uf2 image are options, but does anyone know if there are changes in the works for the Pimoroni uf2 here?

Thanks again,

Jock