Skip to content

broken build: rp2040 — pio_program::used_gpio_ranges gated on wrong macro (PICO_SDK_VERSION_MAJOR instead of PICO_PIO_VERSION) #2792

Closed

Description

@zackees

Summary

The rp2040 workflow (build_rp2040.yml) is failing on master. Confirmed on CI run https://github.com/FastLED/FastLED/actions/runs/27006203220.

Next group from the README badge sweep after AVR (#2779/#2780), STM32 GIGA (#2784/#2785), and Apollo3 (#2787/#2788).

Failure

src/platforms/arm/rp/rpcommon/pio_gen.h:57:5: error:
  'pio_program' has no non-static data member named 'used_gpio_ranges'

(build_rp2350.yml and build_rp2350B.yml are green — the bug is RP2040-specific.)

Root cause

In src/platforms/arm/rp/rpcommon/pio_gen.h, the pio_program initializer guards both pio_version and used_gpio_ranges behind a single check (see issue #2727 follow-up):

#if defined(PICO_SDK_VERSION_MAJOR) && PICO_SDK_VERSION_MAJOR >= 2
    .pio_version = 0,
    .used_gpio_ranges = 0,
#endif

But in the arduino-pico v4.5.3 bundled pico-sdk 2.1.2, used_gpio_ranges is conditional on a different macro — PICO_PIO_VERSION > 0 — which is set per-chip, not per-SDK:

// pico-sdk/src/rp2_common/hardware_pio/include/hardware/pio.h
typedef struct pio_program {
    const uint16_t *instructions;
    uint8_t length;
    int8_t origin;
    uint8_t pio_version;
#if PICO_PIO_VERSION > 0
    uint8_t used_gpio_ranges;
#endif
} pio_program_t;

PICO_PIO_VERSION is 0 on RP2040 and 1 on RP2350. So on RP2040 the field is genuinely absent at compile time, even though the SDK is 2.x. RP2350 builds happen to work because the field is present there.

Fix

Split the guard so each field is gated by its own correct condition:

#if defined(PICO_SDK_VERSION_MAJOR) && PICO_SDK_VERSION_MAJOR >= 2
    .pio_version = 0,
    #if defined(PICO_PIO_VERSION) && PICO_PIO_VERSION > 0
        .used_gpio_ranges = 0,
    #endif
#endif

Acceptance criteria

  • build_rp2040.yml goes green on master
  • build_rp2350.yml and build_rp2350B.yml (which were green) stay green
  • bash compile rp2040 passes when local toolchain cache is intact

Out of scope

  • Other red badges: check_esp32_size, check_teensy41_size, uno AVR8JS Test, unit tests windows. Filed separately.

Filed via /loop README badge sweep.

Activity

  1. added a commit that references this issue on Jun 5, 2026
    0796395
  2. moved this from Triage to Done in FastLED Trackeron Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions