-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
ports/rp2: Add a means to set mass-storage filesystem label #13470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Code size report:
|
b13e701
to
5131dbd
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #13470 +/- ##
==========================================
- Coverage 98.56% 98.56% -0.01%
==========================================
Files 169 169
Lines 21948 21949 +1
==========================================
Hits 21633 21633
- Misses 315 316 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I'm not sure that this is the best way to do it, because it adds a method, code size, and differs to other Vfs filesystems that don't support a label. How about instead copy the way the stm32 port does it, have a |
As it stands, you're probably right and I'll refactor this PR to fix the omission without addressing our specific use-case- I've got a fork with some minimal changes that allow USB Mass Storage mode builds to expose two filesystems (currently hard-coded, but then the whole USB MSC thing is a bit of an exception to the do-everything-USB-in-Python goal at the moment). In our - admittedly quite contrived - demo case, these two filesystems have distinct labels. The conceit is that we can have one filesystem that's writable from MicroPython, and one that's writeable from the host and use the formere as a means to support logging, saves, config changes and so forth while code is written into the latter from the host. Of course this is all highly experimental but it works and suggests there might be scope for some more esoteric FAT/MSC builds if we find the experience... tolerable. I am keenly aware of all the problems with filesystem syncing across multiple hosts from my tinkering with PiratePython (a CPython RAMdisk for Pi Zero). It might be that MicroPython is unconcerned with the slippery slope that is FAT/MSC and the answer is for us to build our own C module to implement this functionality (ala the Factory Reset style of some ports). I'm happy with that. (on the off chance anyone wants to replicate this dual FS weirdness, diff here - master...pimoroni:micropython:feature/multi-msc) |
This comment was marked as outdated.
This comment was marked as outdated.
5131dbd
to
330843c
Compare
Signed-off-by: Phil Howard <[email protected]>
Set the USB mass storage label when the filesystem is created. Signed-off-by: Phil Howard <[email protected]>
330843c
to
f8b35df
Compare
I have rebased/pushed this because I'm experimenting with FAT again. I believe the multiple-filesystems issue still presides, since as of 6aa3c94 you can select a portion of RP2s flash on which to create a filesystem, and potentially create as many filesystems as you like. That makes use of Perhaps a Edit: I should note that my current focus is on a single filesystem with a boot-time switch to select between mass-storage and runtime modes, avoiding any read/write conflicts between the host and device. So the |
This addresses discussion over at https://github.com/orgs/micropython/discussions/9590
For other boards which more conventionally use MSC, they call
f_setlabel
from the factory reset code paths in C, eg:micropython/ports/renesas-ra/factoryreset.c
Line 88 in 16c6bc4
The C method uses
MICROPY_HW_FLASH_FS_LABEL
, but I wasn't sure by what means we could incorporate that into RP2's Python filesystem bootstrapping. Perhaps callingvfs.label()
without an argument could use this as the default value?