Skip to content

Commit 735afa5

Browse files
ktaborowskinordicjm
authored andcommitted
tests: align mcuboot configuration in test app
[KRKNWK-19763] Signed-off-by: Krzysztof Taborowski <[email protected]>
1 parent f5dc3f7 commit 735afa5

12 files changed

+191
-114
lines changed

tests/manual/simple_bootloader/Kconfig.sysbuild

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ endchoice
1010

1111
if BOOTLOADER_MCUBOOT
1212

13+
# Downgrade prevention
14+
choice MCUBOOT_MODE
15+
default MCUBOOT_MODE_OVERWRITE_ONLY
16+
endchoice
17+
1318
config DFU_MULTI_IMAGE_PACKAGE_BUILD
1419
default y
1520

@@ -27,10 +32,6 @@ config NRF_DEFAULT_EMPTY
2732
config MCUBOOT_UPDATEABLE_IMAGES
2833
default 2
2934

30-
choice MCUBOOT_MODE
31-
default MCUBOOT_MODE_OVERWRITE_ONLY
32-
endchoice
33-
3435
choice BOOT_SIGNATURE_TYPE
3536
default BOOT_SIGNATURE_TYPE_RSA
3637
endchoice
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# Copyright (c) 2024 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
CONFIG_POWEROFF=y
8+
9+
# nRF54L15DK uses SPI NOR external flash for DFU
10+
CONFIG_FLASH=y
11+
CONFIG_SPI=y
12+
CONFIG_SPI_NOR=y
13+
CONFIG_MULTITHREADING=y
14+
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
15+
CONFIG_MCUMGR_GRP_IMG_ALLOW_ERASE_PENDING=y

tests/manual/simple_bootloader/boards/nrf54l15dk_nrf54l10_cpuapp.overlay

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
*
44
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
*/
6-
7-
8-
/* Application does not use cpuflpr core. Assign whole RRAM to cpuapp. */
96
&cpuapp_rram {
107
reg = <0x0 DT_SIZE_K(1024)>;
118
};
@@ -14,3 +11,18 @@
1411
reg = <0x20000000 DT_SIZE_K(192)>;
1512
ranges = <0x0 0x20000000 DT_SIZE_K(192)>;
1613
};
14+
15+
/ {
16+
chosen {
17+
nordic,pm-ext-flash = &mx25r64;
18+
};
19+
};
20+
21+
&mx25r64 {
22+
status = "okay";
23+
};
24+
25+
// TODO: re-enable HWFC once it's fixed
26+
&uart20 {
27+
/delete-property/ hw-flow-control;
28+
};

tests/manual/simple_bootloader/pm_static_nrf54l15dk_nrf54l10_cpuapp.yml

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,51 @@
11
app:
2-
address: 0xc800
3-
end_address: 0x84800
2+
address: 0xd800
3+
end_address: 0xfd000
44
region: flash_primary
5-
size: 0x78000
5+
size: 0xef800
66
mcuboot:
77
address: 0x0
8-
end_address: 0xc000
8+
end_address: 0xd000
99
placement:
1010
before:
1111
- mcuboot_primary
1212
region: flash_primary
13-
size: 0xc000
13+
size: 0xd000
1414
mcuboot_pad:
15-
address: 0xc000
16-
end_address: 0xc800
15+
address: 0xd000
16+
end_address: 0xd800
1717
placement:
1818
before:
1919
- mcuboot_primary_app
2020
region: flash_primary
2121
size: 0x800
2222
mcuboot_primary:
23-
address: 0xc000
24-
end_address: 0x84800
23+
address: 0xd000
24+
end_address: 0xfd000
2525
orig_span: &id001
2626
- mcuboot_pad
2727
- app
2828
region: flash_primary
29-
sharers: 0x1
30-
size: 0x78800
29+
size: 0xf0000
3130
span: *id001
3231
mcuboot_primary_app:
33-
address: 0xc800
34-
end_address: 0x84800
32+
address: 0xd800
33+
end_address: 0xfd000
3534
orig_span: &id002
3635
- app
3736
region: flash_primary
38-
size: 0x78000
37+
size: 0xef800
3938
span: *id002
4039
mcuboot_secondary:
41-
address: 0x84800
42-
end_address: 0xfd000
40+
address: 0x0
41+
end_address: 0xf0000
4342
placement:
44-
after:
45-
- mcuboot_primary
4643
align:
47-
start: 0x1000
48-
region: flash_primary
44+
start: 0x4
45+
region: external_flash
4946
share_size:
5047
- mcuboot_primary
51-
size: 0x78800
48+
size: 0xf0000
5249
mfg_storage:
5350
address: 0xff000
5451
end_address: 0x100000
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# Copyright (c) 2023 Nordic Semiconductor ASA
3+
#
4+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
#
6+
7+
# Configure QSPI for external flash
8+
CONFIG_NORDIC_QSPI_NOR=y
9+
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
10+
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
11+
12+
# Disable the Flash Patch and Breakpoint (FPB) feature
13+
# to increase the security of the device.
14+
CONFIG_DISABLE_FLASH_PATCH=y
15+
CONFIG_REBOOT=y

tests/manual/simple_bootloader/sysbuild/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.conf

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,4 @@ CONFIG_FLASH_SIMULATOR=y
2222
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
2323
CONFIG_FLASH_SIMULATOR_STATS=n
2424

25-
# Enable custom command to erase settings partition.
26-
CONFIG_ENABLE_MGMT_PERUSER=y
2725
CONFIG_ZCBOR=y
28-
CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y
Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,37 @@
11
#
2-
# Copyright (c) 2021 Nordic Semiconductor ASA
2+
# Copyright (c) 2024 Nordic Semiconductor ASA
33
#
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

77
# TODO: NCSDK-28931: Cannot use fprotect twice, so disable it in MCUboot to
8-
# test protecting Matter factory data. It can be enabled while there is a support
8+
# test protecting factory data. It can be enabled while there is a support
99
# for protection more than one region.
1010
CONFIG_FPROTECT=n
11+
1112
# TODO: Workaround, disable memory guard to avoid false faults in application after boot
1213
CONFIG_HW_STACK_PROTECTION=n
1314

14-
CONFIG_BOOT_WATCHDOG_FEED=n
15-
16-
# Disable all debug features
17-
CONFIG_USE_SEGGER_RTT=n
18-
CONFIG_SHELL=n
19-
CONFIG_OPENTHREAD_SHELL=n
20-
CONFIG_CONSOLE=n
21-
CONFIG_UART_CONSOLE=n
22-
CONFIG_SERIAL=n
23-
CONFIG_LOG=n
24-
CONFIG_LOG_MODE_MINIMAL=n
25-
CONFIG_ASSERT_VERBOSE=n
26-
CONFIG_ASSERT_NO_FILE_INFO=y
27-
CONFIG_PRINTK=n
28-
CONFIG_PRINTK_SYNC=n
29-
CONFIG_THREAD_NAME=n
30-
CONFIG_BOOT_BANNER=n
31-
32-
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
33-
34-
# Ensure that the qspi driver is disabled by default
35-
CONFIG_GPIO=n
36-
CONFIG_SPI=n
37-
CONFIG_SPI_NOR=n
38-
CONFIG_NORDIC_QSPI_NOR=n
39-
CONFIG_MULTITHREADING=n
40-
41-
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
42-
43-
44-
# Workaroud: fprotect and watchdog feed
45-
# are not supported in NCS v2.6.0
46-
CONFIG_FPROTECT=n
47-
CONFIG_BOOT_WATCHDOG_FEED=n
48-
4915
# Currently, without tickless kernel, the SYSCOUNTER value after the software
5016
# reset is not set properly and due to that the first system interrupt is not called
5117
# in the proper time - the SYSCOUNTER value is set to the value from before
5218
# reset + 1. Hence, the reboot time increases more and more.
5319
# To avoid it enable tickles kernel for mcuboot.
5420
CONFIG_TICKLESS_KERNEL=y
21+
22+
CONFIG_BOOT_WATCHDOG_FEED=n
23+
24+
# nRF54L15DK uses SPI NOR external flash
25+
CONFIG_GPIO=y
26+
CONFIG_SPI=y
27+
CONFIG_SPI_NOR=y
28+
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
29+
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
30+
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
31+
32+
# required by SPI driver
33+
CONFIG_MULTITHREADING=y
34+
35+
# Activate LTO
36+
CONFIG_LTO=y
37+
CONFIG_ISR_TABLES_LOCAL_DECLARATION=y

tests/manual/simple_bootloader/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l10_cpuapp.overlay

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

7+
/ {
8+
chosen {
9+
nordic,pm-ext-flash = &mx25r64;
10+
};
11+
};
712

8-
/* Application does not use cpuflpr core. Assign whole RRAM to cpuapp. */
13+
/* Application does not use cpuflpr core. Assign whole RRAM and RAM to cpuapp. */
914
&cpuapp_rram {
1015
reg = <0x0 DT_SIZE_K(1024)>;
1116
};
@@ -14,3 +19,7 @@
1419
reg = <0x20000000 DT_SIZE_K(192)>;
1520
ranges = <0x0 0x20000000 DT_SIZE_K(192)>;
1621
};
22+
23+
&mx25r64 {
24+
status = "okay";
25+
};
Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,29 @@
11
#
2-
# Copyright (c) 2021 Nordic Semiconductor ASA
2+
# Copyright (c) 2024 Nordic Semiconductor ASA
33
#
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

77
# TODO: NCSDK-28931: Cannot use fprotect twice, so disable it in MCUboot to
8-
# test protecting Matter factory data. It can be enabled while there is a support
8+
# test protecting factory data. It can be enabled while there is a support
99
# for protection more than one region.
1010
CONFIG_FPROTECT=n
11+
1112
# TODO: Workaround, disable memory guard to avoid false faults in application after boot
1213
CONFIG_HW_STACK_PROTECTION=n
1314

14-
CONFIG_BOOT_WATCHDOG_FEED=n
15+
# Currently, without tickless kernel, the SYSCOUNTER value after the software
16+
# reset is not set properly and due to that the first system interrupt is not called
17+
# in the proper time - the SYSCOUNTER value is set to the value from before
18+
# reset + 1. Hence, the reboot time increases more and more.
19+
# To avoid it enable tickles kernel for mcuboot.
20+
CONFIG_TICKLESS_KERNEL=y
1521

16-
# Disable all debug features
17-
CONFIG_USE_SEGGER_RTT=n
18-
CONFIG_SHELL=n
19-
CONFIG_OPENTHREAD_SHELL=n
20-
CONFIG_CONSOLE=n
21-
CONFIG_UART_CONSOLE=n
22-
CONFIG_SERIAL=n
23-
CONFIG_LOG=n
24-
CONFIG_LOG_MODE_MINIMAL=n
25-
CONFIG_ASSERT_VERBOSE=n
26-
CONFIG_ASSERT_NO_FILE_INFO=y
27-
CONFIG_PRINTK=n
28-
CONFIG_PRINTK_SYNC=n
29-
CONFIG_THREAD_NAME=n
30-
CONFIG_BOOT_BANNER=n
22+
CONFIG_BOOT_WATCHDOG_FEED=n
3123

3224
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
3325

3426
# Ensure that the qspi driver is disabled by default
35-
CONFIG_GPIO=n
3627
CONFIG_SPI=n
3728
CONFIG_SPI_NOR=n
3829
CONFIG_NORDIC_QSPI_NOR=n
39-
CONFIG_MULTITHREADING=n
40-
41-
CONFIG_PM_OVERRIDE_EXTERNAL_DRIVER_CHECK=y
42-
43-
44-
# Workaroud: fprotect and watchdog feed
45-
# are not supported in NCS v2.6.0
46-
CONFIG_FPROTECT=n
47-
CONFIG_BOOT_WATCHDOG_FEED=n
48-
49-
# Currently, without tickless kernel, the SYSCOUNTER value after the software
50-
# reset is not set properly and due to that the first system interrupt is not called
51-
# in the proper time - the SYSCOUNTER value is set to the value from before
52-
# reset + 1. Hence, the reboot time increases more and more.
53-
# To avoid it enable tickles kernel for mcuboot.
54-
CONFIG_TICKLESS_KERNEL=y

tests/manual/simple_bootloader/sysbuild/mcuboot/boards/nrf54l15dk_nrf54l15_cpuapp.overlay

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77

8-
/* Application does not use cpuflpr core. Assign whole RRAM to cpuapp. */
8+
/* Application does not use cpuflpr core. Assign whole RRAM and RAM to cpuapp. */
99
&cpuapp_rram {
1010
reg = < 0x0 DT_SIZE_K(1524) >;
1111
};
@@ -14,3 +14,35 @@
1414
reg = <0x20000000 DT_SIZE_K(256)>;
1515
ranges = <0x0 0x20000000 0x40000>;
1616
};
17+
18+
&adc {
19+
status = "disabled";
20+
};
21+
&uart21 {
22+
status = "disabled";
23+
};
24+
&pwm20 {
25+
status = "disabled";
26+
};
27+
&i2c20 {
28+
status = "disabled";
29+
};
30+
&spi00 {
31+
status = "disabled";
32+
};
33+
&spi20 {
34+
status = "disabled";
35+
};
36+
&spi21 {
37+
status = "disabled";
38+
};
39+
&spi22 {
40+
status = "disabled";
41+
};
42+
43+
/* Disable the external flash, as it's not needed
44+
for the configuration with secondary slot residing
45+
in the internal MRAM. */
46+
&mx25r64 {
47+
status = "disabled";
48+
};

0 commit comments

Comments
 (0)