cd2223b8fe
- Makefile: update to use new ASF4 files, support frozen manifest, and include source files in upcoming commits - boards/manifest.py: add files to freeze - boards/samd51p19a.ld: add linker script for this MCU - help.c: add custom help text - main.c: execute _boot.py, boot.py and main.py on start-up - modules/_boot.py: startup file to freeze - modutime.c: add gmtime, localtime, mktime, time functions - mpconfigport.h: enabled more features for sys and io and modules - mphalport.h: add mp_hal_pin_xxx macros - mphalport.c: add mp_hal_stdio_poll
18 lines
299 B
Python
18 lines
299 B
Python
import gc
|
|
import uos
|
|
import samd
|
|
|
|
samd.Flash.flash_init()
|
|
bdev = samd.Flash()
|
|
|
|
# Try to mount the filesystem, and format the flash if it doesn't exist.
|
|
try:
|
|
vfs = uos.VfsLfs1(bdev)
|
|
except:
|
|
uos.VfsLfs1.mkfs(bdev)
|
|
vfs = uos.VfsLfs1(bdev)
|
|
uos.mount(vfs, "/")
|
|
|
|
gc.collect()
|
|
del uos, vfs, gc
|