├── scripts ├── install_arm.sh ├── rp2 │ ├── pico.sh │ ├── pico_uart_vfat.sh │ ├── adafruit_qtpy_rp2040.sh │ ├── pimoroni_picolipo_4MB.sh │ ├── adafruit_feather_rp2040.sh │ ├── arduino_nano_connect.sh │ ├── pimoroni_picolipo_16MB.sh │ ├── adafruit_itsybitsy_rp2040.sh │ ├── pico_w.sh │ ├── mpconfigport.h.patch.uart_vfat │ ├── pico2.sh │ ├── pico2_w.sh │ └── rp2.sh ├── stm32 │ ├── pybv10.sh │ ├── pybv11.sh │ ├── pybd_sf6.sh │ ├── nucleo_F401RE.sh │ ├── nucleo_L476RG.sh │ └── stm32.sh ├── mimxrt │ ├── teensy41.sh │ └── mimxrt.sh ├── samd │ ├── sparkfun_thing_plus.sh │ └── samd.sh ├── esp32 │ ├── generic-c3.sh │ ├── generic-s2.sh │ ├── generic-s3.sh │ ├── generic.sh │ ├── unicore.sh │ └── esp32.sh ├── install_espidf.sh ├── unix │ └── unix.sh ├── init.sh └── rp2_init.sh ├── .github └── workflows │ ├── template.yml │ └── build.yml ├── LICENSE └── README.md /scripts/install_arm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo apt-get install gcc-arm-none-eabi libnewlib-arm-none-eabi -------------------------------------------------------------------------------- /scripts/rp2/pico.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022-2023 Zoltán Vörös 7 | 8 | source ./scripts/rp2/rp2.sh 9 | 10 | build_rp2 "RPI_PICO" -------------------------------------------------------------------------------- /scripts/stm32/pybv10.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | source ./scripts/stm32/stm32.sh 9 | 10 | build_stm32 "PYBV10" -------------------------------------------------------------------------------- /scripts/stm32/pybv11.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | source ./scripts/stm32/stm32.sh 9 | 10 | build_stm32 "PYBV11" -------------------------------------------------------------------------------- /scripts/mimxrt/teensy41.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2024 Zoltán Vörös 7 | 8 | source ./scripts/mimxrt/mimxrt.sh 9 | 10 | build_mimxrt "TEENSY41" -------------------------------------------------------------------------------- /scripts/rp2/pico_uart_vfat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2023 Zoltán Vörös 7 | 8 | source ./scripts/rp2/rp2.sh 9 | 10 | build_rp2_uart_vfat "RPI_PICO" -------------------------------------------------------------------------------- /scripts/stm32/pybd_sf6.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | 9 | source ./scripts/stm32/stm32.sh 10 | 11 | build_stm32 "PYBD_SF6" -------------------------------------------------------------------------------- /scripts/rp2/adafruit_qtpy_rp2040.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | source ./scripts/rp2/rp2.sh 9 | 10 | build_rp2 "ADAFRUIT_QTPY_RP2040" -------------------------------------------------------------------------------- /scripts/rp2/pimoroni_picolipo_4MB.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | source ./scripts/rp2/rp2.sh 9 | 10 | build_rp2 "PIMORONI_PICOLIPO_4MB" -------------------------------------------------------------------------------- /scripts/stm32/nucleo_F401RE.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | source ./scripts/stm32/stm32.sh 9 | 10 | build_stm32 "NUCLEO_F401RE" 11 | -------------------------------------------------------------------------------- /scripts/stm32/nucleo_L476RG.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | source ./scripts/stm32/stm32.sh 9 | 10 | build_stm32 "NUCLEO_L476RG" 11 | -------------------------------------------------------------------------------- /scripts/rp2/adafruit_feather_rp2040.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | source ./scripts/rp2/rp2.sh 9 | 10 | build_rp2 "ADAFRUIT_FEATHER_RP2040" -------------------------------------------------------------------------------- /scripts/rp2/arduino_nano_connect.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | source ./scripts/rp2/rp2.sh 9 | 10 | build_rp2 "ARDUINO_NANO_RP2040_CONNECT" -------------------------------------------------------------------------------- /scripts/rp2/pimoroni_picolipo_16MB.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | source ./scripts/rp2/rp2.sh 9 | 10 | build_rp2 "PIMORONI_PICOLIPO_16MB" -------------------------------------------------------------------------------- /scripts/rp2/adafruit_itsybitsy_rp2040.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | source ./scripts/rp2/rp2.sh 9 | 10 | build_rp2 "ADAFRUIT_ITSYBITSY_RP2040" -------------------------------------------------------------------------------- /scripts/samd/sparkfun_thing_plus.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2024 Zoltán Vörös 7 | 8 | source ./scripts/samd/samd.sh 9 | 10 | build_samd SPARKFUN_SAMD51_THING_PLUS 11 | -------------------------------------------------------------------------------- /scripts/rp2/pico_w.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | # 2023 Sakari Lukkarinen 8 | 9 | source ./scripts/rp2/rp2.sh 10 | 11 | build_rp2 "RPI_PICO_W" -------------------------------------------------------------------------------- /scripts/esp32/generic-c3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022-2023 Zoltán Vörös 7 | # 2023 Zach Moshe 8 | 9 | source ./scripts/esp32/esp32.sh 10 | 11 | build_esp32 "ESP32_GENERIC_C3" -------------------------------------------------------------------------------- /scripts/esp32/generic-s2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022-2023 Zoltán Vörös 7 | # 2023 Zach Moshe 8 | 9 | source ./scripts/esp32/esp32.sh 10 | 11 | build_esp32 "ESP32_GENERIC_S2" -------------------------------------------------------------------------------- /scripts/esp32/generic-s3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022-2023 Zoltán Vörös 7 | # 2023 Zach Moshe 8 | 9 | source ./scripts/esp32/esp32.sh 10 | 11 | build_esp32 "ESP32_GENERIC_S3" -------------------------------------------------------------------------------- /scripts/esp32/generic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | # 2023 Zach Moshe 8 | # 2023 Ganer 9 | 10 | source ./scripts/esp32/esp32.sh 11 | 12 | build_esp32 "ESP32_GENERIC" 13 | -------------------------------------------------------------------------------- /scripts/rp2/mpconfigport.h.patch.uart_vfat: -------------------------------------------------------------------------------- 1 | // Board and hardware specific configuration 2 | #define MICROPY_HW_BOARD_NAME "Raspberry Pi Pico" 3 | #define MICROPY_HW_FLASH_STORAGE_BYTES (1408 * 1024) 4 | 5 | 6 | // useful if there is no USB 7 | #define MICROPY_HW_ENABLE_UART_REPL (1) 8 | // Enable USB Mass Storage with FatFS filesystem 9 | #define MICROPY_HW_USB_MSC (1) 10 | -------------------------------------------------------------------------------- /scripts/install_espidf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Instructions from: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html 4 | sudo apt-get install git wget flex bison gperf python3 python3-venv cmake ninja-build ccache libffi-dev libssl-dev dfu-util libusb-1.0-0 5 | 6 | pip3 install pyelftools 7 | git clone https://github.com/espressif/esp-idf.git 8 | git -C esp-idf checkout v5.0.4 9 | ./esp-idf/install.sh 10 | 11 | cd esp-idf 12 | ./install.sh all 13 | -------------------------------------------------------------------------------- /scripts/stm32/stm32.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | source ./scripts/init.sh 9 | 10 | build_stm32() { 11 | make ${MAKEOPTS} -C micropython/ports/stm32 BOARD=$1 USER_C_MODULES=../../../ulab all CFLAGS_EXTRA=-DULAB_HASH_STRING=$ulab_hash 12 | copy_files stm32/build-$1/firmware.dfu $1 13 | clean_up stm32 build-$1 14 | } -------------------------------------------------------------------------------- /scripts/mimxrt/mimxrt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2024 Zoltán Vörös 7 | 8 | source ./scripts/init.sh 9 | 10 | build_mimxrt() { 11 | make ${MAKEOPTS} -C micropython/ports/mimxrt BOARD=$1 USER_C_MODULES=../../../ulab all CFLAGS_EXTRA=-DULAB_HASH_STRING=$ulab_hash 12 | copy_files mimxrt/build-$1/firmware.hex $1 13 | clean_up mimxrt build-$1 14 | } -------------------------------------------------------------------------------- /scripts/samd/samd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2024 Zoltán Vörös 7 | 8 | source ./scripts/init.sh 9 | 10 | build_samd() { 11 | make ${MAKEOPTS} -C micropython/ports/samd BOARD=$1 USER_C_MODULES=../../../ulab all CFLAGS_EXTRA="-DULAB_HASH_STRING=$ulab_hash -DULAB_SUPPORTS_COMPLEX=0" 12 | copy_files samd/build-$1/firmware.uf2 $1 13 | clean_up samd build-$1 14 | } -------------------------------------------------------------------------------- /scripts/esp32/unicore.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2023 Zoltán Vörös 7 | 8 | source esp-idf/export.sh 9 | 10 | make ${MAKEOPTS} -C micropython/ports/esp32 BOARD=ESP32_GENERIC BOARD_VARIANT=UNICORE USER_C_MODULES=../../../../ulab/code/micropython.cmake CFLAGS_EXTRA=-DULAB_HASH=$ulab_hash 11 | mv micropython/ports/esp32/build-ESP32_GENERIC-UNICORE/micropython.bin ./artifacts/ESP32_UNICORE.bin 12 | -------------------------------------------------------------------------------- /scripts/unix/unix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | source ./scripts/init.sh 9 | 10 | make ${MAKEOPTS} -C micropython/ports/unix axtls 11 | make ${MAKEOPTS} -C micropython/ports/unix USER_C_MODULES=../../../ulab DEBUG=1 STRIP=: MICROPY_PY_FFI=0 MICROPY_PY_BTREE=0 CFLAGS_EXTRA=-DULAB_HASH=$ulab_hash 12 | 13 | copy_files unix/micropython unix 14 | clean_up unix build-standard -------------------------------------------------------------------------------- /scripts/esp32/esp32.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | # 2023 Zach Moshe 8 | 9 | source ./scripts/init.sh 10 | 11 | build_esp32() { 12 | source esp-idf/export.sh 13 | make ${MAKEOPTS} -C micropython/ports/esp32 BOARD=$1 USER_C_MODULES=../../../../ulab/code/micropython.cmake CFLAGS_EXTRA=-DULAB_HASH=$ulab_hash 14 | copy_files esp32/build-$1/firmware.bin $1 15 | clean_up esp32 build-$1 16 | } 17 | -------------------------------------------------------------------------------- /scripts/rp2/pico2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | # File Author: Jayanth Damodaran Last Modified: Sept. 6, 2025 8 | 9 | source ./scripts/rp2_init.sh 10 | 11 | cd micropython/ports/rp2 12 | make BOARD=RPI_PICO2 submodules 13 | make BOARD=RPI_PICO2 clean 14 | make BOARD=RPI_PICO2 USER_C_MODULES=../../../ulab/code/micropython.cmake 15 | cd ../../.. 16 | 17 | copy_files rp2/build-RPI_PICO2/firmware.uf2 RPI_PICO2 18 | clean_up rp2 build-RPI_PICO2 19 | -------------------------------------------------------------------------------- /scripts/rp2/pico2_w.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | # File Author: Jayanth Damodaran Last Modified: Sept. 6, 2025 8 | 9 | source ./scripts/rp2_init.sh 10 | 11 | cd micropython/ports/rp2 12 | make BOARD=RPI_PICO2_W submodules 13 | make BOARD=RPI_PICO2_W clean 14 | make BOARD=RPI_PICO2_W USER_C_MODULES=../../../ulab/code/micropython.cmake 15 | cd ../../.. 16 | 17 | copy_files rp2/build-RPI_PICO2_W/firmware.uf2 RPI_PICO2_W 18 | clean_up rp2 build-RPI_PICO2_W 19 | -------------------------------------------------------------------------------- /.github/workflows/template.yml: -------------------------------------------------------------------------------- 1 | name: Workflow template 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: 9 | - testing 10 | paths: 11 | - '.github/workflows/*.yml' 12 | - './scripts/*.sh' 13 | 14 | jobs: 15 | build: 16 | runs-on: ubuntu-20.04 17 | steps: 18 | 19 | - name: Get current date 20 | id: date 21 | run: echo "::set-output name=date::$(date +'%Y-%m-%d')" 22 | 23 | - name: Checkout builder 24 | uses: actions/checkout@v1 25 | 26 | - name: Install arm toolchain 27 | run: ./scripts/install_arm.sh 28 | 29 | - name: Install ESP-IDF toolchain 30 | run: ./scripts/install_espidf.sh 31 | 32 | - name: Checkout ulab/micropython 33 | run: ./scripts/init.sh 34 | 35 | - name: Create artifacts directory 36 | run: mkdir ./artifacts 37 | 38 | # this section is only for test purposes 39 | # - name: Compile X_X_X port 40 | # if: always() 41 | # run: ./scripts/x_x_x.sh 42 | 43 | - name: List artifacts directory 44 | run: ls ./artifacts/* -l 45 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Zoltán Vörös 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /scripts/rp2/rp2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022-2023 Zoltán Vörös 7 | 8 | source ./scripts/init.sh 9 | 10 | build_rp2() { 11 | make ${MAKEOPTS} -C ports/rp2 submodules 12 | make ${MAKEOPTS} -C ports/rp2 13 | make ${MAKEOPTS} -C ports/rp2 BOARD=$1 submodules 14 | make ${MAKEOPTS} -C micropython/ports/rp2 BOARD=$1 USER_C_MODULES=../../../ulab/code/micropython.cmake CFLAGS_EXTRA=-DULAB_HASH=$ulab_hash 15 | copy_files rp2/build-$1/firmware.uf2 $1 16 | clean_up rp2 build-$1 17 | } 18 | 19 | build_rp2_uart_vfat() { 20 | # hot-patch the config file here 21 | cp ./scripts/rp2/mpconfigport.h.patch.uart_vfat ./micropython/ports/rp2/boards/RPI_PICO/mpconfigport.h 22 | make ${MAKEOPTS} -C ports/rp2 submodules 23 | make ${MAKEOPTS} -C ports/rp2 24 | make ${MAKEOPTS} -C ports/rp2 BOARD=$1 submodules 25 | make ${MAKEOPTS} -C micropython/ports/rp2 BOARD=$1 USER_C_MODULES=../../../ulab/code/micropython.cmake CFLAGS_EXTRA=-DULAB_HASH=$ulab_hash 26 | copy_files rp2/build-$1/firmware.uf2 "$1"-UART-VFAT 27 | clean_up rp2 build-$1 28 | } 29 | -------------------------------------------------------------------------------- /scripts/init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | 9 | # set-up and housekeeping utilities 10 | 11 | # get the number of processors, so that this might be passed to make 12 | if which nproc > /dev/null; then 13 | MAKEOPTS="-j$(nproc)" 14 | else 15 | MAKEOPTS="-j$(sysctl -n hw.ncpu)" 16 | fi 17 | 18 | 19 | # only check out ulab, if is not availble locally, otherwise, pull 20 | git clone https://github.com/v923z/micropython-ulab ulab || git -C ulab pull 21 | 22 | 23 | # only check out micropython, if it is not available locally, otherwise, pull 24 | git clone https://github.com/micropython/micropython micropython || git -C micropython pull 25 | : ${MICROPYTHON_TAG:=$(git tag --sort -v:refname | grep -v preview | head -n 1)} 26 | # git -C micropython checkout ${MICROPYTHON_TAG} 27 | git -C micropython checkout v1.24.0 28 | 29 | cd micropython 30 | git submodule update --init 31 | cd .. 32 | 33 | 34 | # only check out micropython-lib, if it is not available locally, otherwise, pull 35 | git clone https://github.com/micropython/micropython-lib || git -C micropython-lib pull 36 | 37 | 38 | # create hashes, which will be appended to the output file names 39 | ulab_hash=`cd ulab; git describe --abbrev=8 --always; cd ..` 40 | upython_hash=`cd micropython; git describe --abbrev=8 --always; cd ..` 41 | 42 | # the cross-compiler is required for each build, so we might as well get it over with 43 | make ${MAKEOPTS} -C micropython/mpy-cross 44 | 45 | # choose a delimiter that is not probable to turn up in the description of the file 46 | write_platforms_list() { 47 | if [ -f "platforms.md" ]; then 48 | echo $1"| "$1-$upython_hash-$ulab_hash$ext"| " $2 >> ./platforms.list 49 | echo 50 | fi 51 | } 52 | 53 | # helper function to move the binary file from the build directory a temporary folder (./artifacts) 54 | copy_files() { 55 | if [ -d "./artifacts" ]; then 56 | echo "copying firmware" 57 | stem=`basename $1` 58 | ext=$([[ "$stem" = *.* ]] && echo ".${stem##*.}" || echo '') 59 | mv micropython/ports/$1 ./artifacts/$2$ext 60 | fi 61 | } 62 | 63 | # clean up the build directory, in case another piece of firmware is produced for the same port 64 | # note that the clean-up routine is run only, if the ./artifacts directory exists 65 | clean_up() { 66 | # only remove the artifacts, if they can be saved in the ./artifacts folder 67 | if [ -d "./artifacts" ]; then 68 | echo "running make clean" 69 | make clean -C ./micropython/ports/$1 70 | 71 | # remove the directory explicitly, if make clean didn't get rid of it 72 | echo "removing compilation folder" 73 | rm ./micropython/ports/$1/$2 -rf 74 | fi 75 | } 76 | -------------------------------------------------------------------------------- /scripts/rp2_init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This file is part of the micropython-builder project, 4 | # https://github.com/v923z/micropython-builder 5 | # The MIT License (MIT) 6 | # Copyright (c) 2022 Zoltán Vörös 7 | 8 | # This file is adapted from init.sh 9 | # It is run for the raspberry pico 2 series 10 | # It relies on v1.26.0 of micropython 11 | # Contributed by: Jayanth Damodaran Last Modified: 9/6/25 12 | 13 | # set-up and housekeeping utilities 14 | 15 | # get the number of processors, so that this might be passed to make 16 | if which nproc > /dev/null; then 17 | MAKEOPTS="-j$(nproc)" 18 | else 19 | MAKEOPTS="-j$(sysctl -n hw.ncpu)" 20 | fi 21 | 22 | 23 | # only check out ulab, if is not availble locally, otherwise, pull 24 | git clone https://github.com/v923z/micropython-ulab ulab || git -C ulab pull 25 | 26 | 27 | # only check out micropython, if it is not available locally, otherwise, pull 28 | git clone https://github.com/micropython/micropython micropython || git -C micropython pull 29 | git -C micropython checkout v1.26.0 30 | 31 | cd micropython 32 | git submodule update --init lib/tinyusb 33 | git submodule update --init lib/pico-sdk 34 | cd lib/pico-sdk 35 | git submodule update --init lib/tinyusb 36 | cd ../../.. 37 | 38 | 39 | # only check out micropython-lib, if it is not available locally, otherwise, pull 40 | git clone https://github.com/micropython/micropython-lib || git -C micropython-lib pull 41 | 42 | 43 | # create hashes, which will be appended to the output file names 44 | ulab_hash=`cd ulab; git describe --abbrev=8 --always; cd ..` 45 | upython_hash=`cd micropython; git describe --abbrev=8 --always; cd ..` 46 | 47 | # the cross-compiler is required for each build, so we might as well get it over with 48 | make ${MAKEOPTS} -C micropython/mpy-cross 49 | 50 | # choose a delimiter that is not probable to turn up in the description of the file 51 | write_platforms_list() { 52 | if [ -f "platforms.md" ]; then 53 | echo $1"| "$1-$upython_hash-$ulab_hash$ext"| " $2 >> ./platforms.list 54 | echo 55 | fi 56 | } 57 | 58 | # helper function to move the binary file from the build directory a temporary folder (./artifacts) 59 | copy_files() { 60 | if [ -d "./artifacts" ]; then 61 | echo "copying firmware" 62 | stem=`basename $1` 63 | ext=$([[ "$stem" = *.* ]] && echo ".${stem##*.}" || echo '') 64 | mv micropython/ports/$1 ./artifacts/$2$ext 65 | fi 66 | } 67 | 68 | # clean up the build directory, in case another piece of firmware is produced for the same port 69 | # note that the clean-up routine is run only, if the ./artifacts directory exists 70 | clean_up() { 71 | # only remove the artifacts, if they can be saved in the ./artifacts folder 72 | if [ -d "./artifacts" ]; then 73 | echo "running make clean" 74 | make clean -C ./micropython/ports/$1 75 | 76 | # remove the directory explicitly, if make clean didn't get rid of it 77 | echo "removing compilation folder" 78 | rm ./micropython/ports/$1/$2 -rf 79 | fi 80 | } 81 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build binaries 2 | 3 | on: 4 | schedule: 5 | - cron: "0 3 */2 * *" 6 | push: 7 | branches: 8 | - master 9 | pull_request: 10 | paths: 11 | - '.github/workflows/*.yml' 12 | - './scripts/*.sh' 13 | 14 | jobs: 15 | build: 16 | runs-on: ubuntu-24.04 17 | steps: 18 | 19 | - name: Get current date 20 | id: date 21 | run: echo "::set-output name=date::$(date +'%Y-%m-%d')" 22 | 23 | - name: Checkout builder 24 | uses: actions/checkout@v1 25 | 26 | - name: Install arm toolchain 27 | run: ./scripts/install_arm.sh 28 | 29 | - name: Install ESP-IDF toolchain 30 | run: ./scripts/install_espidf.sh 31 | 32 | - name: Checkout ulab/micropython 33 | run: ./scripts/init.sh 34 | 35 | - name: Create artifacts directory 36 | run: mkdir ./artifacts 37 | 38 | # this section is only for test purposes 39 | # - name: Compile unix port 40 | # if: always() 41 | # # run: ./scripts/unix.sh 42 | 43 | - name: Compile for Adafruit Feather RP2040 44 | if: always() 45 | run: ./scripts/rp2/adafruit_feather_rp2040.sh 46 | 47 | - name: Compile for Adafruit Itsybitsy RP2040 48 | if: always() 49 | run: ./scripts/rp2/adafruit_itsybitsy_rp2040.sh 50 | 51 | - name: Compile for Adafruit QTPY RP2040 52 | if: always() 53 | run: ./scripts/rp2/adafruit_qtpy_rp2040.sh 54 | 55 | - name: Compile for Pimoroni Pico Lipo 4MB 56 | if: always() 57 | run: ./scripts/rp2/pimoroni_picolipo_4MB.sh 58 | 59 | - name: Compile for Pimoroni Pico Lipo 16MB 60 | if: always() 61 | run: ./scripts/rp2/pimoroni_picolipo_16MB.sh 62 | 63 | - name: Compile for raspberry nano 64 | if: always() 65 | run: ./scripts/rp2/arduino_nano_connect.sh 66 | 67 | - name: Compile for raspberry pico 68 | if: always() 69 | run: ./scripts/rp2/pico.sh 70 | 71 | - name: Compile for raspberry pico with UART and VFAT support 72 | if: always() 73 | run: ./scripts/rp2/pico_uart_vfat.sh 74 | 75 | - name: Compile for raspberry pico W 76 | if: always() 77 | run: ./scripts/rp2/pico_w.sh 78 | 79 | - name: Compile for raspberry pico 2 80 | if: always() 81 | run: ./scripts/rp2/pico2.sh 82 | 83 | - name: Compile for raspberry pico 2W 84 | if: always() 85 | run: ./scripts/rp2/pico2_w.sh 86 | 87 | - name: Compile for PYBD_SF6 88 | if: always() 89 | run: ./scripts/stm32/pybd_sf6.sh 90 | 91 | - name: Compile for pybv10 board 92 | if: always() 93 | run: ./scripts/stm32/pybv10.sh 94 | 95 | - name: Compile for pybv11 board 96 | if: always() 97 | run: ./scripts/stm32/pybv11.sh 98 | 99 | - name: Compile for ESP32 GENERIC 100 | if: always() 101 | run: ./scripts/esp32/generic.sh 102 | 103 | - name: Compile for ESP32 GENERIC C3 104 | if: always() 105 | run: ./scripts/esp32/generic-c3.sh 106 | 107 | - name: Compile for ESP32 S2 108 | if: always() 109 | run: ./scripts/esp32/generic-s2.sh 110 | 111 | - name: Compile for ESP32 S3 112 | if: always() 113 | run: ./scripts/esp32/generic-s3.sh 114 | 115 | # Take this out for now 116 | # - name: Compile for ESP32 UNICORE 117 | # if: always() 118 | # run: ./scripts/esp32/unicore.sh 119 | 120 | - name: Compile for Sparkfun SAMD51 Thing Plus 121 | if: always() 122 | run: ./scripts/samd/sparkfun_thing_plus.sh 123 | 124 | - name: Compile for Teensy 41 125 | if: always() 126 | run: ./scripts/mimxrt/teensy41.sh 127 | 128 | - uses: "marvinpinto/action-automatic-releases@latest" 129 | with: 130 | repo_token: "${{ secrets.GITHUB_TOKEN }}" 131 | prerelease: false 132 | automatic_release_tag: "latest" 133 | title: "Release date ${{ steps.date.outputs.date }}" 134 | files: ./artifacts/* 135 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # micropython-builder 2 | 3 | Bleeding edge `micropython` firmware with `ulab` included. 4 | ## Contents 5 | 6 | 1. [Overview](#overview) 7 | 1. [Platforms and firmware](#platforms-and-firmware) 8 | 1. [Compiling locally](#compiling-locally) 9 | 1. [Contributing and issues](#contributing-and-issues) 10 | 1. [Testing the build process on github](#testing-the-build-process-on-github) 11 | 12 | ## Overview 13 | 14 | This project aims to bring [ulab](https://github.com/v923z/micropython-ulab/) 15 | to those microcontrollers that are supported by `micropython`. Every second day, the github CI automatically 16 | clones the latest `micropython`, and `ulab` repositories, compiles the firmware, and uploads the binary files to 17 | [Releases](https://github.com/v923z/micropython-builder/releases). 18 | 19 | The github [workflow file](https://github.com/v923z/micropython-builder/blob/main/.github/workflows/build.yml) 20 | simply calls the platform-specific [build scripts](https://github.com/v923z/micropython-builder/tree/main/scripts) 21 | one after the other, and contains no other steps. This approach results in build steps that can easily be 22 | reproduced on any linux computer. We hope that by offering the community build scripts that are proven 23 | to run on a freshly installed system, we can significantly lower the threshold to firmware customisation. 24 | 25 | [Contents](#contents) 26 | 27 | ## Platforms and firmware 28 | 29 | Unless otherwise specified, firmware is built with default settings (i.e., those given in the `mpconfigboad.h` file), 30 | and with support for 2-dimensional complex arrays. On platforms, where flash size is a concern, the dimensionality 31 | might be reduced, complex support might be switched off, and certain functions might be excluded from the firmware. 32 | Compilation details, pre-processor switches etc., can always be read out of the corresponding build script. Again, 33 | the build scripts are the only place holding information on the binary output. 34 | 35 | Each firmware file is named after the board on which it is supposed to run, and, in addition, the binary contains 36 | the short git hash of `micropython` (in `micropython`'s welcome prompt), and the short git hash of `ulab` 37 | (in the `ulab.__sha__` variable). Hence, it is always possible to determine, 38 | which [micropython](https://github.com/micropython/micropython/commits/master), and 39 | [ulab](https://github.com/v923z/micropython-ulab/commits/master) commits, respectively, are included by looking at the 40 | `micropython` welcome prompt, and then 41 | 42 | ```python 43 | import ulab 44 | ulab.__sha__ 45 | ``` 46 | 47 | [Contents](#contents) 48 | 49 | ## Compiling locally 50 | 51 | If you would like to compile (or customise) the firmware on a local machine, all you have to do is clone this repository 52 | with 53 | 54 | ```bash 55 | git clone https://github.com/v923z/micropython-builder.git 56 | ``` 57 | 58 | then 59 | 60 | ```bash 61 | cd micropython-builder 62 | ``` 63 | 64 | and there run 65 | 66 | ```bash 67 | ./scripts/some_port/some_board.sh 68 | ``` 69 | 70 | The rest is taken care of. 71 | 72 | [Contents](#contents) 73 | 74 | ## Contributing and issues 75 | 76 | If your board is not listed, but you would like to see it here, you can submit a build script by means of a 77 | [pull request](https://github.com/v923z/micropython-builder/pulls). Alternatively, you can open an 78 | [issue](https://github.com/v923z/micropython-builder/issues) with the specifications of your board. Note that, 79 | by definition, only those boards can be included in the CI that are supported by `micropython`. 80 | 81 | Issues concerning `micropython`, or `ulab` themselves should be opened in their respective repositories, i.e., 82 | [micropython issues](https://github.com/micropython/micropython/issues), and 83 | [ulab issues](https://github.com/v923z/micropython-ulab/issues). 84 | 85 | ### Testing the build process on github 86 | 87 | If you have a script that compiles the firmware on the local computer, you can easily test it on github. 88 | All you have to do is fork this repository, and create a branch called `testing` on your copy. In 89 | `.github/workflows/template.yml`, add a section with a link to your script, and create a pull request 90 | against your `master` branch. Make sure you go to the Actions tab and enable workflows including binary 91 | builds first. Otherwise, the job will not automatically trigger when you creat the pull request. Your 92 | script should complete without errors, and at the end of the workflow run, you should see the artifacts 93 | listed. Once you are satisfied with the results, you can modify the `.github/workflows/build.yml` file 94 | to include the new section, and open a pull request against this repository. 95 | 96 | 97 | [Contents](#contents) 98 | --------------------------------------------------------------------------------