From 1cf31cbe3bade9d62fe7441a29b8e2cefb37f4da Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Fri, 27 Sep 2024 16:38:34 +0100 Subject: [PATCH 1/6] PWM Cluster: Make GCC 13.x happy. --- drivers/pwm/pwm_cluster.cpp | 4 ++-- drivers/pwm/pwm_cluster.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pwm/pwm_cluster.cpp b/drivers/pwm/pwm_cluster.cpp index 3c6006197..8cf3e19f9 100644 --- a/drivers/pwm/pwm_cluster.cpp +++ b/drivers/pwm/pwm_cluster.cpp @@ -25,10 +25,10 @@ uint8_t PWMCluster::claimed_sms[] = { 0x0, 0x0 }; uint PWMCluster::pio_program_offset = 0; -PWMCluster::PWMCluster(PIO pio, uint sm, uint pin_mask, bool loading_zone) +PWMCluster::PWMCluster(PIO pio, uint sm, uint64_t pin_mask, bool loading_zone) : pio(pio) , sm(sm) -, pin_mask(pin_mask & ((1u << NUM_BANK0_GPIOS) - 1)) +, pin_mask(pin_mask & ((1llu << NUM_BANK0_GPIOS) - 1)) , channel_count(0) , wrap_level(0) , loading_zone(loading_zone) { diff --git a/drivers/pwm/pwm_cluster.hpp b/drivers/pwm/pwm_cluster.hpp index e233551a3..224f974c9 100644 --- a/drivers/pwm/pwm_cluster.hpp +++ b/drivers/pwm/pwm_cluster.hpp @@ -103,7 +103,7 @@ namespace pimoroni { PIO pio; uint sm; int dma_channel; - uint pin_mask; + uint64_t pin_mask; uint8_t channel_count; ChannelState channels[NUM_BANK0_GPIOS]; uint8_t channel_to_pin_map[NUM_BANK0_GPIOS]; @@ -135,7 +135,7 @@ namespace pimoroni { // Constructors/Destructor //-------------------------------------------------- public: - PWMCluster(PIO pio, uint sm, uint pin_mask, bool loading_zone = DEFAULT_USE_LOADING_ZONE); + PWMCluster(PIO pio, uint sm, uint64_t pin_mask, bool loading_zone = DEFAULT_USE_LOADING_ZONE); PWMCluster(PIO pio, uint sm, uint pin_base, uint pin_count, bool loading_zone = DEFAULT_USE_LOADING_ZONE); PWMCluster(PIO pio, uint sm, const uint8_t *pins, uint32_t length, bool loading_zone = DEFAULT_USE_LOADING_ZONE); PWMCluster(PIO pio, uint sm, std::initializer_list pins, bool loading_zone = DEFAULT_USE_LOADING_ZONE); From 3543bab83d09b37f25334846d0d4be57728c398f Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Mon, 12 Aug 2024 14:19:21 +0100 Subject: [PATCH 2/6] pcf85063a: Replace hardware/rtc with pico/types. --- drivers/pcf85063a/pcf85063a.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pcf85063a/pcf85063a.hpp b/drivers/pcf85063a/pcf85063a.hpp index 423ced523..12bf7450b 100644 --- a/drivers/pcf85063a/pcf85063a.hpp +++ b/drivers/pcf85063a/pcf85063a.hpp @@ -1,7 +1,7 @@ #pragma once #include "hardware/i2c.h" -#include "hardware/rtc.h" +#include "pico/types.h" #include "common/pimoroni_common.hpp" #include "common/pimoroni_i2c.hpp" From 0f81e3111bec5d98f7252f4e6a9576bdd38bb841 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Wed, 2 Oct 2024 09:20:38 +0100 Subject: [PATCH 3/6] CI: Bump CI to ubuntu-latest. Ubuntu 20.04 LTS reaches end of life on 23 April 2025. --- .github/workflows/cmake.yml | 2 +- .github/workflows/micropython.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 9c3e3ef12..89e25debc 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -12,7 +12,7 @@ env: jobs: build: name: ${{matrix.name}} (C++) - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: include: diff --git a/.github/workflows/micropython.yml b/.github/workflows/micropython.yml index 4e4ee5adc..b7fa37f38 100644 --- a/.github/workflows/micropython.yml +++ b/.github/workflows/micropython.yml @@ -12,7 +12,7 @@ env: jobs: build: name: ${{ matrix.name }} (${{ matrix.board }}) - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest continue-on-error: true strategy: matrix: From aa34f123a25aab4ea798789d8bf7c17b5911e87e Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Wed, 2 Oct 2024 09:31:37 +0100 Subject: [PATCH 4/6] CI: Bump GCC to 13.3.Rel1. --- .github/workflows/cmake.yml | 8 ++++++-- .github/workflows/micropython.yml | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 89e25debc..d3009c533 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -56,11 +56,15 @@ jobs: path: pico-extras submodules: false # lwip breaks audio submodule fetching + - name: Install Arm GNU Toolchain (arm-none-eabi-gcc) + uses: carlosperate/arm-none-eabi-gcc-action@v1 + with: + release: '13.3.Rel1' + # Linux deps - name: Install deps - if: runner.os == 'Linux' run: | - sudo apt update && sudo apt install ccache gcc-arm-none-eabi + sudo apt update && sudo apt install ccache - name: Create Build Environment run: cmake -E make_directory ${{runner.workspace}}/build diff --git a/.github/workflows/micropython.yml b/.github/workflows/micropython.yml index b7fa37f38..9f9e007cc 100644 --- a/.github/workflows/micropython.yml +++ b/.github/workflows/micropython.yml @@ -71,7 +71,7 @@ jobs: - name: Install Arm GNU Toolchain (arm-none-eabi-gcc) uses: carlosperate/arm-none-eabi-gcc-action@v1 with: - release: '9-2020-q2' + release: '13.3.Rel1' - name: Install CCache run: | From 2f5b47ac12e5d84629a4a47cccc4e75f9698487f Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Wed, 2 Oct 2024 09:55:56 +0100 Subject: [PATCH 5/6] Pico Wireless: Fixup for GCC 13.x. These changes are giving me "how did this ever work?" vibes. --- .../modules/pico_wireless/pico_wireless.cpp | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/micropython/modules/pico_wireless/pico_wireless.cpp b/micropython/modules/pico_wireless/pico_wireless.cpp index ae37dfa1f..574e88b82 100644 --- a/micropython/modules/pico_wireless/pico_wireless.cpp +++ b/micropython/modules/pico_wireless/pico_wireless.cpp @@ -59,15 +59,15 @@ mp_obj_t picowireless_init() { mp_obj_t picowireless_get_network_data() { if(wireless != nullptr) { - uint8_t *ip = nullptr; - uint8_t *mask = nullptr; - uint8_t *gwip = nullptr; - wireless->get_network_data(ip, mask, gwip); + IPAddress ip; + IPAddress mask; + IPAddress gwip; + wireless->get_network_data((uint8_t *)&ip, (uint8_t *)&mask, (uint8_t *)&gwip); mp_obj_t tuple[3]; - tuple[0] = mp_obj_new_bytes(ip, WL_IPV4_LENGTH); - tuple[1] = mp_obj_new_bytes(mask, WL_IPV4_LENGTH); - tuple[2] = mp_obj_new_bytes(gwip, WL_IPV4_LENGTH); + tuple[0] = mp_obj_new_bytes((uint8_t *)&ip, WL_IPV4_LENGTH); + tuple[1] = mp_obj_new_bytes((uint8_t *)&mask, WL_IPV4_LENGTH); + tuple[2] = mp_obj_new_bytes((uint8_t *)&gwip, WL_IPV4_LENGTH); return mp_obj_new_tuple(3, tuple); } else @@ -86,13 +86,13 @@ mp_obj_t picowireless_get_remote_data(size_t n_args, const mp_obj_t *pos_args, m mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)]; mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args); - uint8_t *ip = nullptr; - uint8_t *port = nullptr; - wireless->get_remote_data(args[ARG_sock].u_int, ip, port); + IPAddress ip; + uint16_t port = 0; + wireless->get_remote_data(args[ARG_sock].u_int, (uint8_t *)&ip, (uint8_t *)&port); mp_obj_t tuple[2]; - tuple[0] = mp_obj_new_bytes(ip, WL_IPV4_LENGTH); - tuple[1] = mp_obj_new_int((uint16_t)port[0] << 8 | (uint16_t)port[1]); //TODO verify size and ordering of port + tuple[0] = mp_obj_new_bytes((uint8_t *)&ip, WL_IPV4_LENGTH); + tuple[1] = mp_obj_new_int(port); //TODO verify size and ordering of port return mp_obj_new_tuple(2, tuple); } else From 6376282c473bde6595522cc6d6d9468f7909f348 Mon Sep 17 00:00:00 2001 From: Phil Howard Date: Wed, 2 Oct 2024 10:21:47 +0100 Subject: [PATCH 6/6] MicroPython: Drop Pico Wireless support. With PPP support added to MicroPython this would be better handled by creating a PPP-compatible firmware for Pico Wireless and using the PPP module instead... I think. --- micropython/modules/micropython-pico.cmake | 1 - micropython/modules/micropython-pico2w.cmake | 16 ++++++++++++++++ micropython/modules/micropython-pico_usb.cmake | 1 - .../modules/micropython-picolipo_16mb.cmake | 1 - .../modules/micropython-picolipo_4mb.cmake | 1 - 5 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 micropython/modules/micropython-pico2w.cmake diff --git a/micropython/modules/micropython-pico.cmake b/micropython/modules/micropython-pico.cmake index bae9f9c5b..d0864baf1 100644 --- a/micropython/modules/micropython-pico.cmake +++ b/micropython/modules/micropython-pico.cmake @@ -8,7 +8,6 @@ set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) include(micropython-common) -include(pico_wireless/micropython) # C++ Magic Memory include(cppmem/micropython) diff --git a/micropython/modules/micropython-pico2w.cmake b/micropython/modules/micropython-pico2w.cmake new file mode 100644 index 000000000..d4cb4fb99 --- /dev/null +++ b/micropython/modules/micropython-pico2w.cmake @@ -0,0 +1,16 @@ +include_directories(${CMAKE_CURRENT_LIST_DIR}/../../) + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../") + +set(CMAKE_C_STANDARD 11) +set(CMAKE_CXX_STANDARD 17) + +include(micropython-common) + +# C++ Magic Memory +include(cppmem/micropython) + +# Disable build-busting C++ exceptions +include(micropython-disable-exceptions) diff --git a/micropython/modules/micropython-pico_usb.cmake b/micropython/modules/micropython-pico_usb.cmake index 011b5498b..d4cb4fb99 100644 --- a/micropython/modules/micropython-pico_usb.cmake +++ b/micropython/modules/micropython-pico_usb.cmake @@ -8,7 +8,6 @@ set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) include(micropython-common) -include(pico_wireless/micropython) # C++ Magic Memory include(cppmem/micropython) diff --git a/micropython/modules/micropython-picolipo_16mb.cmake b/micropython/modules/micropython-picolipo_16mb.cmake index 8b6acbf74..49489333e 100644 --- a/micropython/modules/micropython-picolipo_16mb.cmake +++ b/micropython/modules/micropython-picolipo_16mb.cmake @@ -8,7 +8,6 @@ set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) include(micropython-common) -include(pico_wireless/micropython) enable_ulab() diff --git a/micropython/modules/micropython-picolipo_4mb.cmake b/micropython/modules/micropython-picolipo_4mb.cmake index 8b6acbf74..49489333e 100644 --- a/micropython/modules/micropython-picolipo_4mb.cmake +++ b/micropython/modules/micropython-picolipo_4mb.cmake @@ -8,7 +8,6 @@ set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 17) include(micropython-common) -include(pico_wireless/micropython) enable_ulab()