Skip to content

Commit 30dd558

Browse files
committed
app: Handle TFM config changes
TF-M/PSA configuration changed in nrfconnect/sdk-nrf#26777 TF-M default profile changed from CONFIG_TFM_PROFILE_TYPE_MINIMAL to CONFIG_TFM_PROFILE_TYPE_NOT_SET. SM will use minimal profile by default but basic profile (not set) is needed for SHA256 crypto for full modem fota support, which then also needs a different partition layout for TF-M. Signed-off-by: Tommi Rantanen <tommi.rantanen@nordicsemi.no>
1 parent 9fd252f commit 30dd558

File tree

6 files changed

+155
-3
lines changed

6 files changed

+155
-3
lines changed

app/overlay-full_fota.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ CONFIG_SPI_NOR=y
1313
CONFIG_DFU_TARGET_STREAM=y
1414
CONFIG_DFU_TARGET_FULL_MODEM=y
1515
CONFIG_FMFU_FDEV_SKIP_PREVALIDATION=n
16+
CONFIG_TFM_PROFILE_TYPE_NOT_SET=y
1617
CONFIG_MBEDTLS_LEGACY_CRYPTO_C=y
1718
CONFIG_MBEDTLS_SHA256_C=y
1819
CONFIG_FMFU_FDEV=y
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
# Partition manager configuration for full modem FOTA with
2+
# CONFIG_TFM_PROFILE_TYPE_NOT_SET.
3+
# TODO: PPP+CMUX doesn't fit with this configuration at the moment.
4+
# Partition table has to be optimized later.
5+
app:
6+
address: 0x38000
7+
end_address: 0x7e000
8+
placement:
9+
align:
10+
start: 0x8000
11+
region: flash_primary
12+
size: 0x46000
13+
mcuboot:
14+
address: 0x0
15+
end_address: 0x10000
16+
region: flash_primary
17+
size: 0x10000
18+
mcuboot_pad:
19+
address: 0x10000
20+
end_address: 0x10200
21+
placement:
22+
align:
23+
start: 0x8000
24+
region: flash_primary
25+
size: 0x200
26+
mcuboot_primary:
27+
address: 0x10000
28+
end_address: 0x86000
29+
region: flash_primary
30+
sharers: 0x1
31+
size: 0x76000
32+
span:
33+
- tfm
34+
- app
35+
- mcuboot_pad
36+
mcuboot_primary_app:
37+
address: 0x10200
38+
end_address: 0x86000
39+
region: flash_primary
40+
size: 0x75e00
41+
span:
42+
- app
43+
- tfm
44+
mcuboot_secondary:
45+
address: 0x86000
46+
end_address: 0xfc000
47+
region: flash_primary
48+
share_size:
49+
- mcuboot_primary
50+
size: 0x76000
51+
mcuboot_sram:
52+
address: 0x20000000
53+
end_address: 0x20006000
54+
region: sram_primary
55+
size: 0x6000
56+
span:
57+
- tfm_sram
58+
nonsecure_storage:
59+
address: 0xfc000
60+
end_address: 0x100000
61+
region: flash_primary
62+
size: 0x4000
63+
span:
64+
- settings_storage
65+
otp:
66+
address: 0xff8108
67+
end_address: 0xff83fc
68+
region: otp
69+
size: 0x2f4
70+
settings_storage:
71+
address: 0xfc000
72+
end_address: 0x100000
73+
inside:
74+
- nonsecure_storage
75+
region: flash_primary
76+
size: 0x4000
77+
sram_secure:
78+
address: 0x20000000
79+
end_address: 0x20016000
80+
region: sram_primary
81+
size: 0x16000
82+
span:
83+
- tfm_sram
84+
tfm:
85+
address: 0x10200
86+
end_address: 0x38000
87+
inside:
88+
- mcuboot_primary_app
89+
region: flash_primary
90+
size: 0x27e00
91+
tfm_its:
92+
address: 0x7e000
93+
end_address: 0x80000
94+
inside:
95+
- tfm_storage
96+
region: flash_primary
97+
size: 0x2000
98+
tfm_nonsecure:
99+
address: 0x38000
100+
end_address: 0x7e000
101+
placement:
102+
align:
103+
start: 0x8000
104+
region: flash_primary
105+
size: 0x46000
106+
span:
107+
- app
108+
tfm_otp_nv_counters:
109+
address: 0x80000
110+
end_address: 0x82000
111+
inside:
112+
- tfm_storage
113+
region: flash_primary
114+
size: 0x2000
115+
tfm_ps:
116+
address: 0x82000
117+
end_address: 0x86000
118+
inside:
119+
- tfm_storage
120+
region: flash_primary
121+
size: 0x4000
122+
tfm_secure:
123+
address: 0x10200
124+
end_address: 0x38000
125+
region: flash_primary
126+
size: 0x27e00
127+
span:
128+
- tfm
129+
tfm_sram:
130+
address: 0x20000000
131+
end_address: 0x20016000
132+
inside:
133+
- sram_secure
134+
region: sram_primary
135+
size: 0x16000
136+
tfm_storage:
137+
address: 0x7e000
138+
end_address: 0x86000
139+
region: flash_primary
140+
size: 0x8000
141+
span:
142+
- tfm_its
143+
- tfm_otp_nv_counters
144+
- tfm_ps

app/prj.conf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,9 @@ CONFIG_AT_MONITOR=y
117117
# Eventfd's to use with AT-commands.
118118
CONFIG_ZVFS_EVENTFD_MAX=2
119119

120-
# Disable TF-M logging.
121-
# TF-M log sending will block until remote end is ready, when HWFC is used on UART1.
120+
# TF-M
121+
CONFIG_TFM_PROFILE_TYPE_MINIMAL=y
122+
# Disable TF-M log sending as it will block until remote end is ready, when HWFC is used on UART1.
122123
CONFIG_TFM_LOG_LEVEL_SILENCE=y
123124

124125
#

app/sample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ tests:
123123
build_only: true
124124
extra_args:
125125
- EXTRA_CONF_FILE="overlay-full_fota.conf"
126+
- PM_STATIC_YML_FILE=pm_static_nrf9151dk_nrf9151_ns_full_fota.yml
126127
extra_configs:
127128
- CONFIG_SM_DFU_MODEM_FULL=y
128129
platform_allow:

doc/app/at_fota.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ Syntax
3333
* ``1`` - Start FOTA for application update.
3434
* ``2`` - Start FOTA for modem delta update.
3535
* ``3`` - Start FOTA for full modem update.
36-
Can only be used when the :file:`overlay-full_fota.conf` configuration file is used.
36+
Can only be used when the :file:`overlay-full_fota.conf` configuration file and
37+
:file:`PM_STATIC_YML_FILE=pm_static_nrf9151dk_nrf9151_ns_full_fota.yml` compile option are used.
3738

3839
Not supported on the Thingy:91 X.
3940

doc/app/sm_configuration.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,5 +307,9 @@ The following configuration files are provided:
307307
This is needed when capturing modem traces and application debug logs simultaneously.
308308
See the :ref:`sm_logging` documentation for more information.
309309

310+
* :file:`pm_static_nrf9151dk_nrf9151_ns_full_fota.yml` - Partition manager static configuration for full modem FOTA functionality.
311+
Use PM_STATIC_YML_FILE=pm_static_nrf9151dk_nrf9151_ns_full_fota.yml compile option to add this file into the build.
312+
See the :ref:`SM_AT_FOTA` for more information.
313+
310314
The board-specific devicetree overlays (:file:`boards/*.overlay`) set up configurations that are specific to each supported development kit.
311315
All of them configure the DTR to be deasserted from a button and RI to blink an LED.

0 commit comments

Comments
 (0)