Skip to content

Commit 26d8e8e

Browse files
committed
Full modem fota image works with nrf changes.
Application image cannot be updated. Needs TF-M functionality.
1 parent 9eb7970 commit 26d8e8e

7 files changed

Lines changed: 221 additions & 6 deletions
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*
6+
* External flash partition layout for full modem FOTA on nRF9151DK.
7+
*
8+
* The GD25WB256 is 256 Mbit (32 MB). The full modem image requires 4 MB.
9+
*
10+
* External flash layout:
11+
* 0x0000_0000 fmfu_storage (4 MB) — full modem firmware update staging area
12+
*/
13+
14+
&gd25wb256 {
15+
partitions {
16+
compatible = "fixed-partitions";
17+
#address-cells = <1>;
18+
#size-cells = <1>;
19+
20+
fmfu_storage: partition@0 {
21+
label = "fmfu-storage";
22+
reg = <0x0 0x400000>;
23+
};
24+
};
25+
};
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*
6+
* Flash partition layout for nRF9151DK with NSIB (b0) + MCUBoot.
7+
*
8+
* 0x0000_0000 b0 (NSIB) ( 32 kB)
9+
* 0x0000_8000 s0 (MCUBoot image, slot 0) ( 48 kB)
10+
* 0x0001_4000 s1 (MCUBoot image, slot 1) ( 48 kB)
11+
* 0x0002_0000 slot0 (primary app) (428 kB)
12+
* 0x0002_0000 TF-M secure (160 kB)
13+
* 0x0004_8000 Application (non-secure) (268 kB - (MCUBoot swap sector + MCUboot trailer))
14+
* 0x0008_b000 slot1 (secondary app) (424 kB)
15+
* 0x000f_5000 Non-secure storage ( 12 kB)
16+
* 0x000f_8000 TF-M ITS partition ( 8 kB)
17+
* 0x000f_c000 TF-M PS partition ( 16 kB)
18+
* 0x000f_e000 TF-M OTP partition ( 8 kB)
19+
*/
20+
21+
/delete-node/ &b0_partition;
22+
/delete-node/ &s0_partition;
23+
/delete-node/ &s1_partition;
24+
/delete-node/ &slot0_partition;
25+
/delete-node/ &slot1_partition;
26+
/delete-node/ &storage_partition;
27+
28+
&flash0 {
29+
partitions {
30+
compatible = "fixed-partitions";
31+
32+
b0_partition: partition@0 {
33+
label = "b0";
34+
reg = <0x0 0x8000>;
35+
};
36+
37+
s0_partition: boot_partition: partition@8000 {
38+
label = "mcuboot-0";
39+
reg = <0x8000 0xc000>;
40+
};
41+
42+
s1_partition: partition@14000 {
43+
label = "mcuboot-1";
44+
reg = <0x14000 0xc000>;
45+
};
46+
47+
slot0_partition: partition@20000 {
48+
compatible = "fixed-subpartitions";
49+
label = "image-0";
50+
reg = <0x20000 0x6b000>;
51+
ranges = <0x0 0x20000 0x6b000>;
52+
#address-cells = <1>;
53+
#size-cells = <1>;
54+
55+
slot0_s_partition: partition@0 {
56+
label = "image-0-secure";
57+
reg = <0x0 0x28000>;
58+
};
59+
60+
slot0_ns_partition: partition@28000 {
61+
label = "image-0-nonsecure";
62+
reg = <0x28000 0x43000>;
63+
};
64+
};
65+
66+
slot1_partition: partition@8b000 {
67+
compatible = "fixed-subpartitions";
68+
label = "image-1";
69+
reg = <0x8b000 0x6a000>;
70+
ranges = <0x0 0x8b000 0x6a000>;
71+
#address-cells = <1>;
72+
#size-cells = <1>;
73+
74+
slot1_s_partition: partition@0 {
75+
label = "image-1-secure";
76+
reg = <0x0 0x28000>;
77+
};
78+
79+
slot1_ns_partition: partition@28000 {
80+
label = "image-1-nonsecure";
81+
reg = <0x28000 0x42000>;
82+
};
83+
};
84+
85+
nonsecure_storage: storage_partition: partition@f5000 {
86+
label = "nonsecure-storage";
87+
reg = <0xf5000 0x3000>;
88+
};
89+
90+
tfm_its_partition: partition@f8000 {
91+
compatible = "zephyr,mapped-partition";
92+
label = "tfm-its";
93+
reg = <0xf8000 0x2000>;
94+
};
95+
96+
tfm_ps_partition: partition@fa000 {
97+
compatible = "zephyr,mapped-partition";
98+
label = "tfm-ps";
99+
reg = <0xfa000 0x4000>;
100+
};
101+
102+
tfm_otp_partition: partition@fe000 {
103+
compatible = "zephyr,mapped-partition";
104+
label = "tfm-otp";
105+
reg = <0xfe000 0x2000>;
106+
};
107+
};
108+
};
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*
2+
* Copyright (c) 2026 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*
6+
* SRAM layout override for nRF9151DK, replacing the generic nrf91xx_partition.dtsi
7+
* layout with the correct modem IPC shared memory layout.
8+
*/
9+
10+
/delete-node/ &sram0_s;
11+
/delete-node/ &sram0_ns;
12+
13+
&sram0 {
14+
/*
15+
* 0x2000_0000 Secure RAM ( 88 kB)
16+
* 0x2001_6000 Non-secure RAM area ( 168 kB)
17+
* 0x2001_6000 Modem shared area ( 34 kB)
18+
* 0x2001_6000 control (1832 B)
19+
* 0x2001_6728 app -> cell (8408 B)
20+
* 0x2001_8000 cell -> app ( 8 kB)
21+
* 0x2001_a800 trace ( 16 kB)
22+
* 0x2001_e800 Application RAM ( 134 kB)
23+
*/
24+
25+
sram0_s: sram@0 {
26+
reg = <0x0 0x16000>;
27+
};
28+
29+
sram0_ns: sram@16000 {
30+
reg = <0x16000 0x2a000>;
31+
#address-cells = <1>;
32+
#size-cells = <1>;
33+
ranges = <0x0 0x16000 0x2a000>;
34+
35+
/* Must be in first 128 kB of RAM. */
36+
sram0_ns_modem: sram0_ns@0 {
37+
/* Modem (shared) memory */
38+
reg = <0x0 0x8800>;
39+
#address-cells = <1>;
40+
#size-cells = <1>;
41+
ranges = <0x0 0x0 0x8800>;
42+
43+
cpuapp_cpucell_ipc_shm_ctrl: sram0_ns_modem@0 {
44+
/* Modem IPC control */
45+
reg = <0x0 0x728>;
46+
};
47+
48+
cpuapp_cpucell_ipc_shm_heap: sram0_ns_modem@728 {
49+
/* Modem IPC transmit */
50+
reg = <0x728 0x20d8>;
51+
};
52+
53+
cpucell_cpuapp_ipc_shm_heap: sram0_ns_modem@2800 {
54+
/* Modem IPC receive */
55+
reg = <0x2800 0x2000>;
56+
};
57+
58+
cpucell_cpuapp_ipc_shm_trace: sram0_ns_modem@4800 {
59+
/* Modem trace memory */
60+
reg = <0x4800 0x4000>;
61+
};
62+
63+
};
64+
65+
sram0_ns_app: sram0_ns@8800 {
66+
/* Non-Secure application memory */
67+
reg = <0x8800 0x21800>;
68+
};
69+
};
70+
};

app/overlay-full-fota.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ CONFIG_SPI_NOR=y
1212
# Full modem FOTA required settings
1313
CONFIG_DFU_TARGET_STREAM=y
1414
CONFIG_DFU_TARGET_FULL_MODEM=y
15+
# Uses the dedicated fmfu_storage partition defined in
16+
# overlay-partition-with-full-modem-fota.overlay (DTS-based, no Partition Manager).
17+
# DFU_TARGET_FULL_MODEM_USE_EXT_PARTITION defaults to y via PM_EXTERNAL_FLASH_ENABLED.
1518
CONFIG_FMFU_FDEV_SKIP_PREVALIDATION=n
1619
CONFIG_TFM_PROFILE_TYPE_NOT_SET=y
1720
CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include "boards/nrf9151dk_nrf9151_partition_full_modem_fota.dtsi"
2+
#include "boards/nrf9151dk_nrf9151_sram_full_modem_fota.dtsi"
3+
#include "boards/nrf9151dk_nrf9151_ext_flash_full_modem_fota.dtsi"

app/pm_static_nrf9151dk_nrf9151_ns_full_fota.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ mcuboot_primary_app:
8080
address: 0x20200
8181
end_address: 0x8A000
8282
region: flash_primary
83-
size: 0x89E00
83+
size: 0x69E00
8484
span:
8585
- app
8686
- tfm
@@ -93,9 +93,9 @@ mcuboot_secondary:
9393
size: 0x6A000
9494
mcuboot_sram:
9595
address: 0x20000000
96-
end_address: 0x20006000
96+
end_address: 0x20016000
9797
region: sram_primary
98-
size: 0x6000
98+
size: 0x16000
9999
span:
100100
- tfm_sram
101101
nonsecure_storage:

app/sysbuild.conf

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
#
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
6-
SB_CONFIG_SECURE_BOOT_APPCORE=y
7-
SB_CONFIG_BOOTLOADER_MCUBOOT=y
86

7+
# Disable the partition manager. Use DTS to define the flash and ram partitions.
8+
SB_CONFIG_PARTITION_MANAGER=n
9+
10+
# Enable immutable bootloader.
11+
SB_CONFIG_SECURE_BOOT_APPCORE=y
912
SB_CONFIG_SECURE_BOOT_NUM_VER_COUNTER_SLOTS=40
1013

11-
# Provide the keys to enable updating B1.
14+
# Enable updatable MCUboot bootloader.
15+
SB_CONFIG_BOOTLOADER_MCUBOOT=y
16+
17+
# Provide the keys to enable updating MCUboot and application.
1218
SB_CONFIG_BOOT_SIGNATURE_KEY_FILE="/home/mal6/ncs/_keys/mcuboot_priv.pem"
1319
SB_CONFIG_SECURE_BOOT_SIGNING_KEY_FILE="/home/mal6/ncs/_keys/nsib_priv.pem"

0 commit comments

Comments
 (0)