Skip to content

pio.c needs 32u to be changed to NUM_BANK0_GPIOS on line 347 to support RP2350B #2616

@peterk268

Description

@peterk268

Findings found here:
https://picopalgbc.wordpress.com/2025/08/06/97-swap-pclk-and-den-port-code-to-pico-pal/

Line 347 in src/rp2_common/hardware_pio/pio.c currently uses 32u as the check for the gpio pin number threshold but this doesn't support the RP2350B with 48 GPIO so this would return the error code -5 or invalid arg from this line.

invalid_params_if_and_return(PIO, pin >= 32u, PICO_ERROR_INVALID_ARG);

Thus the fixed line is here:
invalid_params_if_and_return(PIO, pin >= NUM_BANK0_GPIOS, PICO_ERROR_INVALID_ARG);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions