diff --git a/.github/workflows/micropython.yml b/.github/workflows/micropython.yml index fffe67b..937040a 100644 --- a/.github/workflows/micropython.yml +++ b/.github/workflows/micropython.yml @@ -7,8 +7,9 @@ on: types: [created] env: - MICROPYTHON_VERSION: v1.20.0 - PIMORONI_PICO_VERSION: v1.20.1 + MICROPYTHON_VERSION: 856e08b1931b88271816a2f60648f6ff332235b2 + PIMORONI_PICO_VERSION: v1.20.3 + WORKFLOW_VERSION: v2 jobs: deps: @@ -20,9 +21,9 @@ jobs: uses: actions/cache@v3 with: path: ${{runner.workspace}} - key: workspace-micropython-${{env.MICROPYTHON_VERSION}} + key: workspace-micropython-${{env.MICROPYTHON_VERSION}}-${{env.WORKFLOW_VERSION}} restore-keys: | - workspace-micropython-${{env.MICROPYTHON_VERSION}} + workspace-micropython-${{env.MICROPYTHON_VERSION}}-${{env.WORKFLOW_VERSION}} # Check out MicroPython - name: Checkout MicroPython @@ -34,17 +35,18 @@ jobs: submodules: false # MicroPython submodules are hideously broken path: micropython - - name: Fetch base MicroPython submodules + - name: Fetch Pico submodules if: steps.cache.outputs.cache-hit != 'true' shell: bash working-directory: micropython - run: git submodule update --init - - - name: Fetch Pico SDK submodules - if: steps.cache.outputs.cache-hit != 'true' - shell: bash - working-directory: micropython/lib/pico-sdk - run: git submodule update --init + run: | + git submodule update --init lib/pico-sdk + git submodule update --init lib/cyw43-driver + git submodule update --init lib/lwip + git submodule update --init lib/mbedtls + git submodule update --init lib/micropython-lib + git submodule update --init lib/tinyusb + git submodule update --init lib/btstack - name: Build mpy-cross if: steps.cache.outputs.cache-hit != 'true' @@ -93,9 +95,9 @@ jobs: uses: actions/cache@v3 with: path: ${{runner.workspace}} - key: workspace-micropython-${{env.MICROPYTHON_VERSION}} + key: workspace-micropython-${{env.MICROPYTHON_VERSION}}-${{env.WORKFLOW_VERSION}} restore-keys: | - workspace-micropython-${{env.MICROPYTHON_VERSION}} + workspace-micropython-${{env.MICROPYTHON_VERSION}}-${{env.WORKFLOW_VERSION}} - uses: actions/checkout@v3 with: diff --git a/firmware/PIMORONI_BADGER2040W/manifest.py b/firmware/PIMORONI_BADGER2040W/manifest.py index cda46a0..566c9d3 100644 --- a/firmware/PIMORONI_BADGER2040W/manifest.py +++ b/firmware/PIMORONI_BADGER2040W/manifest.py @@ -2,8 +2,12 @@ freeze("lib/") -require("mip") -require("ntptime") -require("urequests") +# mip, ntptime, urequests, webrepl etc - see: +# https://github.com/micropython/micropython-lib/blob/master/micropython/bundles/bundle-networking/manifest.py +require("bundle-networking") + +# Bluetooth +require("aioble") + require("urllib.urequest") require("umqtt.simple") \ No newline at end of file diff --git a/firmware/PIMORONI_BADGER2040W/mpconfigboard.cmake b/firmware/PIMORONI_BADGER2040W/mpconfigboard.cmake index d783024..10613dd 100644 --- a/firmware/PIMORONI_BADGER2040W/mpconfigboard.cmake +++ b/firmware/PIMORONI_BADGER2040W/mpconfigboard.cmake @@ -1,10 +1,15 @@ # cmake file for Pimoroni Badger 2040W set(MICROPY_BOARD PICO_W) +set(MICROPY_C_HEAP_SIZE 4096) + set(MICROPY_PY_LWIP ON) set(MICROPY_PY_NETWORK_CYW43 ON) -# Board specific version of the frozen manifest -set(MICROPY_FROZEN_MANIFEST ${CMAKE_CURRENT_LIST_DIR}/manifest.py) +# Bluetooth +set(MICROPY_PY_BLUETOOTH ON) +set(MICROPY_BLUETOOTH_BTSTACK ON) +set(MICROPY_PY_BLUETOOTH_CYW43 ON) -set(MICROPY_C_HEAP_SIZE 4096) \ No newline at end of file +# Board specific version of the frozen manifest +set(MICROPY_FROZEN_MANIFEST ${CMAKE_CURRENT_LIST_DIR}/manifest.py) \ No newline at end of file diff --git a/firmware/startup_overclock.patch b/firmware/startup_overclock.patch index 0d88477..5f80bd3 100644 --- a/firmware/startup_overclock.patch +++ b/firmware/startup_overclock.patch @@ -1,17 +1,17 @@ diff --git a/src/rp2_common/pico_standard_link/crt0.S b/src/rp2_common/pico_standard_link/crt0.S -index d061108..864d31f 100644 +index 7d29f76..3baa997 100644 --- a/src/rp2_common/pico_standard_link/crt0.S +++ b/src/rp2_common/pico_standard_link/crt0.S -@@ -10,6 +10,8 @@ +@@ -11,6 +11,8 @@ + #include "hardware/regs/addressmap.h" #include "hardware/regs/sio.h" - #include "pico/asm_helper.S" #include "pico/binary_info/defs.h" +#include "hardware/regs/resets.h" +#include "hardware/regs/rosc.h" #ifdef NDEBUG #ifndef COLLAPSE_IRQS -@@ -226,6 +228,12 @@ _reset_handler: +@@ -225,6 +227,12 @@ _reset_handler: cmp r0, #0 bne hold_non_core0_in_bootrom