Skip to content

Assign correct board per sketch via sketch.yaml; gate in CI (#11)#15

Open
jonfroehlich wants to merge 3 commits into
masterfrom
sketch-board-targeting
Open

Assign correct board per sketch via sketch.yaml; gate in CI (#11)#15
jonfroehlich wants to merge 3 commits into
masterfrom
sketch-board-targeting

Conversation

@jonfroehlich

Copy link
Copy Markdown
Member

Closes #11.

The folder→FQBN heuristic mis-guessed the board for 14 sketches, so the compile sweep flagged them as failures when the code was actually fine — it was just being compiled for the wrong board. This adds a per-sketch sketch.yaml (default_fqbn) so both arduino-cli and a human reader know each sketch's real target, then gates the board-specific ones in CI on their real boards.

Board assignments (all verified compiling via arduino-cli)

Sketches Board FQBN Why
Sensors/i2s-Microphone/* (8) Adafruit Feather M0 Express adafruit:samd:adafruit_feather_m0_express hardware I2S peripheral; I2S.h ships with the Adafruit SAMD core
AddressableLEDs/NeoPixel/BlinkOnboardNeoPixel, Sensors/Microphone/SoundLevelOnboardNeopixel (2) nRF52840 Feather adafruit:nrf52:feather52840 onboard NeoPixel via PIN_NEOPIXEL
Serial/SimpleSerial1* (3) Leonardo arduino:avr:leonardo needs a second hardware UART (Serial1)

Legacy (the 14th)

PlayingMusic/SimpleMp3PlayerWithi2sMic #includes the SAMD-only I2S.h on an nRF52 board and — per its own header — never worked due to i2s-mic/VS1053 library incompatibility. Marked LEGACY EXAMPLE and listed in docs/legacy-sketches.md instead of being given a board.

CI

arduino/compile-sketches compiles every sketch in a job with that job's single fqbn (it does not read sketch.yaml), so mixed-board folders can't be gated wholesale. This PR:

  • adds SAMD and nRF52 matrix jobs for the board-specific sketches (with the Adafruit board-index source-url + Adafruit NeoPixel / Adafruit Zero I2S libs),
  • gates the 3 Serial1 sketches under the existing Leonardo job.

Verified-green follow-up

While sweeping, I confirmed all 57 remaining plain-Uno sketches in Sensors/, AddressableLEDs/, Serial/, and PlayingMusic/ compile clean on arduino:avr:uno. They were never wrong-board, so gating them is a separable change (a ~57-line allowlist, since the action has no exclude) — left as a fast follow to keep this diff focused.

🤖 Generated with Claude Code

jonfroehlich and others added 3 commits June 26, 2026 05:29
The folder→FQBN heuristic mis-targeted 14 sketches, so the compile sweep
flagged them as failures when the code was fine — just compiled for the
wrong board. Add a per-sketch sketch.yaml with default_fqbn so arduino-cli
(and a reader) knows each sketch's real target board:

  - Sensors/i2s-Microphone/* (8)  -> Adafruit Feather M0 Express (SAMD);
    hardware I2S peripheral, I2S.h ships with the Adafruit SAMD core
  - BlinkOnboardNeoPixel, SoundLevelOnboardNeopixel (2) -> nRF52840 Feather
    (onboard NeoPixel via PIN_NEOPIXEL)
  - Serial/SimpleSerial1* (3) -> Leonardo (needs a second hardware UART)

All 13 verified compiling on their assigned boards via arduino-cli.

The 14th, PlayingMusic/SimpleMp3PlayerWithi2sMic, #includes the SAMD-only
I2S.h on an nRF52 board and (per its own header) never worked due to
i2s-mic/VS1053 library incompatibility. Marked LEGACY and listed in
docs/legacy-sketches.md instead of given a board.

CI: arduino/compile-sketches compiles every sketch in a job with that job's
single fqbn (it does not read sketch.yaml), so add SAMD and nRF52 matrix
jobs for the board-specific sketches and gate the 3 Serial1 sketches under
the existing Leonardo job. The remaining plain-Uno sketches in these folders
also compile green and are noted as a follow-up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Adafruit nRF52 core's build recipe shells out to adafruit-nrfutil even
for a plain compile (to package the firmware), so it must be on PATH. It's
bundled with a normal IDE install but absent on the CI runner, which broke
the nRF52 matrix job. Add a pip-install step gated to that job.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add an explanatory comment to each per-sketch sketch.yaml so the file isn't a
mystery to students browsing the repo: it says what the file does, why it
exists, and that in the IDE they still pick the board via Tools -> Board (the
target board is named in plain English per file). The textbook teaches manual
board selection and never mentions sketch.yaml, and the IDE 2 surfaces it as a
tab, so an uncommented file reads as "did I do something wrong?"

Also document the convention in CLAUDE.md, including the gotcha that the
arduino/compile-sketches CI action does not read sketch.yaml.

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

Copy link
Copy Markdown
Member Author

Status (2026-06-26): ready to merge. All 4 board jobs green (arduino:avr:uno, arduino:avr:leonardo, adafruit:samd:adafruit_feather_m0_express, adafruit:nrf52:feather52840), MERGEABLE, no conflicts. Closes #11.

The latest commit (c3da8dc) added explanatory comments to each sketch.yaml and documented the convention in CLAUDE.md — comment-only metadata, verified that arduino-cli compile <Folder> still reads default_fqbn: past the comment.

One open decision before merging: merge as-is, or first fold in #16 (grow CI coverage). Recommendation: merge now, do #16 separately. Tracked in the roadmap, #17.

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.

Assign correct board per sketch via sketch.yaml

1 participant