mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 19:20:22 +01:00
alif: Add initial port to Alif Ensemble MCUs.
This commit adds the beginning of a new alif port with support for Alif Ensemble MCUs. See https://alifsemi.com/ Supported features of this port added by this commit: - UART REPL. - TinyUSB support, for REPL and MSC. - Octal SPI flash support, for filesystem. - machine.Pin support. General notes about the port: - It uses make, similar to other bare-metal ports here. - The toolchain is the standard arm-none-eabi- toolchain. - Flashing a board can be done using either the built-in serial bootloader, or JLink (both supported here). - There are two required submodules (one for drivers/SDK, one for security tools), both of which are open source and on GitHub. - No special hardware or software is needed for development, just a board connected over USB. OpenMV have generously sponsored the development of this port. Signed-off-by: Damien George <damien@micropython.org> Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
23
ports/alif/modules/_boot.py
Normal file
23
ports/alif/modules/_boot.py
Normal file
@@ -0,0 +1,23 @@
|
||||
import sys, os, alif
|
||||
|
||||
|
||||
bdev = alif.Flash()
|
||||
if hasattr(alif, "usb_msc"):
|
||||
try:
|
||||
# This may fail on VfsFat construction, or mount.
|
||||
os.mount(os.VfsFat(bdev), "/flash")
|
||||
except:
|
||||
os.VfsFat.mkfs(bdev)
|
||||
os.mount(os.VfsFat(bdev), "/flash")
|
||||
else:
|
||||
try:
|
||||
os.mount(os.VfsLfs2(bdev, progsize=256), "/flash")
|
||||
except:
|
||||
os.VfsLfs2.mkfs(bdev, progsize=256)
|
||||
os.mount(os.VfsLfs2(bdev, progsize=256), "/flash")
|
||||
|
||||
sys.path.append("/flash")
|
||||
sys.path.append("/flash/lib")
|
||||
os.chdir("/flash")
|
||||
|
||||
del sys, os, alif, bdev
|
||||
Reference in New Issue
Block a user