Skip to content

zephyr-cp: add ItsyBitsy nRF52840 - #11612

Open
dhalbert wants to merge 3 commits into
adafruit:mainfrom
dhalbert:zephyr-cp-itsybitsy-nrf52840
Open

dhalbert wants to merge 3 commits into
adafruit:mainfrom
dhalbert:zephyr-cp-itsybitsy-nrf52840

Conversation

@dhalbert

@dhalbert dhalbert commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

PR note written by @dhalbert; code and tests by Claude, guided by me.

The CLUE changes that were here moved into #11576, and the adaboot update is no longer needed: main already has a newer adaboot that includes adafruit/adaboot#8, which added the ItsyBitsy.

  • The upstream zephyr ItsyBitsy board definition set QSPI to run at 32 MHz. That didn't work, so it was set to 16 MHz. We already went through this years ago in Don't check for corrupt heap too early; Fix QSPI timing #1418. But 32 MHz might be possible: see See if nordic QSPI can run at 32 MHz #11611.
  • It's a blue LED not a red one, despite what the upstream board def says, so that was changed.
  • Added support in circuitpython.toml for APA102/DotStar status LED.
  • The upstream board has no header connector, so this adds an adafruit-itsybitsy-header connector: a binding in dts/bindings, a node in the board overlay, and a CONNECTORS entry in zephyr2cp.py. It names the header pins, including the standard pins for board.I2C(), board.SPI() and board.UART(). It covers only the ItsyBitsy nRF52840's pins for now; the other ItsyBitsy boards have extra pins such as D3 and D4 (see the TODO).
  • Sorted the CONNECTORS entries alphabetically, in a separate commit. Will make future additions easier and the code easier to read.

Testing

On an ItsyBitsy nRF52840:

  • I2C: read an SHT40 with board.I2C(), before and after deinit().
  • SPI: board.SPI() MOSI-MISO loopback, 250 kHz to 16 MHz. 32 MHz fails, as on the Feather nRF52840 in both ports (MISO sample delay).
  • UART: board.UART() TX-RX loopback at 9600 and 115200 baud.

@dhalbert
dhalbert requested a review from tannewt October 16, 2026 16:43
@mikeysklar

Copy link
Copy Markdown
Collaborator

Tested on CLUE and ItsyBitsy nRF52840.

Works: buses, CIRCUITPY read/write, CLUE display and all 5 sensors.

Doesn't work: on CLUE, busio.UART(TX, RX) fails once board.UART() has been used. Same UART bug as #11576. CLUE only has one UART, so it shows up right away.

Note: the adaboot bump is missing adaboot #9, which #11570 needs for the Picos. Whichever merges second needs both.

dhalbert and others added 2 commits October 19, 2026 19:30
STATUS_DOTSTAR_DATA and STATUS_DOTSTAR_CLOCK name board pins and emit
MICROPY_HW_APA102_MOSI/SCK with CIRCUITPY_BITBANG_APA102 into the
generated mpconfigboard.h. Setting only one, or combining them with
STATUS_NEOPIXEL, is an error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin names come from the ports/nordic board. The header pins are named
by a new adafruit-itsybitsy-header connector in the overlay, with a
binding in dts/bindings and names in CONNECTORS, which gives
board.I2C(), board.SPI() and board.UART() on SCL/SDA, SCK/MOSI/MISO and
TX/RX. Pins off the header (SWITCH, the LED and the status DotStar) are
named in [pins]. All I2C, SPI, UART and PWM instances are dynamic. The
status DotStar is bit-banged, so the upstream apa102 node on SPI2 is
dropped.

Changes from the upstream board:
- QSPI runs at 16 MHz, not 32 MHz. The GD25Q16C fails with I/O errors at
  32 MHz, as found for ports/nordic in adafruit#1418.
- The user LED is labeled blue, not red.

CONSOLE=1 puts the Zephyr console on TX/RX.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhalbert
dhalbert force-pushed the zephyr-cp-itsybitsy-nrf52840 branch 2 times, most recently from 7590571 to e35154c Compare October 19, 2026 23:43
@dhalbert dhalbert changed the title zephyr-cp: add ItsyBitsy nRF52840; add dynamic buses on CLUE and ItsyBitsy zephyr-cp: add ItsyBitsy nRF52840 Oct 19, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dhalbert
dhalbert force-pushed the zephyr-cp-itsybitsy-nrf52840 branch from e35154c to 102225e Compare October 20, 2026 03:24
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.

zephyr: add ItsyBitsy nRF52840

2 participants