Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Bump to MicroPython v1.20 with new patch. #19

Merged
merged 1 commit into from
May 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 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: 38e7b842c6bc8122753cbf0845eb141f28fbcb72
PIMORONI_PICO_VERSION: v1.19.18
MICROPYTHON_VERSION: v1.20.0
PIMORONI_PICO_VERSION: v1.20.1

jobs:
deps:
Expand Down Expand Up @@ -117,13 +117,18 @@ jobs:
ref: v0.0.1
path: dir2uf2

# HACK: Patch startup overclock into Pico SDK
# HACK: Patch startup overclock into Pico SDK
- name: "HACK: Startup Overclock Patch"
shell: bash
working-directory: micropython/lib/pico-sdk
run: |
git apply "${{env.FIRMWARE_DIR}}/startup_overclock.patch"

- name: "HACK: CMakeLists.txt Disable C++ Exceptions Patch"
shell: bash
working-directory: micropython
run: git apply "${{env.FIRMWARE_DIR}}/micropython_nano_specs.patch"

# Install apt packages
- name: Install CCache & Compiler
shell: bash
Expand Down
4 changes: 3 additions & 1 deletion firmware/PIMORONI_BADGER2040/mpconfigboard.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
set(MICROPY_BOARD PICO)

# Board specific version of the frozen manifest
set(MICROPY_FROZEN_MANIFEST ${CMAKE_CURRENT_LIST_DIR}/manifest.py)
set(MICROPY_FROZEN_MANIFEST ${CMAKE_CURRENT_LIST_DIR}/manifest.py)

set(MICROPY_C_HEAP_SIZE 4096)
4 changes: 3 additions & 1 deletion firmware/PIMORONI_BADGER2040W/mpconfigboard.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ 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)
set(MICROPY_FROZEN_MANIFEST ${CMAKE_CURRENT_LIST_DIR}/manifest.py)

set(MICROPY_C_HEAP_SIZE 4096)
1 change: 1 addition & 0 deletions firmware/PIMORONI_BADGER2040W/mpconfigboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

// Enable networking.
#define MICROPY_PY_NETWORK 1
#define MICROPY_PY_NETWORK_HOSTNAME_DEFAULT "Badger2040W"

// CYW43 driver configuration.
#define CYW43_USE_SPI (1)
Expand Down
20 changes: 20 additions & 0 deletions firmware/micropython_nano_specs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/ports/rp2/CMakeLists.txt b/ports/rp2/CMakeLists.txt
index 094031c6852a..5f268414c08f 100644
--- a/ports/rp2/CMakeLists.txt
+++ b/ports/rp2/CMakeLists.txt
@@ -374,6 +374,15 @@ target_compile_options(${MICROPY_TARGET} PRIVATE
target_link_options(${MICROPY_TARGET} PRIVATE
-Wl,--defsym=__micropy_c_heap_size__=${MICROPY_C_HEAP_SIZE}
)
+# Do not include stack unwinding & exception handling for C++ user modules
+target_compile_definitions(usermod INTERFACE PICO_CXX_ENABLE_EXCEPTIONS=0)
+target_compile_options(usermod INTERFACE $<$<COMPILE_LANGUAGE:CXX>:
+ -fno-exceptions
+ -fno-unwind-tables
+ -fno-rtti
+ -fno-use-cxa-atexit
+>)
+target_link_options(usermod INTERFACE -specs=nano.specs)

set_source_files_properties(
${PICO_SDK_PATH}/src/rp2_common/pico_double/double_math.c