From 535f29d3ddcb52bfccd7bbfdd238ebaed1506870 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 8 Oct 2026 12:43:36 -0400 Subject: [PATCH 1/2] zephyr-cp: enable adafruit_pixelbuf and _pixelmap with neopixel_write Boards with neopixel_write now also get adafruit_pixelbuf and _pixelmap. Regenerated autogen_board_info.toml for the six affected nRF boards; the regeneration also picks up pending usb_host_bulk and watchdog changes from main. Co-Authored-By: Claude Opus 5.5 --- .../adafruit/clue_nrf52840_zephyr/autogen_board_info.toml | 7 ++++--- .../feather_nrf52840_sense_zephyr/autogen_board_info.toml | 7 ++++--- .../feather_nrf52840_zephyr/autogen_board_info.toml | 5 +++-- .../boards/nordic/nrf5340dk/autogen_board_info.toml | 7 ++++--- .../boards/nordic/nrf54l15dk/autogen_board_info.toml | 7 ++++--- .../boards/nordic/nrf54lm20dk/autogen_board_info.toml | 7 ++++--- ports/zephyr-cp/cptools/build_circuitpython.py | 1 + 7 files changed, 24 insertions(+), 17 deletions(-) diff --git a/ports/zephyr-cp/boards/adafruit/clue_nrf52840_zephyr/autogen_board_info.toml b/ports/zephyr-cp/boards/adafruit/clue_nrf52840_zephyr/autogen_board_info.toml index 52fc4d7531d..c72c1eb08a4 100644 --- a/ports/zephyr-cp/boards/adafruit/clue_nrf52840_zephyr/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/adafruit/clue_nrf52840_zephyr/autogen_board_info.toml @@ -6,10 +6,10 @@ __future__ = true _bleio = true # Zephyr board has _bleio _eve = false _pew = false -_pixelmap = false +_pixelmap = true # Zephyr board has neopixel_write _stage = false adafruit_bus_device = true -adafruit_pixelbuf = false +adafruit_pixelbuf = true # Zephyr board has neopixel_write aesio = true alarm = false analogbufio = false @@ -115,12 +115,13 @@ usb_audio = false usb_cdc = true usb_hid = true usb_host = false +usb_host_bulk = false usb_midi = false usb_video = false ustack = false vectorio = true # Zephyr board has busio warnings = true -watchdog = false +watchdog = true # Zephyr board has watchdog wifi = false zephyr_display = true # Zephyr board has zephyr_display zephyr_kernel = false diff --git a/ports/zephyr-cp/boards/adafruit/feather_nrf52840_sense_zephyr/autogen_board_info.toml b/ports/zephyr-cp/boards/adafruit/feather_nrf52840_sense_zephyr/autogen_board_info.toml index edbb32233c9..dd56292ba6d 100644 --- a/ports/zephyr-cp/boards/adafruit/feather_nrf52840_sense_zephyr/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/adafruit/feather_nrf52840_sense_zephyr/autogen_board_info.toml @@ -6,10 +6,10 @@ __future__ = true _bleio = true # Zephyr board has _bleio _eve = false _pew = false -_pixelmap = false +_pixelmap = true # Zephyr board has neopixel_write _stage = false adafruit_bus_device = true -adafruit_pixelbuf = false +adafruit_pixelbuf = true # Zephyr board has neopixel_write aesio = true alarm = false analogbufio = false @@ -115,12 +115,13 @@ usb_audio = false usb_cdc = true usb_hid = true usb_host = false +usb_host_bulk = false usb_midi = false usb_video = false ustack = false vectorio = true # Zephyr board has busio warnings = true -watchdog = false +watchdog = true # Zephyr board has watchdog wifi = false zephyr_display = false zephyr_kernel = false diff --git a/ports/zephyr-cp/boards/adafruit/feather_nrf52840_zephyr/autogen_board_info.toml b/ports/zephyr-cp/boards/adafruit/feather_nrf52840_zephyr/autogen_board_info.toml index 3d72e30d892..f96834d3040 100644 --- a/ports/zephyr-cp/boards/adafruit/feather_nrf52840_zephyr/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/adafruit/feather_nrf52840_zephyr/autogen_board_info.toml @@ -6,10 +6,10 @@ __future__ = true _bleio = true # Zephyr board has _bleio _eve = false _pew = false -_pixelmap = false +_pixelmap = true # Zephyr board has neopixel_write _stage = false adafruit_bus_device = true -adafruit_pixelbuf = false +adafruit_pixelbuf = true # Zephyr board has neopixel_write aesio = true alarm = false analogbufio = false @@ -115,6 +115,7 @@ usb_audio = false usb_cdc = true usb_hid = true usb_host = false +usb_host_bulk = false usb_midi = false usb_video = false ustack = false diff --git a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml index 8df24f2e0b6..70a9c002eb0 100644 --- a/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf5340dk/autogen_board_info.toml @@ -6,10 +6,10 @@ __future__ = true _bleio = true # Zephyr board has _bleio _eve = false _pew = false -_pixelmap = false +_pixelmap = true # Zephyr board has neopixel_write _stage = false adafruit_bus_device = true -adafruit_pixelbuf = false +adafruit_pixelbuf = true # Zephyr board has neopixel_write aesio = true alarm = false analogbufio = false @@ -115,12 +115,13 @@ usb_audio = false usb_cdc = true usb_hid = true usb_host = false +usb_host_bulk = false usb_midi = false usb_video = false ustack = false vectorio = true # Zephyr board has busio warnings = true -watchdog = false +watchdog = true # Zephyr board has watchdog wifi = false zephyr_display = false zephyr_kernel = false diff --git a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml index 214981af521..7021e6615ca 100644 --- a/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf54l15dk/autogen_board_info.toml @@ -6,10 +6,10 @@ __future__ = true _bleio = true # Zephyr board has _bleio _eve = false _pew = false -_pixelmap = false +_pixelmap = true # Zephyr board has neopixel_write _stage = false adafruit_bus_device = true -adafruit_pixelbuf = false +adafruit_pixelbuf = true # Zephyr board has neopixel_write aesio = true alarm = false analogbufio = false @@ -115,12 +115,13 @@ usb_audio = false usb_cdc = false usb_hid = false usb_host = false +usb_host_bulk = false usb_midi = false usb_video = false ustack = false vectorio = true # Zephyr board has busio warnings = true -watchdog = false +watchdog = true # Zephyr board has watchdog wifi = false zephyr_display = false zephyr_kernel = false diff --git a/ports/zephyr-cp/boards/nordic/nrf54lm20dk/autogen_board_info.toml b/ports/zephyr-cp/boards/nordic/nrf54lm20dk/autogen_board_info.toml index 59337c53a90..9a770e1ee39 100644 --- a/ports/zephyr-cp/boards/nordic/nrf54lm20dk/autogen_board_info.toml +++ b/ports/zephyr-cp/boards/nordic/nrf54lm20dk/autogen_board_info.toml @@ -6,10 +6,10 @@ __future__ = true _bleio = true # Zephyr board has _bleio _eve = false _pew = false -_pixelmap = false +_pixelmap = true # Zephyr board has neopixel_write _stage = false adafruit_bus_device = true -adafruit_pixelbuf = false +adafruit_pixelbuf = true # Zephyr board has neopixel_write aesio = true alarm = false analogbufio = false @@ -115,12 +115,13 @@ usb_audio = false usb_cdc = true usb_hid = true usb_host = false +usb_host_bulk = false usb_midi = false usb_video = false ustack = false vectorio = true # Zephyr board has busio warnings = true -watchdog = false +watchdog = true # Zephyr board has watchdog wifi = false zephyr_display = false zephyr_kernel = false diff --git a/ports/zephyr-cp/cptools/build_circuitpython.py b/ports/zephyr-cp/cptools/build_circuitpython.py index 90e36d6c310..74d3eed9368 100644 --- a/ports/zephyr-cp/cptools/build_circuitpython.py +++ b/ports/zephyr-cp/cptools/build_circuitpython.py @@ -93,6 +93,7 @@ "busio": ["fourwire", "i2cdisplaybus", "sdcardio", "sharpdisplay"], "fourwire": ["displayio", "busdisplay", "epaperdisplay"], "i2cdisplaybus": ["displayio", "busdisplay", "epaperdisplay"], + "neopixel_write": ["adafruit_pixelbuf", "_pixelmap"], # Zephyr display backends need displayio and, by extension, terminalio so # the REPL console appears on the display by default. "zephyr_display": ["displayio"], From 4839f8c46babba4f97826f765753bcc62dfc4ed8 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 8 Oct 2026 12:57:08 -0400 Subject: [PATCH 2/2] _pixelmap: give PixelMap() constructor args the MP_ARG_OBJ kind Both args had kind 0, which mp_arg_parse_all() asserts against. Ports built with NDEBUG skipped the assert; zephyr-cp keeps asserts on, so every PixelMap() call hung the board. Co-Authored-By: Claude Opus 5.5 --- shared-bindings/_pixelmap/PixelMap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/_pixelmap/PixelMap.c b/shared-bindings/_pixelmap/PixelMap.c index 9e3b9bb0a8d..913603dc3b9 100644 --- a/shared-bindings/_pixelmap/PixelMap.c +++ b/shared-bindings/_pixelmap/PixelMap.c @@ -24,8 +24,8 @@ static mp_obj_t pixelmap_pixelmap_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) { enum { ARG_pixelbuf, ARG_indices }; static const mp_arg_t allowed_args[] = { - { MP_QSTR_pixelbuf, MP_ARG_REQUIRED }, - { MP_QSTR_indices, MP_ARG_REQUIRED }, + { MP_QSTR_pixelbuf, MP_ARG_OBJ | MP_ARG_REQUIRED }, + { MP_QSTR_indices, MP_ARG_OBJ | MP_ARG_REQUIRED }, }; mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];