Skip to content

Commit cc14948

Browse files
nordic-mik7nordicjm
authored andcommitted
tests: nrf_compress: Add nrf54h20 test support
This commit provides support for the nrf54h20dk board in the nrf_compress decompression tests. Additional changes: - 'main.c' - support no Partition Manager builds - 'Kconfig' - clarify the meaning of the 'CONFIG_UPDATE_IMAGE_NUMBER' option, which is used to select the image to be updated in the mcuboot_update test. Also, no more than two images are needed. Related: NCSDK-33627 Signed-off-by: Michal Kozikowski <[email protected]>
1 parent 3e30633 commit cc14948

File tree

9 files changed

+82
-8
lines changed

9 files changed

+82
-8
lines changed

tests/subsys/nrf_compress/decompression/arm_thumb/testcase.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@ common:
1111
- nrf52840dk/nrf52840
1212
- nrf5340dk/nrf5340/cpuapp
1313
- nrf5340dk/nrf5340/cpuapp/ns
14+
- nrf54h20dk/nrf54h20/cpuapp
1415
integration_platforms:
1516
- native_sim
1617
- nrf52840dk/nrf52840
1718
- nrf5340dk/nrf5340/cpuapp
1819
- nrf5340dk/nrf5340/cpuapp/ns
20+
- nrf54h20dk/nrf54h20/cpuapp
1921
tests:
2022
nrf_compress.decompression.arm_thumb.static: {}

tests/subsys/nrf_compress/decompression/lzma/testcase.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ common:
1111
- nrf52840dk/nrf52840
1212
- nrf5340dk/nrf5340/cpuapp
1313
- nrf5340dk/nrf5340/cpuapp/ns
14+
- nrf54h20dk/nrf54h20/cpuapp
1415
integration_platforms:
1516
- native_sim
1617
- nrf52840dk/nrf52840
1718
- nrf5340dk/nrf5340/cpuapp
1819
- nrf5340dk/nrf5340/cpuapp/ns
20+
- nrf54h20dk/nrf54h20/cpuapp
1921
tests:
2022
nrf_compress.decompression.lzma.static: {}
2123
nrf_compress.decompression.lzma.dynamic:

tests/subsys/nrf_compress/decompression/mcuboot_update/Kconfig

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

7-
config UPDATE_SLOT_NUMBER
7+
config UPDATE_IMAGE_NUMBER
88
int "Image update number"
9-
range 0 3
9+
range 0 1
1010
default 0
1111
help
1212
Should be set to the image containing the firmware to mark for upgrade
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
/ {
8+
chosen {
9+
zephyr,code-partition = &cpuapp_slot0_partition;
10+
};
11+
};
12+
13+
/delete-node/ &cpuapp_slot0_partition;
14+
/delete-node/ &cpuapp_slot1_partition;
15+
16+
&mram1x {
17+
partitions {
18+
cpuapp_slot0_partition: partition@40000 {
19+
reg = <0x40000 DT_SIZE_K(580)>;
20+
};
21+
22+
cpuapp_slot1_partition: partition@D1000 {
23+
reg = <0xD1000 DT_SIZE_K(580)>;
24+
};
25+
};
26+
};
27+
28+
slot0_partition: &cpuapp_slot0_partition {
29+
label = "image-0";
30+
};
31+
32+
slot1_partition: &cpuapp_slot1_partition {
33+
label = "image-1";
34+
};

tests/subsys/nrf_compress/decompression/mcuboot_update/modified_signing.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,7 @@ set_property(GLOBAL APPEND PROPERTY extra_post_build_commands COMMAND
1515
${CMAKE_OBJCOPY} -I ihex -O ihex --change-addresses 0x91000
1616
${ZEPHYR_BINARY_DIR}/${KERNEL_NAME}.signed.hex ${output})
1717
set_property(GLOBAL APPEND PROPERTY extra_post_build_byproducts ${output})
18+
19+
if(NOT SB_CONFIG_PARTITION_MANAGER)
20+
zephyr_runner_file(hex ${ZEPHYR_BINARY_DIR}/${KERNEL_NAME}.moved.signed.hex)
21+
endif()

tests/subsys/nrf_compress/decompression/mcuboot_update/src/main.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,22 @@
1313
#include <zephyr/sys/byteorder.h>
1414

1515
#include <bootutil/image.h>
16+
#include <zephyr/devicetree.h>
1617

1718
LOG_MODULE_REGISTER(mcuboot_update, LOG_LEVEL_DBG);
1819

19-
#define UPDATE_SLOT_NUMBER CONFIG_UPDATE_SLOT_NUMBER
20-
21-
#if CONFIG_UPDATE_SLOT_NUMBER == 0
20+
#if defined(CONFIG_PARTITION_MANAGER_ENABLED)
21+
#if CONFIG_UPDATE_IMAGE_NUMBER == 0
2222
#define UPDATE_SLOT_ID PM_MCUBOOT_SECONDARY_ID
2323
#else
24-
#define UPDATE_SLOT_ID PM_MCUBOOT_SECONDARY_ ## CONFIG_UPDATE_SLOT_NUMBER ## _ID
24+
#define UPDATE_SLOT_ID PM_MCUBOOT_SECONDARY_ ## CONFIG_UPDATE_IMAGE_NUMBER ## _ID
25+
#endif
26+
#else
27+
#if CONFIG_UPDATE_IMAGE_NUMBER == 0
28+
#define UPDATE_SLOT_ID DT_FIXED_PARTITION_ID(DT_NODELABEL(slot1_partition))
29+
#else
30+
#define UPDATE_SLOT_ID DT_FIXED_PARTITION_ID(DT_NODELABEL(slot3_partition))
31+
#endif
2532
#endif
2633

2734
int main(void)
@@ -64,10 +71,10 @@ int main(void)
6471
return 0;
6572
}
6673

67-
rc = boot_request_upgrade_multi(UPDATE_SLOT_NUMBER, true);
74+
rc = boot_request_upgrade_multi(CONFIG_UPDATE_IMAGE_NUMBER, true);
6875

6976
if (rc) {
70-
LOG_ERR("Update of image %d failed: %d", UPDATE_SLOT_NUMBER, rc);
77+
LOG_ERR("Update of image %d failed: %d", CONFIG_UPDATE_IMAGE_NUMBER, rc);
7178
k_sleep(K_SECONDS(1));
7279

7380
return 0;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2025 Nordic Semiconductor ASA
2+
#
3+
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
4+
#
5+
6+
CONFIG_SPI_NOR=n
7+
8+
CONFIG_FPROTECT=n
9+
10+
CONFIG_BOOT_WATCHDOG_FEED=n
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2025 Nordic Semiconductor ASA
3+
*
4+
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5+
*/
6+
7+
#include "../../../boards/nrf54h20dk_nrf54h20_cpuapp.overlay"
8+
9+
/ {
10+
chosen {
11+
zephyr,code-partition = &boot_partition;
12+
};
13+
};

tests/subsys/nrf_compress/decompression/mcuboot_update/testcase.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ tests:
99
- nrf52840dk/nrf52840
1010
- nrf5340dk/nrf5340/cpuapp
1111
- nrf54l15dk/nrf54l15/cpuapp
12+
- nrf54h20dk/nrf54h20/cpuapp
1213
integration_platforms:
1314
- nrf52840dk/nrf52840
1415
- nrf5340dk/nrf5340/cpuapp
1516
- nrf54l15dk/nrf54l15/cpuapp
17+
- nrf54h20dk/nrf54h20/cpuapp
1618
harness: console
1719
harness_config:
1820
type: multi_line

0 commit comments

Comments
 (0)