mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
15 lines
254 B
Python
15 lines
254 B
Python
import vfs
|
|
import machine, rp2
|
|
|
|
|
|
# Try to mount the filesystem, and format the flash if it doesn't exist.
|
|
bdev = rp2.Flash()
|
|
try:
|
|
fs = vfs.VfsFat(bdev)
|
|
except:
|
|
vfs.VfsFat.mkfs(bdev)
|
|
fs = vfs.VfsFat(bdev)
|
|
vfs.mount(fs, "/")
|
|
|
|
del vfs, bdev, fs
|