From ffd62e1c594d88666e87c01f81990f7cd3a47652 Mon Sep 17 00:00:00 2001 From: Vladimir Smitka Date: Sat, 29 Aug 2026 12:30:14 +0000 Subject: [PATCH] zephyr-cp: add ranges; to three rebuilt partitions nodes Each of these overlays deletes the partitions node its board DTS declares and rebuilds it without re-declaring ranges;. Devicetree then leaves the child addresses untranslated and every partition resolves to a bare offset. On the two RP2040 boards the code partition lands at 0x100 instead of 0x10000100, so RP2_REQUIRES_SECOND_STAGE_BOOT no longer matches, the second stage bootloader is not linked in and the UF2 is built for the wrong address. Same as #11234, which covered rpi_pico_zephyr. On stm32wba65i_dk1 the partitions resolve to 0x0, 0x10000, 0x108000 and 0x1e0000 rather than 0x08000000 upwards. flash_map computes a mapped partition's offset as DT_REG_ADDR(partition) - DT_REG_ADDR(memory), so every flash_area offset on that board underflows. Each board's own DTS declares ranges; on that node, so this only puts back what the overlay dropped. Partition offsets and sizes are unchanged. --- .../boards/adafruit/feather_rp2040_zephyr/board.overlay | 1 + .../zephyr-cp/boards/raspberrypi/rpi_pico_w_zephyr/board.overlay | 1 + ports/zephyr-cp/boards/st/stm32wba65i_dk1/board.overlay | 1 + 3 files changed, 3 insertions(+) diff --git a/ports/zephyr-cp/boards/adafruit/feather_rp2040_zephyr/board.overlay b/ports/zephyr-cp/boards/adafruit/feather_rp2040_zephyr/board.overlay index 10cc674a66a..f159dfbe29f 100644 --- a/ports/zephyr-cp/boards/adafruit/feather_rp2040_zephyr/board.overlay +++ b/ports/zephyr-cp/boards/adafruit/feather_rp2040_zephyr/board.overlay @@ -2,6 +2,7 @@ /delete-node/ partitions; partitions { + ranges; #address-cells = <1>; #size-cells = <1>; diff --git a/ports/zephyr-cp/boards/raspberrypi/rpi_pico_w_zephyr/board.overlay b/ports/zephyr-cp/boards/raspberrypi/rpi_pico_w_zephyr/board.overlay index f1228e10138..16b3251df5a 100644 --- a/ports/zephyr-cp/boards/raspberrypi/rpi_pico_w_zephyr/board.overlay +++ b/ports/zephyr-cp/boards/raspberrypi/rpi_pico_w_zephyr/board.overlay @@ -2,6 +2,7 @@ /delete-node/ partitions; partitions { + ranges; #address-cells = <1>; #size-cells = <1>; diff --git a/ports/zephyr-cp/boards/st/stm32wba65i_dk1/board.overlay b/ports/zephyr-cp/boards/st/stm32wba65i_dk1/board.overlay index e1fc7f0175e..da2c7427c4a 100644 --- a/ports/zephyr-cp/boards/st/stm32wba65i_dk1/board.overlay +++ b/ports/zephyr-cp/boards/st/stm32wba65i_dk1/board.overlay @@ -2,6 +2,7 @@ /delete-node/ partitions; partitions { + ranges; #address-cells = <1>; #size-cells = <1>;