forked from micropython/micropython
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Description
CircuitPython version and board name
Adafruit CircuitPython 10.0.0-beta.3-8-ga96f1123d9 on 2025-09-06; Pimoroni PGA2350 with rp2350bCode/REPL
import board
import adafruit_pio_uart
adafruit_pio_uart.UART(board.GP32, board.GP33, 9600, 8, None, 1, 1, board.GP34, board.GP35)Behavior
ValueError: program[6] waits on input outside of count
Description
Tried various combinations, then tried a modified pin finder for PIO UART, which found no valid combinations of 4 pins (or even 2 pins) >= GP32.
Additional information
Supermath101 suggested on Discord it may be due to inconsistent references to pin numbering in this code:
circuitpython/ports/raspberrypi/common-hal/rp2pio/StateMachine.c
Lines 527 to 537 in a96f112
| uint16_t wait_index = (full_instruction & 0x001f) + state->inputs.pio_gpio_offset; | |
| if (wait_source == 0 && !PIO_PINMASK_IS_SET(state->inputs.pins_we_use, wait_index)) { // GPIO | |
| mp_raise_ValueError_varg(MP_ERROR_TEXT("%q[%u] uses extra pin"), what_program, i); | |
| } else if (wait_source == 1) { // Input pin | |
| if (!state->inputs.has_in_pin) { | |
| mp_raise_ValueError_varg(MP_ERROR_TEXT("Missing first_in_pin. %q[%u] waits based on pin"), what_program, i); | |
| } | |
| if (wait_index >= state->inputs.in_pin_count) { | |
| mp_raise_ValueError_varg(MP_ERROR_TEXT("%q[%u] waits on input outside of count"), what_program, i); | |
| } | |
| } |