← index #1587PR #867
Off-topic · high · value 0.237
QUERY · ISSUE

stmhal: os.sync() [apparently] doesn't flush FatFS read buffers

openby pfalconopened 2015-11-05updated 2015-11-21
ports

My time to ask dumb questions. I created a new file on pyboard's internal flash over USB mass-storage . Expectedly, it didn't show up. I issued sync on Linux side, it didn't show up. I unmounted filesystem, and it still didn't show up. I issues os.sync() on pyboard, and it still didn't show up. I had to reboot pyboard to get hold of it. I'd say, unmounting mass-storage and os.sync() should be 100% enough.

CANDIDATE · PULL REQUEST

Add ability to set fatfs label & retrieve serial number.

closedby dhylandsopened 2014-09-20updated 2015-11-08

Currently, under ubuntu 14.04 anyways, the internal volume shows up as: /media/dhylands/4421-0003

This PR adds some functions which allow the volume label to be changed. If I put:

import fatfs
fatfs.label('/flash', 'internal')

into boot.py, then the volume will instead show up as /media/dhylands/INTERNAL

Incidently, you can now retrieve the serial numer:

>>> fatfs.serial('/flash')
1143013379
>>> hex(fatfs.serial('/flash'))
'0x44210003'

and we can see that with no label, the serial number formatted as hex is what's used.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied