From def1012fe23ad8fa6c17570d30327069a7270e3e Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 19 Oct 2026 19:09:23 -0400 Subject: [PATCH] zephyr-cp: board buses on the nRF54L DKs and the nRF54L15 Tag Name the standard bus pins in [pins], so board.I2C(), board.SPI() and board.UART() are created on them and routed at runtime. - nRF54L15 DK: board.UART() on P0.00/P0.01, the debugger's VCOM0 serial port. No board.SPI(): the expansion header's SPI pins share lines with the console's VCOM1 port. - nRF54LM20 DK: board.SPI() on the expansion header's SPI pins, and board.UART() on P0.06/P0.07 (VCOM0). - nRF54L15 Tag: i2c21 and spi22, the onboard sensor buses, are now dynamic, with board.I2C() on P1.11/P1.12 and board.SPI() on P1.08/P1.06/P1.05. Co-Authored-By: Claude Opus 5.5 --- .../nordic/nrf54l15dk/circuitpython.toml | 6 +++ .../boards/nordic/nrf54l15tag/board.overlay | 51 ++++++++++++++++++- .../nordic/nrf54l15tag/circuitpython.toml | 10 ++++ .../nordic/nrf54lm20dk/circuitpython.toml | 8 +++ 4 files changed, 73 insertions(+), 2 deletions(-) diff --git a/ports/zephyr-cp/boards/nordic/nrf54l15dk/circuitpython.toml b/ports/zephyr-cp/boards/nordic/nrf54l15dk/circuitpython.toml index a0c0d5129bc..5ea381dcd6f 100644 --- a/ports/zephyr-cp/boards/nordic/nrf54l15dk/circuitpython.toml +++ b/ports/zephyr-cp/boards/nordic/nrf54l15dk/circuitpython.toml @@ -1 +1,7 @@ CIRCUITPY_BUILD_EXTENSIONS = ["hex", "signed.bin"] + +# QFN48 package pin numbers. +[pins] +# board.UART() pins: P0.00/P0.01, the debugger's VCOM0 serial port. +TX = 23 +RX = 24 diff --git a/ports/zephyr-cp/boards/nordic/nrf54l15tag/board.overlay b/ports/zephyr-cp/boards/nordic/nrf54l15tag/board.overlay index 627a28177ce..0dbeace63b0 100644 --- a/ports/zephyr-cp/boards/nordic/nrf54l15tag/board.overlay +++ b/ports/zephyr-cp/boards/nordic/nrf54l15tag/board.overlay @@ -49,13 +49,44 @@ // See "nRF serial instances" in internal-modules/iobroker/README.md for how // the instances are shared and allocated. // -// Instance 21 stays with the fixed i2c21 (bme688 and adxl367 hang off it) and -// instance 22 with the fixed spi22 (bmi270). Instance 30 is left alone: +// Instance 21 is i2c21, the bus the bme688 and adxl367 hang off, and instance +// 22 is spi22, the bmi270's bus (its CS is P1.07). Their Zephyr sensor nodes +// are disabled, so both are routed like the others. Instance 30 is left alone: // uart30 is the console above and i2c30/spi30 share that same peripheral, so // they must not be enabled. There is no i2c00 on this SoC, so instance 00 can // only carry spi00 (or uart00). &pinctrl { + i2c21_dyn_default: i2c21_dyn_default { + group1 { + psels = , + ; + }; + }; + + i2c21_dyn_sleep: i2c21_dyn_sleep { + group1 { + psels = , + ; + }; + }; + + spi22_dyn_default: spi22_dyn_default { + group1 { + psels = , + , + ; + }; + }; + + spi22_dyn_sleep: spi22_dyn_sleep { + group1 { + psels = , + , + ; + }; + }; + i2c20_dyn_default: i2c20_dyn_default { group1 { psels = , @@ -87,6 +118,22 @@ }; }; +&i2c21 { + status = "okay"; + zephyr,deferred-init; + pinctrl-0 = <&i2c21_dyn_default>; + pinctrl-1 = <&i2c21_dyn_sleep>; + pinctrl-names = "default", "sleep"; +}; + +&spi22 { + status = "okay"; + zephyr,deferred-init; + pinctrl-0 = <&spi22_dyn_default>; + pinctrl-1 = <&spi22_dyn_sleep>; + pinctrl-names = "default", "sleep"; +}; + &i2c20 { status = "okay"; zephyr,deferred-init; diff --git a/ports/zephyr-cp/boards/nordic/nrf54l15tag/circuitpython.toml b/ports/zephyr-cp/boards/nordic/nrf54l15tag/circuitpython.toml index 83e6bcd39c4..1e31efd1a62 100644 --- a/ports/zephyr-cp/boards/nordic/nrf54l15tag/circuitpython.toml +++ b/ports/zephyr-cp/boards/nordic/nrf54l15tag/circuitpython.toml @@ -1 +1,11 @@ CIRCUITPY_BUILD_EXTENSIONS = ["hex"] + +# QFN48 package pin numbers. +[pins] +# board.I2C() pins: the sensor I2C bus, P1.11/P1.12. +SCL = 39 +SDA = 40 +# board.SPI() pins: the bmi270's bus, P1.08/P1.06/P1.05. +SCK = 9 +MOSI = 7 +MISO = 6 diff --git a/ports/zephyr-cp/boards/nordic/nrf54lm20dk/circuitpython.toml b/ports/zephyr-cp/boards/nordic/nrf54lm20dk/circuitpython.toml index c302839366a..a4a1462c121 100644 --- a/ports/zephyr-cp/boards/nordic/nrf54lm20dk/circuitpython.toml +++ b/ports/zephyr-cp/boards/nordic/nrf54lm20dk/circuitpython.toml @@ -85,6 +85,14 @@ BUTTON1 = "E8" BUTTON2 = "F8" BUTTON3 = "H3" +# board.SPI() pins: the expansion header's SPI positions (header D3/D0/D1). +SCK = "H4" +MOSI = "H7" +MISO = "H6" +# board.UART() pins: P0.06/P0.07, the debugger's VCOM0 serial port. +TX = "H2" +RX = "G3" + # Nordic expansion board header (P17), named per the board silkscreen. # Positions key the gpio-map order (header GPIO 00-21, odd/even columns from # the A0/B0 end); I0 sits opposite the header's mid GND and has no gpio-map