Skip to content

Commit

Permalink
Badger2040W: Bluetooth support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gadgetoid committed Jun 21, 2023
1 parent 5d3b139 commit 92bc7c0
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 24 deletions.
30 changes: 16 additions & 14 deletions .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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'
Expand Down Expand Up @@ -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:
Expand Down
10 changes: 7 additions & 3 deletions firmware/PIMORONI_BADGER2040W/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
11 changes: 8 additions & 3 deletions firmware/PIMORONI_BADGER2040W/mpconfigboard.cmake
Original file line number Diff line number Diff line change
@@ -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)
# Board specific version of the frozen manifest
set(MICROPY_FROZEN_MANIFEST ${CMAKE_CURRENT_LIST_DIR}/manifest.py)
8 changes: 4 additions & 4 deletions firmware/startup_overclock.patch
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 92bc7c0

Please sign in to comment.