Merge pull request 'micropython: Update to 1.24.1, with cherrypicked patches for pico-sdk 2.1.1' (#11) from micropython-1.24.1-pico-2.1.1 into main
All checks were successful
Build RPi Pico firmware image / Build-Firmware (push) Successful in 2m55s
Check code formatting / Check-C-Format (push) Successful in 7s
Check code formatting / Check-Python-Flake8 (push) Successful in 9s
Check code formatting / Check-Bash-Shellcheck (push) Successful in 4s
Run unit tests on host / Run-Unit-Tests (push) Successful in 8s

Reviewed-on: #11
Reviewed-by: Stefan Kratochwil <kratochwil-la@gmx.de>
This commit was merged in pull request #11.
This commit is contained in:
2025-03-17 20:07:33 +00:00
7 changed files with 36 additions and 4 deletions

View File

@@ -0,0 +1,20 @@
---
name: Build RPi Pico firmware image
on:
push:
jobs:
Build-Firmware:
runs-on: tonberry-build
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Initialize submodules
run: cd software && ./update-submodules.sh
- name: Build
run: cd software && ./build.sh
- name: Upload firmware
uses: actions/upload-artifact@v3
with:
name: firmware-RPi-Pico-W
path: software/lib/micropython/ports/rp2/build-TONBERRY_RPI_PICO_W/firmware.uf2

View File

@@ -0,0 +1,8 @@
# Image: git.ka.blankertz.org/tonberry/tonberry-pico/build:latest
FROM gitea/runner-images:ubuntu-22.04
# Install gcc-arm-none-eabi
RUN apt update && \
DEBIAN_FRONTEND=noninteractive \
apt install -y --no-install-recommends cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib \
&& apt clean && rm -rf /var/lib/apt/lists/*

View File

@@ -17,3 +17,4 @@ set(GEN_PINS_BOARD_CSV "${CMAKE_CURRENT_LIST_DIR}/pins.csv")
set(GEN_PINS_CSV_ARG --board-csv "${GEN_PINS_BOARD_CSV}")
add_link_options("-Wl,--print-memory-usage")
set(PICO_USE_FASTEST_SUPPORTED_CLOCK 1)

View File

@@ -20,6 +20,8 @@
#define MICROPY_HW_PIN_EXT_COUNT CYW43_WL_GPIO_COUNT
#define MICROPY_HW_PIN_RESERVED(i) ((i) == CYW43_PIN_WL_HOST_WAKE || (i) == CYW43_PIN_WL_REG_ON)
// If this returns true for a pin then its irq will not be disabled on a soft reboot
int mp_hal_is_pin_reserved(int n);
#define MICROPY_HW_PIN_RESERVED(i) mp_hal_is_pin_reserved(i)
#define MICROPY_PY_THREAD (0)

View File

@@ -9,6 +9,7 @@
// This module is RP2 specific
#include "mphalport.h"
#include <pico/platform/sections.h>
#include <string.h>
@@ -74,6 +75,7 @@ static mp_obj_t audiocore_Context_put(mp_obj_t self_in, mp_obj_t buffer)
}
static MP_DEFINE_CONST_FUN_OBJ_2(audiocore_Context_put_obj, audiocore_Context_put);
static uint32_t __scratch_y("core1_stack") core1_stack[1024];
static const mp_rom_map_elem_t audiocore_Context_locals_dict_table[] = {
{MP_ROM_QSTR(MP_QSTR___del__), MP_ROM_PTR(&audiocore_Context_deinit_obj)},
{MP_ROM_QSTR(MP_QSTR_deinit), MP_ROM_PTR(&audiocore_Context_deinit_obj)},
@@ -123,7 +125,7 @@ static mp_obj_t audiocore_init(mp_obj_t pin_obj, mp_obj_t sideset_obj, mp_obj_t
shared_context.sideset_base = sideset_pin;
shared_context.samplerate = samplerate;
initialized = true;
multicore_launch_core1(&core1_main);
multicore_launch_core1_with_stack(&core1_main, core1_stack, sizeof(core1_stack));
uint32_t result = multicore_fifo_pop_blocking();
if (result != 0) {
multicore_reset_core1();

View File

@@ -5,4 +5,3 @@ set -eu
git submodule update --init lib
git -C lib/micropython submodule update --init lib/pico-sdk lib/mbedtls lib/micropython-lib lib/tinyusb lib/btstack lib/cyw43-driver lib/lwip
git -C lib/micropython/lib/pico-sdk submodule update --init lib
git -C lib/micropython/lib/pico-sdk/lib/tinyusb submodule update --init hw/mcu/raspberry_pi/Pico-PIO-USB/