Skip to content

Commit 4ad9786

Browse files
maxd-nordicrlubos
authored andcommitted
boards: thingy91x: partitions rework
* add special use partition tables * make sure the correct partition table is selected for each variant Signed-off-by: Maximilian Deubel <[email protected]>
1 parent 7bda400 commit 4ad9786

11 files changed

+506
-27
lines changed

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
/boards/nordic/nrf7120pdk/ @nrfconnect/ncs-co-boards @rob-robinson-14 @Hi-Im-David
5252
/boards/nordic/nrf54l*/ @nrfconnect/ncs-co-boards @kl-cruz
5353
/boards/nordic/nrf52* @nrfconnect/ncs-co-boards @nrfconnect/ncs-si-bluebagel
54-
/boards/nordic/thingy91* @nrfconnect/ncs-co-boards @nrfconnect/ncs-cia
54+
/boards/nordic/thingy91*/ @nrfconnect/ncs-co-boards @nrfconnect/ncs-cia
5555
/boards/shields/coverage_support/ @nrfconnect/ncs-low-level-test
5656
/boards/shields/nrf2220ek/ @nrfconnect/ncs-radio-sw
5757
/boards/shields/nrf2240ek/ @nrfconnect/ncs-radio-sw

boards/nordic/thingy91x/CMakeLists.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,9 @@ if(CONFIG_WIFI_NRF70)
1010
endif()
1111
endif()
1212

13-
if(CONFIG_BOARD_THINGY91X_NRF9151_NS)
14-
# Use static partition layout to ensure the partition layout remains
15-
# unchanged after DFU. This needs to be made globally available
16-
# because it is used in other CMake files.
17-
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_nrf9151_pm_static.yml CACHE INTERNAL "")
18-
endif()
19-
2013
# If the BMM350 driver is not used, use a minimal initialization instead to save power.
2114
# Once a driver is available in the Zephyr tree, this can be removed.
2215
if (CONFIG_SENSOR AND CONFIG_REGULATOR AND CONFIG_I2C AND NOT CONFIG_BMM350)
2316
zephyr_library_named(bmm350_init_minimal)
2417
zephyr_library_sources(bmm350_init_minimal.c)
2518
endif()
26-
27-
if(CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP OR CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP_NS)
28-
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_nrf5340_pm_static.yml CACHE INTERNAL "")
29-
endif()

boards/nordic/thingy91x/sysbuild.cmake

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

7+
# Use static partition layout to ensure the partition layout remains
8+
# unchanged after DFU. This needs to be made globally available
9+
# because it is used in other CMake files.
10+
11+
# nRF91 with TF-M (default)
712
if(SB_CONFIG_BOARD_THINGY91X_NRF9151_NS)
8-
# Use static partition layout to ensure the partition layout remains
9-
# unchanged after DFU. This needs to be made globally available
10-
# because it is used in other CMake files.
1113
if(SB_CONFIG_THINGY91X_STATIC_PARTITIONS_FACTORY)
14+
# most common configuration, nRF91 uses external flash
1215
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_nrf9151_pm_static.yml CACHE INTERNAL "")
16+
elseif(SB_CONFIG_THINGY91X_STATIC_PARTITIONS_NRF53_EXTERNAL_FLASH)
17+
# special config where nRF91 is not using external flash
18+
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_nrf9151_pm_static_no_ext_flash.yml CACHE INTERNAL "")
19+
endif()
20+
endif()
21+
22+
# nRF91 without TF-M (special use)
23+
if(SB_CONFIG_BOARD_THINGY91X_NRF9151)
24+
if(SB_CONFIG_THINGY91X_STATIC_PARTITIONS_FACTORY)
25+
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_nrf9151_pm_static_no_tfm.yml CACHE INTERNAL "")
26+
elseif(SB_CONFIG_THINGY91X_STATIC_PARTITIONS_NRF53_EXTERNAL_FLASH)
27+
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_nrf9151_pm_static_no_ext_flash_no_tfm.yml CACHE INTERNAL "")
28+
endif()
29+
endif()
30+
31+
# nRF53 without TF-M (default)
32+
if(SB_CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP)
33+
if(SB_CONFIG_THINGY91X_STATIC_PARTITIONS_FACTORY)
34+
# most common configuration, nRF53 is not using external flash
35+
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_nrf5340_pm_static_no_tfm.yml CACHE INTERNAL "")
36+
endif()
37+
if(SB_CONFIG_THINGY91X_STATIC_PARTITIONS_NRF53_EXTERNAL_FLASH)
38+
# special config where nRF53 is using external flash
39+
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_nrf5340_pm_static_ext_flash_no_tfm.yml CACHE INTERNAL "")
1340
endif()
1441
endif()
1542

16-
if(SB_CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP OR SB_CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP_NS)
43+
# nRF53 with TF-M (special use)
44+
if(SB_CONFIG_BOARD_THINGY91X_NRF5340_CPUAPP_NS)
1745
if(SB_CONFIG_THINGY91X_STATIC_PARTITIONS_FACTORY)
1846
set(PM_STATIC_YML_FILE ${CMAKE_CURRENT_LIST_DIR}/thingy91x_nrf5340_pm_static.yml CACHE INTERNAL "")
1947
endif()

boards/nordic/thingy91x/thingy91x_nrf5340_pm_static.yml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,25 +44,38 @@ s1_image:
4444
mcuboot_primary:
4545
address: 0x30000
4646
size: 0x44000
47-
span: [mcuboot_pad, app]
47+
span: [mcuboot_pad, app, tfm]
4848
region: flash_primary
49+
tfm_secure:
50+
address: 0x30000
51+
size: 0x8000
52+
span: [mcuboot_pad, tfm]
4953
mcuboot_pad:
5054
address: 0x30000
5155
size: 0x200
5256
region: flash_primary
5357
mcuboot_primary_app:
5458
address: 0x30200
5559
size: 0x43e00
56-
span: [app]
60+
span: [tfm, app]
5761
region: flash_primary
5862
app_image:
5963
address: 0x30200
6064
size: 0x43e00
65+
span: [tfm, app]
66+
region: flash_primary
67+
tfm:
68+
address: 0x30200
69+
size: 0x7e00
70+
region: flash_primary
71+
tfm_nonsecure:
72+
address: 0x38000
73+
size: 0x3c000
6174
span: [app]
6275
region: flash_primary
6376
app:
64-
address: 0x30200
65-
size: 0x43e00
77+
address: 0x38000
78+
size: 0x3c000
6679
region: flash_primary
6780
mcuboot_secondary:
6881
address: 0x74000

boards/nordic/thingy91x/thingy91x_nrf5340_pm_static_ext_flash.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,13 @@ s1_image:
4343
region: flash_primary
4444
mcuboot_primary:
4545
address: 0x30000
46-
size: 0xD0000
47-
span: [mcuboot_pad, app]
46+
size: 0xcc000
47+
span: [mcuboot_pad, app, tfm]
48+
region: flash_primary
49+
tfm_secure:
50+
address: 0x30000
51+
size: 0x8000
52+
span: [mcuboot_pad, tfm]
4853
region: flash_primary
4954
mcuboot_pad:
5055
address: 0x30000
@@ -53,16 +58,24 @@ mcuboot_pad:
5358
mcuboot_primary_app:
5459
address: 0x30200
5560
size: 0xcbe00
56-
span: [app]
61+
span: [tfm, app]
5762
region: flash_primary
5863
app_image:
5964
address: 0x30200
6065
size: 0xcbe00
61-
span: [app]
66+
span: [tfm, app]
6267
region: flash_primary
63-
app:
68+
tfm:
6469
address: 0x30200
65-
size: 0xcbe00
70+
size: 0x7e00
71+
region: flash_primary
72+
tfm_nonsecure:
73+
address: 0x38000
74+
size: 0xc8000
75+
region: flash_primary
76+
app:
77+
address: 0x38000
78+
size: 0xc4000
6679
region: flash_primary
6780
settings_storage:
6881
address: 0xfc000
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
b0:
2+
address: 0x0
3+
size: 0x8000
4+
region: flash_primary
5+
b0_container:
6+
address: 0x0
7+
size: 0x8000
8+
region: flash_primary
9+
span: [b0]
10+
s0:
11+
address: 0x8000
12+
size: 0x14000
13+
span: [mcuboot, s0_pad]
14+
region: flash_primary
15+
s0_pad:
16+
address: 0x8000
17+
size: 0x200
18+
share_size: [mcuboot_pad]
19+
region: flash_primary
20+
s0_image:
21+
address: 0x8200
22+
size: 0x13e00
23+
span: [mcuboot]
24+
region: flash_primary
25+
mcuboot:
26+
address: 0x8200
27+
size: 0x13e00
28+
region: flash_primary
29+
s1:
30+
address: 0x1c000
31+
size: 0x14000
32+
span: [s1_pad, s1_image]
33+
region: flash_primary
34+
s1_pad:
35+
address: 0x1c000
36+
size: 0x200
37+
region: flash_primary
38+
share_size: [mcuboot_pad]
39+
s1_image:
40+
address: 0x1c200
41+
size: 0x13e00
42+
share_size: [mcuboot]
43+
region: flash_primary
44+
mcuboot_primary:
45+
address: 0x30000
46+
size: 0xcc000
47+
span: [mcuboot_pad, app]
48+
region: flash_primary
49+
mcuboot_pad:
50+
address: 0x30000
51+
size: 0x200
52+
region: flash_primary
53+
mcuboot_primary_app:
54+
address: 0x30200
55+
size: 0xcbe00
56+
span: [app]
57+
region: flash_primary
58+
app_image:
59+
address: 0x30200
60+
size: 0xcbe00
61+
span: [app]
62+
region: flash_primary
63+
app:
64+
address: 0x30200
65+
size: 0xcbe00
66+
region: flash_primary
67+
settings_storage:
68+
address: 0xfc000
69+
size: 0x4000
70+
region: flash_primary
71+
72+
external_flash:
73+
device: DT_CHOSEN(nordic_pm_ext_flash)
74+
address: 0x0
75+
size: 0x2000000
76+
span: [mcuboot_secondary]
77+
region: external_flash
78+
mcuboot_secondary:
79+
device: DT_CHOSEN(nordic_pm_ext_flash)
80+
address: 0x0
81+
size: 0xcc000
82+
share_size: [mcuboot_primary]
83+
region: external_flash
84+
mcuboot_secondary_1:
85+
address: 0xcc000
86+
size: 0x40000
87+
device: DT_CHOSEN(nordic_pm_ext_flash)
88+
region: external_flash
89+
pcd_sram:
90+
address: 0x20000000
91+
size: 0x2000
92+
region: sram_primary
93+
sram_retained_mem:
94+
region: sram_primary
95+
address: 0x2007FC00
96+
size: 0x400
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
b0:
2+
address: 0x0
3+
size: 0x8000
4+
region: flash_primary
5+
b0_container:
6+
address: 0x0
7+
size: 0x8000
8+
region: flash_primary
9+
span: [b0]
10+
s0:
11+
address: 0x8000
12+
size: 0x14000
13+
span: [mcuboot, s0_pad]
14+
region: flash_primary
15+
s0_pad:
16+
address: 0x8000
17+
size: 0x200
18+
share_size: [mcuboot_pad]
19+
region: flash_primary
20+
s0_image:
21+
address: 0x8200
22+
size: 0x13e00
23+
span: [mcuboot]
24+
region: flash_primary
25+
mcuboot:
26+
address: 0x8200
27+
size: 0x13e00
28+
region: flash_primary
29+
s1:
30+
address: 0x1c000
31+
size: 0x14000
32+
span: [s1_pad, s1_image]
33+
region: flash_primary
34+
s1_pad:
35+
address: 0x1c000
36+
size: 0x200
37+
region: flash_primary
38+
share_size: [mcuboot_pad]
39+
s1_image:
40+
address: 0x1c200
41+
size: 0x13e00
42+
share_size: [mcuboot]
43+
region: flash_primary
44+
mcuboot_primary:
45+
address: 0x30000
46+
size: 0x44000
47+
span: [mcuboot_pad, app]
48+
region: flash_primary
49+
mcuboot_pad:
50+
address: 0x30000
51+
size: 0x200
52+
region: flash_primary
53+
mcuboot_primary_app:
54+
address: 0x30200
55+
size: 0x43e00
56+
span: [app]
57+
region: flash_primary
58+
app_image:
59+
address: 0x30200
60+
size: 0x43e00
61+
span: [app]
62+
region: flash_primary
63+
app:
64+
address: 0x30200
65+
size: 0x43e00
66+
region: flash_primary
67+
mcuboot_secondary:
68+
address: 0x74000
69+
size: 0x44000
70+
region: flash_primary
71+
mcuboot_secondary_1:
72+
address: 0xB8000
73+
region: flash_primary
74+
size: 0x40000
75+
settings_storage:
76+
address: 0xf8000
77+
size: 0x8000
78+
region: flash_primary
79+
pcd_sram:
80+
address: 0x20000000
81+
size: 0x2000
82+
region: sram_primary
83+
sram_retained_mem:
84+
region: sram_primary
85+
address: 0x2007FC00
86+
size: 0x400
87+
mcuboot_primary_1:
88+
address: 0x0
89+
region: ram_flash
90+
size: 0x40000

0 commit comments

Comments
 (0)