Skip to content

zephyr-cp: restore fixed board buses on non-nRF boards - #11638

Merged
tannewt merged 1 commit into
adafruit:mainfrom
dhalbert:zephyr-cp-static-board-buses
Oct 20, 2026
Merged

tannewt merged 1 commit into
adafruit:mainfrom
dhalbert:zephyr-cp-static-board-buses

Conversation

@dhalbert

@dhalbert dhalbert commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Note by Claude, clarified by @dhalbert.

Problem first found on Feather RP2040 while trying to add board.STEMMA_I2C().

Same fix as #11619, which was closed by mistake as superseded by #11576. #11576 checks for CONFIG_PINCTRL_NRF before using iobroker for board buses, but it still marks bus instances as routable on every SoC, and the fixed board objects skip routable instances.

Problem

On non-nRF boards that use pinctrl, board has no I2C(), SPI() or UART(). Their pinctrl states have no nRF psels, so the "all psels disconnected" test passes on the empty list, and every bus instance is treated as routable by iobroker. The buses went missing after #11420.

Fix

Look for routable bus instances only when CONFIG_PINCTRL_NRF is set, as the iobroker pool tables already do.

Testing

  • Feather RP2040, main before and after zephyr-cp: dynamic buses on the Feather nRF52840 boards #11576 (S3 builds 6cda07f and 246a7ab): no bus objects in board.
  • Feather RP2040 with this fix: board.I2C() and board.SPI() are back. (Tested together with an upcoming STEMMA_I2C change.)
  • make test: cptools tests 71 passed; native_sim and bsim tests 516 passed, 3 skipped.
  • CLUE (dynamic buses), to check nRF boards are unchanged: board.I2C() scan with a second busio.I2C on other pins at the same time, board.SPI(), board.UART() and a busio.UART on other pins, each re-created after deinit().

There is no board.UART(), because uart0 is the console. We'll fix that when the console UART becomes optional on RP2xxx, as it is on the nRF Feathers.

Only nRF SoCs have iobroker routing. On other SoCs the pinctrl states
have no nRF psels, and the "all psels disconnected" test passed on the
empty list. So every bus on those boards was treated as dynamically
routable and left out of board, while busio could not route it either.

Look for routable buses only when CONFIG_PINCTRL_NRF is set, as the
iobroker pool tables already do. Non-nRF boards get their devicetree
buses back as board objects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@tannewt tannewt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt
tannewt merged commit fb02181 into adafruit:main Oct 20, 2026
47 checks passed
@dhalbert
dhalbert deleted the zephyr-cp-static-board-buses branch October 20, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants