Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
1e2e1ec
zephyr-cp: make the Feather UART console a build option
dhalbert Oct 12, 2026
3fe8402
zephyr-cp: make the Feather nRF52840 I2C0 dynamic
dhalbert Oct 13, 2026
7454a06
zephyr-cp: define board.I2C(), SPI() and UART() in circuitpython.toml
dhalbert Oct 13, 2026
11d8f1d
zephyr-cp: allocate the fastest bus instance first
dhalbert Oct 13, 2026
fcb1939
zephyr-cp: document how nRF serial instances are shared and allocated
dhalbert Oct 13, 2026
13cd72c
zephyr-cp: share the Feather nRF52840 boards' overlays and console files
dhalbert Oct 13, 2026
c41ce4d
Merge remote-tracking branch 'adafruit/main' into zephyr-cp-optional-…
dhalbert Oct 14, 2026
18a2b48
zephyr-cp: find board buses from devicetree labels
dhalbert Oct 14, 2026
09f6a81
zephyr-cp: use bus labels for board buses only with nRF routing
dhalbert Oct 14, 2026
6e57293
zephyr-cp: mark board buses with generic board_* labels
dhalbert Oct 14, 2026
70caedf
zephyr-cp: always generate i2sout_reset()
dhalbert Oct 19, 2026
1050db3
zephyr-cp: choose board buses from connector pin names
dhalbert Oct 19, 2026
b6e30f4
zephyr-cp: use UARTE for UART0 on the Feather nRF52840
dhalbert Oct 19, 2026
2089e3d
Merge remote-tracking branch 'adafruit/main' into zephyr-cp-optional-…
dhalbert Oct 19, 2026
db682b7
zephyr-cp: give native_sim a non-console UART for board.UART()
dhalbert Oct 19, 2026
33b39d6
CI: pin Python 3.14 until minify_html has a 3.15 wheel
dhalbert Oct 19, 2026
dc51f71
zephyr-cp: dynamic Arduino buses on the nRF5340 DK
dhalbert Oct 19, 2026
ffe8830
zephyr-cp: dynamic I2C on the nRF54H20 DK
dhalbert Oct 19, 2026
b75f40f
zephyr-cp: no fixed board buses on boards that use iobroker
dhalbert Oct 19, 2026
4d20eae
zephyr-cp: dynamic I2C0 and UARTE UART0 on the CLUE
dhalbert Oct 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-board-custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v6
with:
python-version: 3.x
python-version: "3.14" # minify_html has no Python 3.15 wheel yet
- name: Board to port
id: board-to-port
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-boards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v6
with:
python-version: ${{ inputs.port == 'zephyr-cp' && '3.13' || '3.x' }}
python-version: ${{ inputs.port == 'zephyr-cp' && '3.13' || '3.14' }} # minify_html has no Python 3.15 wheel yet

- name: Set up port
id: set-up-port
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-mpy-cross.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v6
with:
python-version: 3.x
python-version: "3.14" # minify_html has no Python 3.15 wheel yet
- name: Set up submodules
uses: ./.github/actions/deps/submodules
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v6
with:
python-version: 3.x
python-version: "3.14" # minify_html has no Python 3.15 wheel yet
- name: Duplicate USB VID/PID check
run: python3 -u -m tools.ci_check_duplicate_usb_vid_pid
- name: Set up submodules
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v6
with:
python-version: 3.x
python-version: "3.14" # minify_html has no Python 3.15 wheel yet
- name: Set up submodules
uses: ./.github/actions/deps/submodules
- name: Versions
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v6
with:
python-version: 3.x
python-version: "3.14" # minify_html has no Python 3.15 wheel yet
- name: Set up submodules
uses: ./.github/actions/deps/submodules
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-website-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v6
with:
python-version: 3.x
python-version: "3.14" # minify_html has no Python 3.15 wheel yet
- name: Set up submodules
uses: ./.github/actions/deps/submodules
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up python
uses: actions/setup-python@v6
with:
python-version: 3.x
python-version: "3.14" # minify_html has no Python 3.15 wheel yet
- name: Set up submodules
uses: ./.github/actions/deps/submodules
- name: Set up external
Expand Down
23 changes: 16 additions & 7 deletions ports/zephyr-cp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,25 @@ endif
# When DEBUG=1, apply additional Kconfig fragments for debug-friendly settings.
DEBUG_CONF_FILE ?= $(CURDIR)/debug.conf
ifeq ($(DEBUG),1)
ifneq ($(CP_BOARD_CONF),)
CP_BOARD_CONF := $(CP_BOARD_CONF);$(DEBUG_CONF_FILE)
else
CP_BOARD_CONF := $(DEBUG_CONF_FILE)
CP_BOARD_CONF := $(strip $(CP_BOARD_CONF) $(DEBUG_CONF_FILE))
endif
# When CONSOLE=1 (implied by DEBUG=1), apply the board's console.overlay, if it has one, and the
# port's console.conf. Boards whose console pins are also user pins enable the Zephyr UART console
# only then.
CONSOLE ?= $(DEBUG)
CP_BOARD_CONSOLE_OVERLAY :=
ifeq ($(CONSOLE),1)
CP_BOARD_CONSOLE_OVERLAY := $(wildcard $(CP_BOARD_DIR)/console.overlay)
ifneq ($(CP_BOARD_CONSOLE_OVERLAY),)
CP_BOARD_CONF := $(strip $(CP_BOARD_CONF) $(CURDIR)/console.conf)
endif
endif
# Always pass the conf file, even if empty. This undoes DEBUG=1 when it's omitted on a later run.
# Quoted because with DEBUG=1 the value is a semicolon-separated list, and an unquoted semicolon
# would end the shell command.
CP_BOARD_CONF := $(subst $(eval) ,;,$(CP_BOARD_CONF))
# Always pass the conf and console overlay files, even if empty. This undoes DEBUG=1 or CONSOLE=1
# when it's omitted on a later run. Quoted because the conf value can be a semicolon-separated
# list, and an unquoted semicolon would end the shell command.
WEST_CMAKE_ARGS += -Dzephyr-cp_EXTRA_CONF_FILE="$(CP_BOARD_CONF)"
WEST_CMAKE_ARGS += -Dzephyr-cp_EXTRA_DTC_OVERLAY_FILE="$(CP_BOARD_CONSOLE_OVERLAY)"

# Boards can opt into building the MCUboot bootloader (and thus BLE OTA
# updates) by shipping a sysbuild.conf fragment. It sets sysbuild-level
Expand Down
6 changes: 6 additions & 0 deletions ports/zephyr-cp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ make BOARD=nordic_nrf5340dk
This uses Zephyr's cmake to generate Makefiles that then delegate to
`tools/cpbuild/build_circuitpython.py` to build the CircuitPython bits in parallel.

`DEBUG=1` adds the debug Kconfig settings in `debug.conf`. `CONSOLE=1` (implied
by `DEBUG=1`) applies a board's `console.overlay`, if it has one, together with
the port's `console.conf`, which turns the Zephyr UART console back on. Boards
whose console UART pins are also user pins, such as the Feather nRF52840, have
the Zephyr UART console only in those builds.

## Native simulator build container

Building the native sim requires `libsdl2-dev:i386` and other 32bit dependencies that
Expand Down
43 changes: 39 additions & 4 deletions ports/zephyr-cp/boards/adafruit/clue_nrf52840_zephyr/board.overlay
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/* Partition layout is owned by the mcuboot fork
* (dts/adafruit/adafruit_clue_nrf52840.dtsi) and applied to this image by
* sysbuild. This overlay only adds board/app config. */
/* No Zephyr console by default, so TX/RX are free for busio.UART. A CONSOLE=1
* build puts the console back on UART0 (console.overlay). */
/ {
chosen {
/delete-property/ zephyr,console;
Expand All @@ -15,11 +17,15 @@
/delete-node/ board_cdc_acm_uart;
};

// UART0, I2C1 and SPI3 are enabled with all pins disconnected and marked
// zephyr,deferred-init so nothing is claimed at boot: the iobroker
// UART0, I2C0, I2C1 and SPI3 are enabled with all pins disconnected and
// marked zephyr,deferred-init so nothing is claimed at boot: the iobroker
// initializes and routes a device to arbitrary pins when a busio object is
// constructed, and de-initializes it on release. (I2C0 is the fixed sensor
// bus, SPI2 the fixed display bus, and QSPI the fixed external flash.)
// constructed, and de-initializes it on release. (SPI2 is the fixed display
// bus and QSPI the fixed external flash. The onboard sensors are on SCL/SDA
// but have no devicetree nodes, so I2C0 does not need to be fixed.)
//
// See "nRF serial instances" in internal-modules/iobroker/README.md for how
// the instances are shared and allocated.
//
// I2C1 and SPI1 are the same peripheral instance (0x40004000), so only one
// mode can be enabled: I2C is the more useful dynamic bus on the CLUE.
Expand All @@ -41,6 +47,20 @@
};
};

i2c0_dyn_default: i2c0_dyn_default {
group1 {
psels = <NRF_PSEL_DISCONNECTED(TWIM_SDA)>,
<NRF_PSEL_DISCONNECTED(TWIM_SCL)>;
};
};

i2c0_dyn_sleep: i2c0_dyn_sleep {
group1 {
psels = <NRF_PSEL_DISCONNECTED(TWIM_SDA)>,
<NRF_PSEL_DISCONNECTED(TWIM_SCL)>;
};
};

i2c1_dyn_default: i2c1_dyn_default {
group1 {
psels = <NRF_PSEL_DISCONNECTED(TWIM_SDA)>,
Expand Down Expand Up @@ -144,7 +164,11 @@
};
};

// The upstream board uses the legacy UART driver for UART0, which can't be
// de-initialized, so iobroker could not route it again once it was released.
// Instead, use the UARTE driver, which can be deinited.
&uart0 {
compatible = "nordic,nrf-uarte";
status = "okay";
zephyr,deferred-init;
current-speed = <115200>;
Expand All @@ -153,6 +177,17 @@
pinctrl-names = "default", "sleep";
};

// The upstream board fixes I2C0 to SCL/SDA with the legacy TWI driver. Use
// TWIM like I2C1 so iobroker can route it.
&i2c0 {
compatible = "nordic,nrf-twim";
status = "okay";
zephyr,deferred-init;
pinctrl-0 = <&i2c0_dyn_default>;
pinctrl-1 = <&i2c0_dyn_sleep>;
pinctrl-names = "default", "sleep";
};

&i2c1 {
status = "okay";
zephyr,deferred-init;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* Applied after board.overlay in CONSOLE=1 and DEBUG=1 builds: the Zephyr
* console on UART0, fixed to the TX/RX pins. TX/RX are then not available to
* busio.UART. */
/ {
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
};
};

&uart0 {
/delete-property/ zephyr,deferred-init;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
CONFIG_BOARD_SERIAL_BACKEND_CDC_ACM=n

# No Zephyr UART console by default (see board.overlay); a CONSOLE=1 build turns
# it back on in console.conf.
CONFIG_UART_CONSOLE=n
CONFIG_LOG_BACKEND_UART=n

# Pin numbers are module pins (MDBT50Q-1MV2 carries the aQFN73 inside).
# The feathers use the MDBT50Q-1MV2 module, so pin numbers are module pins.
CONFIG_IOBROKER_PACKAGE_MDBT50Q_1MV2=y
Expand Down
Loading
Loading