Two partitions 'vfs' in Micropython #16597
Unanswered
Pawelinode
asked this question in
ESP32
Replies: 1 comment
-
My partitions-4MiB.csv is below:
I have a partition named "vfs" which will make my life easier when working with MicroPython environment. Now I ran this script only once after firmware update. from esp32 import Partition
import vfs, os
print('Warning: run this script only once, after firmware upgrade')
bdev2 = Partition.find(Partition.TYPE_DATA, label="vfs2")[0]
vfs.VfsLfs2.mkfs(bdev2)
fs2 = vfs.VfsLfs2(bdev2)
vfs.mount(fs2, "/fs2")
print(os.listdir('/'))
os.statvfs('/fs2')
print('Done!') I need this boot.py script to mount "/fs2" every time I reboot. from esp32 import Partition
import vfs, os
bdev2 = Partition.find(Partition.TYPE_DATA, label="vfs2")[0]
vfs.mount(bdev2, "/fs2")
print(os.listdir('/fs2')) The easiest way to do this is to use mpremote. Say you have a mount script called "mountfs2.py". Suppose you have "mpr" as an alias to "mpremote" and your board is connected to /dev/ttyUSB1.
This will make the boot.py and this will mount "/fs2" on reboot. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I compiled a Micropytho 1.23 image for ESP32 with two 'vfs' partitions differing only in their flash address. I can read their parameters:
I can mount the first one:
The same code for the second one throws an error: OSError: [Errno 19] ENODEV
Can you use two partitions in Micropython?
Beta Was this translation helpful? Give feedback.
All reactions