Skip to content

Commit

Permalink
CI: Bump Pimoroni Pico and MicroPython to v1.23.0.
Browse files Browse the repository at this point in the history
Include patch/backport for pins.csv fix.
  • Loading branch information
Gadgetoid committed Jun 19, 2024
1 parent 6a8ffa5 commit ab1d7f9
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 7 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/micropython.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
types: [created]

env:
MICROPYTHON_VERSION: v1.22.2
PIMORONI_PICO_VERSION: v1.22.2-1bitpng
MICROPYTHON_VERSION: v1.23.0
PIMORONI_PICO_VERSION: v1.23.0-1
WORKFLOW_VERSION: v2

jobs:
Expand Down Expand Up @@ -129,7 +129,9 @@ jobs:
- name: "HACK: CMakeLists.txt Disable C++ Exceptions Patch"
shell: bash
working-directory: micropython
run: git apply "${{env.FIRMWARE_DIR}}/micropython_nano_specs.patch"
run: |
git apply "${{env.FIRMWARE_DIR}}/932f76c6ba64c5a3e68de3324556d9979f09303b.patch"
git apply "${{env.FIRMWARE_DIR}}/micropython_nano_specs.patch"
# Install apt packages
- name: Install CCache & Compiler
Expand Down
44 changes: 44 additions & 0 deletions firmware/932f76c6ba64c5a3e68de3324556d9979f09303b.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
From 932f76c6ba64c5a3e68de3324556d9979f09303b Mon Sep 17 00:00:00 2001
From: Phil Howard <phil@gadgetoid.com>
Date: Tue, 27 Feb 2024 10:19:35 +0000
Subject: [PATCH] rp2/CMakeLists: Use MICROPY_BOARD_DIR to find pins.csv.

Assuming that ${MICROPY_PORT_DIR}/boards/${MICROPY_BOARD} is equal to
${MICROPY_BOARD_DIR} is not valid, because the latter could point to a path
outside the main MicroPython repository.

Replace this path with the canonical ${MICROPY_BOARD_DIR} so that pins.csv
is correctly located when building against out-of-tree board definitions.

Additionally remove MICROPY_BOARDS_DIR to discourage similar mistakes.

Signed-off-by: Phil Howard <phil@gadgetoid.com>
---
ports/rp2/CMakeLists.txt | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt
index f86224a5c067..d3ecee586054 100644
--- a/ports/rp2/CMakeLists.txt
+++ b/ports/rp2/CMakeLists.txt
@@ -530,15 +530,14 @@ endforeach()
# Include the main MicroPython cmake rules.
include(${MICROPY_DIR}/py/mkrules.cmake)

-set(MICROPY_BOARDS_DIR "${MICROPY_PORT_DIR}/boards")
-set(GEN_PINS_AF_CSV "${MICROPY_BOARDS_DIR}/rp2_af.csv")
-set(GEN_PINS_PREFIX "${MICROPY_BOARDS_DIR}/rp2_prefix.c")
-set(GEN_PINS_MKPINS "${MICROPY_BOARDS_DIR}/make-pins.py")
+set(GEN_PINS_AF_CSV "${MICROPY_PORT_DIR}/boards/rp2_af.csv")
+set(GEN_PINS_PREFIX "${MICROPY_PORT_DIR}/boards/rp2_prefix.c")
+set(GEN_PINS_MKPINS "${MICROPY_PORT_DIR}/boards/make-pins.py")
set(GEN_PINS_SRC "${CMAKE_BINARY_DIR}/pins_${MICROPY_BOARD}.c")
set(GEN_PINS_HDR "${MICROPY_GENHDR_DIR}/pins.h")

-if(EXISTS "${MICROPY_BOARDS_DIR}/${MICROPY_BOARD}/pins.csv")
- set(GEN_PINS_BOARD_CSV "${MICROPY_BOARDS_DIR}/${MICROPY_BOARD}/pins.csv")
+if(EXISTS "${MICROPY_BOARD_DIR}/pins.csv")
+ set(GEN_PINS_BOARD_CSV "${MICROPY_BOARD_DIR}/pins.csv")
set(GEN_PINS_CSV_ARG --board-csv "${GEN_PINS_BOARD_CSV}")
endif()

8 changes: 4 additions & 4 deletions firmware/micropython_nano_specs.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt
index 281b0c3bc..7e04bb549 100644
index e058c0a..fd97871 100644
--- a/ports/rp2/CMakeLists.txt
+++ b/ports/rp2/CMakeLists.txt
@@ -453,6 +453,16 @@ target_link_options(${MICROPY_TARGET} PRIVATE
@@ -455,6 +455,16 @@ target_link_options(${MICROPY_TARGET} PRIVATE
-Wl,--wrap=dcd_event_handler
)

Expand All @@ -16,6 +16,6 @@ index 281b0c3bc..7e04bb549 100644
+>)
+target_link_options(usermod INTERFACE -specs=nano.specs)
+
# Apply optimisations to performance-critical source code.
set_source_files_properties(
${PICO_SDK_PATH}/src/rp2_common/pico_double/double_math.c
${PICO_SDK_PATH}/src/rp2_common/pico_float/float_math.c
${MICROPY_PY_DIR}/map.c

0 comments on commit ab1d7f9

Please sign in to comment.