Is there a way to mount a USB MSC on a specific FLASH segment? #13489
Replies: 1 comment
-
Hi, I hope the following information are useful to you.
The following operations are going to destroy your data. The approach is simple, since the import os, pyb
os.umount('/flash')
SIZE_IN_KIB = 256
pdata = pyb.Flash(start=0, len=SIZE_IN_KIB *1024)
pcode = pyb.Flash(start=SIZE_IN_KIB *1024)
# Format pdata section to FAT.
os.VfsFat.mkfs(pdata)
# Format pcode section to LittleFS2.
os.VfsLfs2.mkfs(pcode)
# Mount pcode section to /flash.
os.mount(pcode, '/flash')
# Mount pdata section to /data.
os.mount(pdata, '/data')
# This changes the working directory to /flash.
os.chdir('/flash')
Hopefully the comments in the provided code made things a little more clear.
As you can see above, the described behavior can be achieved without editing the If all these were not enough to suit your needs, the LEGO_HUB_NO6 port could be a good case to study on. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I hope you are doing well
*My developement board is STM32 NUCLEO_L476RG.
I have a question of flash parition, my intention is to divide the internal flash memory into two partitions, /flash and /data.
As described in the link below:
https://docs.micropython.org/en/latest/reference/filesystem.html#hybrid-stm32
But my use case is a little different.
The /flash is for python files (eg. boot.py, main.py, etc...) and its filesystem is littlefs
The /data is for log csv file and USB MSC and its filesystem is FAT
So, my questions are
Thanks in advance for your help.
Beta Was this translation helpful? Give feedback.
All reactions