Skip to content

ports/zephyr-cp: keep board overlays and Kconfig fragments in the board folder - #11235

Merged
tannewt merged 2 commits into
adafruit:mainfrom
MakerClassCZ:zephyr-cp-aliased-board-files
Aug 27, 2026
Merged

ports/zephyr-cp: keep board overlays and Kconfig fragments in the board folder#11235
tannewt merged 2 commits into
adafruit:mainfrom
MakerClassCZ:zephyr-cp-aliased-board-files

Conversation

@lynt-smitka

Copy link
Copy Markdown

Zephyr looks up boards/.overlay and boards/.conf by the resolved board name, so a board declared through cp_board_alias() never picks up files named after itself. The build succeeds and silently produces a firmware without the board's devicetree and Kconfig fragments.

Pass the files as zephyr-cp_EXTRA_DTC_OVERLAY_FILE / _EXTRA_CONF_FILE when they exist. The DEBUG=1 fragment goes through the same EXTRA_CONF_FILE variable, so it is appended to the list rather than letting one overwrite the other.

Verified with a board aliased to rpi_pico/rp2040 with both files present: zephyr.dts now cites the overlay and .config carries the board's options. Boards without such files are unaffected.

@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.

Ah! This would be awesome if we could do them in the board's folder instead of the top level. I think this is what we'd need for that. Want to move the existing ones too? Thanks!

@lynt-smitka

Copy link
Copy Markdown
Author

Moved them all. Every board keeps its board.overlay / board.conf in its own folder now.

To check nothing got lost I ran west build --cmake-only for all 28 boards before and after the move, the results were identical.

@lynt-smitka lynt-smitka changed the title ports/zephyr-cp: pass boards/<board>.overlay and .conf for aliased bo… ports/zephyr-cp: keep board overlays and Kconfig fragments in the board folder Aug 25, 2026

@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.

One question about a deletion. Excited for this cleanup otherwise. Thanks!

Comment thread ports/zephyr-cp/boards/frdm_rw612_rw612_cpu0.overlay Outdated
…ards

Zephyr looks up boards/<name>.overlay and boards/<name>.conf by the
resolved board name, so a board declared through cp_board_alias()
never picks up files named after itself. The build succeeds and
silently produces a firmware without the board's devicetree and
Kconfig fragments.

Pass the files as zephyr-cp_EXTRA_DTC_OVERLAY_FILE / _EXTRA_CONF_FILE
when they exist. DEBUG=1 appends its fragment to the same list
instead of replacing it.

Verified with a board aliased to rpi_pico/rp2040 with both files
present: zephyr.dts now cites the overlay and .config carries the
board's options. Boards without such files are unaffected.
…rd folder

Each board now keeps board.overlay and board.conf next to its
circuitpython.toml in boards/<vendor>/<board>/, rather than at the top level
where files named after Zephyr boards and files named after CircuitPython
boards shared one directory.

Now that these files reliably reach the board they belong to, the
replace-vs-add distinction starts to matter: the overlay goes through
DTC_OVERLAY_FILE rather than EXTRA_DTC_OVERLAY_FILE, because a board overlay
replaces app.overlay. That is why the overlays here include app.overlay
themselves, and why the nRF54L15 DK, which has no USB, deliberately does not.
The Kconfig fragment stays additive, so DEBUG=1 still appends its own.

boards/frdm_rw612_rw612_cpu0.overlay is dropped: no build string matches that
name, so it was never applied, and its devicetree does not parse.

Verified by configuring all 29 boards before and after the move - the
generated .config and devicetree are identical for every one.
@lynt-smitka
lynt-smitka force-pushed the zephyr-cp-aliased-board-files branch from d733f05 to d0f27bf Compare August 26, 2026 18:01

@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 e76502d into adafruit:main Aug 27, 2026
43 checks passed
@lynt-smitka
lynt-smitka deleted the zephyr-cp-aliased-board-files branch September 2, 2026 13:57
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