littlefs on V1.15

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
bradstew
Posts: 41
Joined: Thu Nov 29, 2018 9:29 pm

littlefs on V1.15

Post by bradstew » Thu May 27, 2021 2:47 am

I am testing out V1.15 on a Pyboard.
I was able to partition the disk space into a FAT and littleFS sections using this code.
import os, pyb
os.umount('/flash')
p1 = pyb.Flash(start=0, len=40*1024)
p2 = pyb.Flash(start=40*1024)
os.VfsFat.mkfs(p1)
os.VfsLfs2.mkfs(p2)
os.mount(p1, '/flash')
os.mount(p2, '/data')
os.chdir('/flash')
boot.py looks like this
import os, pyb
p2 = pyb.Flash(start=40*1024)
os.mount(p2, '/data')
looking at the status of each partition returns this
>>> os.listdir('/')
['flash', 'data']
>>> os.statvfs('/data')
(512, 512, 144, 142, 142, 0, 0, 0, 0, 255)
>>> os.statvfs('/flash')
(512, 512, 46, 42, 42, 0, 0, 0, 0, 255)
>>>
Now here is my question:
the FAT system in windows shows the size as 23KB--about 1/2 of what I expected (40*1024 in the code above).
However, the statvfs returns values that are pretty much what Windows reports.

So why the discrepancy?

Everything else works as expected. I can read and write to both partitions.

Post Reply