Skip to content

Commit 27014ce

Browse files
committed
app: migrate from Partition Manager to DTS-based partitions
Remove the Partition Manager (PM) dependency in favor of static devicetree partition layouts for both the nRF9151 DK and Thingy:91 X. Flash partitions for LittleFS, MCUboot slots, and modem trace storage are now declared directly in board overlays and a shared `nrf9151dk_flash_partitions.dtsi` include. Add board-specific modem trace overlays and a new `overlay-upload-modem-traces-to-memfault.overlay` for Memfault trace upload builds. Switch storage backend to use `PARTITION_ID` instead of `FIXED_PARTITION_ID`. Add b0 secure bootloader sysbuild integration with board overlays and `prj.conf`. Bump CI container to `v0.29.2`, remove partition manager report artifact generation, and update docs to reflect DTS-based partition sizing. Update sdk-nrf ref to NCS 3.4 (LTS) Signed-off-by: Simen S. Røstad <simen.rostad@nordicsemi.no>
1 parent 1f8d7a0 commit 27014ce

46 files changed

Lines changed: 991 additions & 282 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actions/build-step/action.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ runs:
6262
echo CONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y >> overlay-debug-att.conf
6363
fi
6464
params+=("-DEXTRA_CONF_FILE=overlay-debug-att.conf")
65+
params+=("-DEXTRA_DTC_OVERLAY_FILE=overlay-upload-modem-traces-to-memfault.overlay")
6566
fi
6667
if [[ "${{ inputs.mqtt }}" == "true" ]]; then
6768
params+=("-DEXTRA_CONF_FILE=$(pwd)/../examples/modules/cloud/overlay-mqtt.conf")
6869
fi
6970
if [[ "${{ inputs.modem_trace }}" == "true" ]]; then
70-
params+=("-Dapp_SNIPPET=nrf91-modem-trace-uart")
71+
params+=("-DEXTRA_CONF_FILE=overlay-modem-trace-over-uart.conf")
72+
params+=("-DEXTRA_DTC_OVERLAY_FILE=overlay-modem-trace-over-uart.overlay")
7173
fi
7274
if [[ "${{ inputs.external_gnss }}" == "true" ]]; then
7375
echo "CONFIG_MODEM_ANTENNA_GNSS_EXTERNAL=y" > overlay-external-gnss.conf
@@ -113,10 +115,3 @@ runs:
113115
artifacts/asset-tracker-template-${{ inputs.version }}-${{ inputs.short_board }}-nrf91.elf
114116
cp ${{ inputs.path }}/build/dfu_application.zip \
115117
artifacts/asset-tracker-template-${{ inputs.version }}-${{ inputs.short_board }}-nrf91-dfu.zip
116-
cd ${{ inputs.path }}/build
117-
ninja partition_manager_report > partition_manager_report.txt
118-
119-
- name: Generate Partition Manager Report
120-
shell: bash
121-
run: |
122-
sed '1d' ${{ inputs.path }}/build/partition_manager_report.txt > artifacts/pmr-${{ inputs.short_board }}-nrf91-default-${{ inputs.version }}.txt

.github/workflows/attach_release_assets.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
fail_on_unmatched_files: true
3939
files: |
4040
asset-tracker-template-*.*
41-
pmr-*-nrf91-*.txt
4241
4342
- name: Trigger workflow that publishes symbol files to Memfault
4443
working-directory: .github/workflows

.github/workflows/build-and-target-test.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ on:
3333
type: boolean
3434
required: false
3535
default: false
36+
test_filter:
37+
description: 'Pytest -k expression to isolate tests (e.g. "test_app_fota"
38+
or "fota and not delta"). Leave empty to run all tests for the selected
39+
devices. Remember to also tick run_nightly_tests if the test is @slow.'
40+
type: string
41+
required: false
42+
default: ""
3643

3744
workflow_call:
3845
inputs:
@@ -157,3 +164,6 @@ jobs:
157164
artifact_run_id: ${{ needs.build.outputs.run_id }}
158165
devices: ${{ needs.setup.outputs.devices }}
159166
run_nightly_tests: ${{ needs.setup.outputs.run_nightly_tests == 'true' }}
167+
# Translate the user-facing test_filter (a -k expression) into a pytest
168+
# argument. Empty filter = no extra args = run everything as before.
169+
pytest_args: ${{ inputs.test_filter != '' && format('-k "{0}"', inputs.test_filter) || '' }}

.github/workflows/build.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ concurrency:
6262
jobs:
6363
build:
6464
runs-on: build_self_hosted
65-
container: ghcr.io/zephyrproject-rtos/ci:v0.28.7
65+
container: ghcr.io/zephyrproject-rtos/ci:v0.29.2
6666
env:
6767
CMAKE_PREFIX_PATH: /opt/toolchains
6868
outputs:
@@ -266,11 +266,6 @@ jobs:
266266
SIZE_COMMENT_PATH: ${{ github.workspace }}/size-comment.md
267267
CI_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
268268
run: |
269-
# Add the first Zephyr SDK binutils path to PATH if it exists
270-
SDK_BIN=$(ls -d /opt/toolchains/zephyr-sdk-*/arm-zephyr-eabi/bin 2>/dev/null | head -1)
271-
[ -n "$SDK_BIN" ] && export PATH="$SDK_BIN:$PATH"
272-
273-
# Generate the diff comment
274269
bash asset-tracker-template/scripts/ci/pr-size-diff.sh
275270
276271
- name: Post PR app-size sticky comment for thingy91x image

.github/workflows/sonarcloud.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
build:
2323
name: Build and analyze
2424
runs-on: build_self_hosted
25-
container: ghcr.io/zephyrproject-rtos/ci:v0.28.7
25+
container: ghcr.io/zephyrproject-rtos/ci:v0.29.2
2626
env:
2727
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
2828
CMAKE_PREFIX_PATH: /opt/toolchains

.github/workflows/target-test.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ on:
2222
type: string
2323
required: true
2424
default: thingy91x
25+
pytest_args:
26+
description: Extra arguments appended verbatim to the pytest invocation
27+
(e.g. "-k test_app_fota"). Leave empty for the default behaviour.
28+
type: string
29+
required: false
30+
default: ""
2531

2632
workflow_dispatch:
2733
inputs:
@@ -48,6 +54,12 @@ on:
4854
type: string
4955
required: true
5056
default: thingy91x
57+
pytest_args:
58+
description: Extra arguments appended verbatim to the pytest invocation
59+
(e.g. "-k test_app_fota"). Leave empty for the default behaviour.
60+
type: string
61+
required: false
62+
default: ""
5163

5264
permissions:
5365
contents: read
@@ -161,7 +173,8 @@ jobs:
161173
pytest -v "${pytest_marker[@]}" \
162174
--junit-xml=results/test-results.xml \
163175
--html=results/test-results.html --self-contained-html \
164-
${PYTEST_PATH}
176+
${PYTEST_PATH} \
177+
${{ inputs.pytest_args }}
165178
166179
shell: bash
167180
env:
@@ -175,6 +188,7 @@ jobs:
175188
MEMFAULT_ORGANIZATION_SLUG: ${{ vars.MEMFAULT_ORGANIZATION_SLUG }}
176189
MEMFAULT_PROJECT_SLUG: ${{ vars.MEMFAULT_PROJECT_SLUG }}
177190
APP_BUNDLEID: ${{ vars.APP_BUNDLEID }}
191+
MCUBOOT_BUNDLEID: ${{ vars.MCUBOOT_BUNDLEID }}
178192

179193
- name: Generate and Push Power Badge
180194
if: ${{ always() && matrix.device == 'ppk_thingy91x' }}

app/Kconfig.sysbuild

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,23 @@ endchoice
1111
config SECURE_BOOT_APPCORE
1212
default y if BOARD_NRF9151DK_NRF9151_NS
1313

14+
# Reuse the Nordic-provided Thingy:91 X debug signing key on the DK as well.
15+
# Without this, debug_keys.cmake generates a fresh random key on every
16+
# pristine build, which (a) re-bricks any already-flashed b0 for FOTA and
17+
# (b) makes signed images non-deterministic across CI runs. The Thingy:91 X
18+
# board package sets the same default unconditionally, so both boards now
19+
# sign with the same key. This is a public debug key - not for production.
20+
config SECURE_BOOT_SIGNING_KEY_FILE
21+
default "$(ZEPHYR_NRF_MODULE_DIR)/boards/nordic/thingy91x/nsib_signing_key.pem" if BOARD_NRF9151DK_NRF9151_NS
22+
1423
config WIFI_NRF70
1524
default y if BOARD_THINGY91X_NRF9151_NS
1625

1726
choice WIFI_NRF70_OPER_MODES
1827
default WIFI_NRF70_SCAN_ONLY if BOARD_THINGY91X_NRF9151_NS
1928
endchoice
2029

21-
config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY
22-
default y if BOARD_NRF9151DK_NRF9151_NS
30+
config PARTITION_MANAGER
31+
default n
2332

2433
source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"

app/boards/nrf9151dk_nrf9151_ns.conf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ CONFIG_SPI=y
99
CONFIG_SPI_NOR=y
1010
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
1111
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
12-
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
1312

1413
# Location priority order
1514
CONFIG_LOCATION_REQUEST_DEFAULT_METHOD_FIRST_GNSS=y

app/boards/nrf9151dk_nrf9151_ns.overlay

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,13 @@
44
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
*/
66

7+
#include "../dts/nrf9151dk_prelude.dtsi"
8+
#include "../dts/att_flash_partitions.dtsi"
9+
#include "../dts/att_sram_partitions.dtsi"
10+
711
/ {
8-
/* Configure partition manager to use gd25wb256 as the external flash */
912
chosen {
1013
nordic,modem-trace-uart = &uart1;
11-
nordic,pm-ext-flash = &gd25wb256;
12-
};
13-
14-
aliases {
15-
ext-flash = &gd25wb256;
16-
};
17-
18-
fstab {
19-
compatible = "zephyr,fstab";
20-
lfs1: lfs1 {
21-
compatible = "zephyr,fstab,littlefs";
22-
mount-point = "/att_storage";
23-
partition = <&littlefs_storage>;
24-
automount;
25-
read-size = <16>;
26-
prog-size = <16>;
27-
cache-size = <64>;
28-
lookahead-size = <32>;
29-
block-cycles = <512>;
30-
};
31-
};
32-
};
33-
34-
&gd25wb256 {
35-
status = "okay";
36-
37-
/* Partitions will be overridden by PM but needed for DTS parsing */
38-
partitions {
39-
compatible = "fixed-partitions";
40-
#address-cells = <1>;
41-
#size-cells = <1>;
42-
43-
littlefs_storage: partition@0 {
44-
label = "littlefs_storage";
45-
reg = <0x00000000 0x00100000>;
46-
};
4714
};
4815
};
4916

app/boards/thingy91x_nrf9151_ns.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7+
# External flash (MCUboot secondary on GD25)
8+
CONFIG_SPI=y
9+
CONFIG_SPI_NOR=y
10+
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
11+
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
12+
713
# Environmental module
814
CONFIG_APP_ENVIRONMENTAL=y
915

0 commit comments

Comments
 (0)