circuitpython/ports/alif
Damien George d5ecda05eb ports: Allow MICROPY_PY_MACHINE_I2C_TARGET to be disabled by board cfg.
Signed-off-by: Damien George <damien@micropython.org>
2025-08-07 10:33:26 +10:00
..
boards alif/boards/ALIF_ENSEMBLE: Add board.json and deploy instructions. 2025-06-26 13:25:40 +10:00
lwip_inc alif/lwip_inc: Refactor lwipopts.h to use extmod's common options. 2025-07-17 13:28:24 +10:00
mbedtls alif: Integrate lwIP and mbedTLS. 2025-04-09 00:22:32 +10:00
mcu alif: Support more fine-grained pin alternate function selection. 2025-04-09 00:22:33 +10:00
modules alif/modules: Make HE core set /rom as current dir. 2025-04-09 00:22:32 +10:00
tinyusb_port alif: Support running the port on the HE core. 2025-04-09 00:22:32 +10:00
alif.mk alif/Makefile: Allow specifying a custom build directory. 2025-06-26 14:22:13 +10:00
alif_flash.c alif/alif_flash: Make flash respond to the buffer protocol. 2025-04-09 00:22:32 +10:00
cyw43_configport.h extmod,alif,mimxrt,rp2,stm32: Create common cyw43 driver config header. 2025-05-08 15:32:05 +10:00
cyw43_port_spi.c alif: Support more fine-grained pin alternate function selection. 2025-04-09 00:22:33 +10:00
fatfs_port.c alif: Add initial port to Alif Ensemble MCUs. 2025-04-09 00:22:32 +10:00
irq.h alif/machine_i2c_target: Implement I2CTarget class. 2025-08-01 23:03:17 +10:00
machine_adc.c alif/machine_adc: Add basic ADC support. 2025-04-09 00:22:32 +10:00
machine_i2c.c alif/machine_i2c: Allow changing I2C SCL/SDA pins. 2025-08-01 23:03:17 +10:00
machine_i2c_target.c alif/machine_i2c_target: Implement I2CTarget class. 2025-08-01 23:03:17 +10:00
machine_pin.c alif/machine_pin: Add support for machine.Pin IRQ. 2025-07-03 21:26:27 +10:00
machine_rtc.c alif/machine_rtc: Add basic machine.RTC support. 2025-04-09 00:22:32 +10:00
machine_spi.c alif/machine_spi: Improve transfer function to poll events. 2025-07-03 21:43:10 +10:00
machine_uart.c alif/machine_uart: Add machine.UART peripheral support. 2025-04-09 00:22:32 +10:00
main.c alif/machine_i2c_target: Implement I2CTarget class. 2025-08-01 23:03:17 +10:00
Makefile alif/Makefile: Allow specifying a custom build directory. 2025-06-26 14:22:13 +10:00
modalif.c alif: Support running the port on the HE core. 2025-04-09 00:22:32 +10:00
modalif.h alif: Add initial port to Alif Ensemble MCUs. 2025-04-09 00:22:32 +10:00
modmachine.c all: Rename the "NORETURN" macro to "MP_NORETURN". 2025-05-13 10:36:47 +10:00
modos.c alif/mpconfigport: Enable os.urandom(). 2025-04-09 00:22:32 +10:00
mpbthciport.c alif/mpuart: Enhance UART to support bits/parity/stop and more IRQs. 2025-04-09 00:22:32 +10:00
mpbthciport.h alif: Integrate cyw43 Bluetooth with NimBLE. 2025-04-09 00:22:32 +10:00
mpconfigport.h ports: Allow MICROPY_PY_MACHINE_I2C_TARGET to be disabled by board cfg. 2025-08-07 10:33:26 +10:00
mpconfigport.mk alif: Support running the port on the HE core. 2025-04-09 00:22:32 +10:00
mphalport.c alif: Integrate lwIP and mbedTLS. 2025-04-09 00:22:32 +10:00
mphalport.h alif/machine_pin: Add support for machine.Pin IRQ. 2025-07-03 21:26:27 +10:00
mpmetalport.c alif/mpmetalport: Only notify after metal subsystem is init'd. 2025-04-09 00:22:32 +10:00
mpmetalport.h alif/mpmetalport: Use MHU to notify remote cores. 2025-04-09 00:22:32 +10:00
mpnetworkport.c alif: Integrate cyw43 WLAN driver. 2025-04-09 00:22:32 +10:00
mpnimbleport.c alif: Integrate cyw43 Bluetooth with NimBLE. 2025-04-09 00:22:32 +10:00
mpnimbleport.h alif: Integrate cyw43 Bluetooth with NimBLE. 2025-04-09 00:22:32 +10:00
mpremoteprocport.c alif: Implement Open-AMP port backend. 2025-04-09 00:22:32 +10:00
mpu.c alif/mpu: Add MPU region for OSPI1 XIP memory range. 2025-04-09 00:22:33 +10:00
mpu.h alif/mpu: Add MPU region for OSPI1 XIP memory range. 2025-04-09 00:22:33 +10:00
mpuart.c alif: Support more fine-grained pin alternate function selection. 2025-04-09 00:22:33 +10:00
mpuart.h alif/mpuart: Enhance UART to support bits/parity/stop and more IRQs. 2025-04-09 00:22:32 +10:00
msc_disk.c alif/alif_flash: Distinguish between total flash size and FS size. 2025-04-09 00:22:32 +10:00
nosys_stubs.c alif: Link with libnosys. 2025-04-09 00:22:32 +10:00
ospi_ext.c alif/ospi_flash: Restore XIP settings after erase and write. 2025-04-09 00:22:33 +10:00
ospi_ext.h alif/ospi_flash: Restore XIP settings after erase and write. 2025-04-09 00:22:33 +10:00
ospi_flash.c alif/ospi_flash: Restore XIP settings after erase and write. 2025-04-09 00:22:33 +10:00
ospi_flash.h alif/ospi_flash: Add 16-bit words swap flash setting. 2025-04-09 00:22:32 +10:00
ospi_flash_settings.h alif/ospi_flash_settings: Use 8-bit DFS for XIP. 2025-04-09 00:22:33 +10:00
pendsv.c alif: Add initial port to Alif Ensemble MCUs. 2025-04-09 00:22:32 +10:00
pendsv.h alif: Integrate cyw43 WLAN driver. 2025-04-09 00:22:32 +10:00
qstrdefsport.h alif: Add initial port to Alif Ensemble MCUs. 2025-04-09 00:22:32 +10:00
README.md alif/README: Update README with build instructions. 2025-06-26 13:28:18 +10:00
se_services.c alif/se_services: Add a secondary MHU channel. 2025-04-09 00:22:32 +10:00
se_services.h alif/se_services: Add a secondary MHU channel. 2025-04-09 00:22:32 +10:00
system_tick.c alif/system_tick: Implement optional ARM SysTick support for systick. 2025-04-09 00:22:32 +10:00
system_tick.h alif/system_tick: Implement optional ARM SysTick support for systick. 2025-04-09 00:22:32 +10:00
usbd.c alif/se_services: Use EUI extension for unique id. 2025-04-09 00:22:32 +10:00
vfs_rom_ioctl.c alif/vfs_rom_ioctl: Add vfs_rom_ioctl with support for OSPI and MRAM. 2025-04-09 00:22:32 +10:00

MicroPython port to Alif Ensemble MCUs

This is a port of MicroPython to the Alif Ensemble series of microcontrollers.

Initial development of this Alif port was sponsored by OpenMV LLC.

Features currently supported:

  • UART REPL.
  • TinyUSB with CDC and MSC device support.
  • Octal SPI flash with XIP mode.
  • machine.Pin support with named pins.
  • machine.UART, machine.SPI, machine.I2C, machine.RTC peripherals.
  • WiFi and Bluetooth using cyw43.
  • Dual core support of the HE and HP cores using Open-AMP.
  • Low power modes.

The following more advanced features will follow later:

  • Ethernet support.
  • SDRAM support.
  • Other machine modules.

Build instructions

Before building the firmware for a given board the MicroPython cross-compiler must be built; it will be used to pre-compile some of the built-in scripts to bytecode. The cross-compiler is built and run on the host machine, using:

$ make -C mpy-cross

This command should be executed from the root directory of this repository. All other commands below should be executed from the ports/alif/ directory.

An ARM compiler is required for the build, along with the associated binary utilities. The recommended toolchain version to use with this port is Arm GNU toolchain version 13.3.Rel1. The compiler can be changed using the CROSS_COMPILE variable when invoking make.

Next, the board to build must be selected. The default board is ALIF_ENSEMBLE but any of the names of the subdirectories in the boards/ directory is valid. The board name must be passed as the argument to BOARD= when invoking make.

All boards require certain submodules to be obtained before they can be built. The correct set of submodules can be initialised using (with ALIF_ENSEMBLE as an example of the selected board):

make BOARD=ALIF_ENSEMBLE submodules

Then to build the board's firmware run:

make BOARD=ALIF_ENSEMBLE

The above command should produce binary images in the build-ALIF_ENSEMBLE/ subdirectory (or the equivalent directory for the board specified).

Update the SE Firmware

The SE firmware must be updated before flashing the main firmware to match the version used by MicroPython. This step only needs to be performed once. Connect the board to your PC via the SE UART USB port (on the Ensemble kit, this is labeled PRG USB), then run:

make update-system-package

Note: The board must be power-cycled after this step.

Deploy MicroPython

To flash the firmware, run:

make BOARD=ALIF_ENSEMBLE deploy