From 9c8995e31c2772860e468e00290a7cc62a042169 Mon Sep 17 00:00:00 2001 From: Mikey Sklar Date: Wed, 9 Sep 2026 18:37:21 -0700 Subject: [PATCH 1/2] zephyr-cp/nrf7002dk: give slot0 the unused 32 KB storage partition nordic_nrf7002dk reserves 32 KB for storage_partition. Nothing reads it: the port's only settings user is common-hal/_bleio/Adapter.c:351, and this board sets CONFIG_BT=n. CIRCUITPY is on the external mx25r64 on spi4, not internal flash. 0xC000 + 0xF4000 = 0x100000, exactly the end of the nRF5340 application core's 1024 KB internal flash. Not built. I don't have a nRF7002 to verify with. Co-Authored-By: Claude Opus 5 (1M context) --- ports/zephyr-cp/boards/nordic/nrf7002dk/board.overlay | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ports/zephyr-cp/boards/nordic/nrf7002dk/board.overlay b/ports/zephyr-cp/boards/nordic/nrf7002dk/board.overlay index 30eb519f93b..cec4fbb2b98 100644 --- a/ports/zephyr-cp/boards/nordic/nrf7002dk/board.overlay +++ b/ports/zephyr-cp/boards/nordic/nrf7002dk/board.overlay @@ -1,8 +1,9 @@ -/* Remove slot1 (OTA), expand slot0 to use the space. - * CircuitPython doesn't use OTA updates. */ +/* Remove slot1 (OTA) and storage, expand slot0 to use the space. + * CircuitPython doesn't use OTA updates, and nothing here uses the settings + * NVS: CONFIG_BT=n, and CIRCUITPY lives on the external mx25r64. */ &slot0_partition { - /* Shrink mcuboot to 48KB, absorb slot1 + gap before storage */ - reg = <0x0000C000 0x000EC000>; + /* Shrink mcuboot to 48KB, absorb slot1 and storage, run to end of flash */ + reg = <0x0000C000 0x000F4000>; }; &boot_partition { @@ -10,5 +11,6 @@ }; /delete-node/ &slot1_partition; +/delete-node/ &storage_partition; #include "../../../app.overlay" From 40a645029144b0c2c47c33f8814e7839d103818f Mon Sep 17 00:00:00 2001 From: Mikey Sklar Date: Thu, 10 Sep 2026 06:03:27 -0700 Subject: [PATCH 2/2] zephyr-cp/nrf7002dk: turn settings off with storage_partition gone The port Kconfig defaults SETTINGS to y and prj.conf enables its NVS backend, which opens storage_partition. The previous commit deleted that partition, so the build failed in settings_nvs.c. Only _bleio uses settings, and this board has CONFIG_BT=n. Co-Authored-By: Claude Opus 5 (1M context) --- ports/zephyr-cp/boards/nordic/nrf7002dk/board.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/zephyr-cp/boards/nordic/nrf7002dk/board.conf b/ports/zephyr-cp/boards/nordic/nrf7002dk/board.conf index 2255bd760d3..346dcf5e7e2 100644 --- a/ports/zephyr-cp/boards/nordic/nrf7002dk/board.conf +++ b/ports/zephyr-cp/boards/nordic/nrf7002dk/board.conf @@ -8,3 +8,6 @@ CONFIG_LOG=n CONFIG_ASSERT=n CONFIG_TEST_RANDOM_GENERATOR=y CONFIG_BT=n +# Settings only stores BT bond keys here. With BT off, its NVS backend would +# still need storage_partition, which board.overlay removes. +CONFIG_SETTINGS=n