Skip to content

Commit

Permalink
tests: use sysbuild in simple bootloder tests
Browse files Browse the repository at this point in the history
[KRKNWK-18748]
* align test with sample

Signed-off-by: Krzysztof Taborowski <[email protected]>
  • Loading branch information
ktaborowski authored and nordicjm committed May 22, 2024
1 parent 3cec052 commit 94f3d07
Show file tree
Hide file tree
Showing 12 changed files with 198 additions and 2 deletions.
2 changes: 0 additions & 2 deletions tests/manual/simple_bootloader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

cmake_minimum_required(VERSION 3.20.0)

include($ENV{ZEPHYR_BASE}/../sidewalk/samples/sid_end_device/bootloader_version.cmake)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(simple_bootloader)

Expand Down
54 changes: 54 additions & 0 deletions tests/manual/simple_bootloader/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#
# Copyright (c) 2023 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

config NRF_DEFAULT_EMPTY
default y if BOARD_NRF5340DK_NRF5340_CPUAPP

choice BOOTLOADER
default BOOTLOADER_MCUBOOT
endchoice

if BOOTLOADER_MCUBOOT

config DFU_MULTI_IMAGE_PACKAGE_BUILD
default y

config DFU_MULTI_IMAGE_PACKAGE_APP
default y

if (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP)

config MCUBOOT_UPDATEABLE_IMAGES
default 2

choice MCUBOOT_MODE
default MCUBOOT_MODE_OVERWRITE_ONLY
endchoice

choice BOOT_SIGNATURE_TYPE
default BOOT_SIGNATURE_TYPE_RSA
endchoice

config SECURE_BOOT
default y

config SECURE_BOOT_NETCORE
default y

config NETCORE_APP_UPDATE
default y

config DFU_MULTI_IMAGE_PACKAGE_NET
default y

endif # BOOTLOADER_MCUBOOT

endif # (BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP)

config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY
default y if BOARD_NRF52840DK_NRF52840 || BOARD_NRF5340DK_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP

source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"
5 changes: 5 additions & 0 deletions tests/manual/simple_bootloader/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VERSION_MAJOR = 2
VERSION_MINOR = 6
PATCHLEVEL = 99
VERSION_TWEAK = 0
EXTRAVERSION =
12 changes: 12 additions & 0 deletions tests/manual/simple_bootloader/boards/nrf52840dk_nrf52840.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
zephyr,code-partition = &boot_partition;
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
zephyr,code-partition = &boot_partition;
nordic,pm-ext-flash = &mx25r64;
};
};
1 change: 1 addition & 0 deletions tests/manual/simple_bootloader/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ sample:
description: Small footprint application to verify sidewalk dfu
tests:
sidewalk.test.simple_bootloader:
sysbuild: true
build_only: true
platform_allow: nrf52840dk/nrf52840 nrf5340dk/nrf5340/cpuapp [email protected]/nrf54l15/cpuapp
integration_platforms:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
zephyr,code-partition = &boot_partition;
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16

# The following configurations are required to support simultaneous multi image update
CONFIG_PCD_APP=y
CONFIG_UPDATEABLE_IMAGE_NUMBER=2

CONFIG_BOOT_SWAP_USING_MOVE=n
# Multi-image updates do not support image swapping yet.
CONFIG_BOOT_UPGRADE_ONLY=y

# The network core cannot access external flash directly. The flash simulator must be used to
# provide a memory region that is used to forward the new firmware to the network core.
CONFIG_FLASH_SIMULATOR=y
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
CONFIG_FLASH_SIMULATOR_STATS=n

# Enable custom command to erase settings partition.
CONFIG_ENABLE_MGMT_PERUSER=y
CONFIG_ZCBOR=y
CONFIG_BOOT_MGMT_CUSTOM_STORAGE_ERASE=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
zephyr,code-partition = &boot_partition;
nordic,pm-ext-flash = &mx25r64;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#
# Copyright (c) 2021 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_BOOT_MAX_IMG_SECTORS=256

# Ensure that the qspi driver is disabled by default
CONFIG_NORDIC_QSPI_NOR=n

# TODO: below are not yet supported and need fixing
CONFIG_FPROTECT=n
CONFIG_BOOT_WATCHDOG_FEED=n
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2023 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
zephyr,code-partition = &boot_partition;
nordic,pm-ext-flash = &mx25r64;
};
};
36 changes: 36 additions & 0 deletions tests/manual/simple_bootloader/sysbuild/mcuboot/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause

CONFIG_MAIN_STACK_SIZE=10240

CONFIG_BOOT_SWAP_SAVE_ENCTLV=n
CONFIG_BOOT_BOOTSTRAP=n
CONFIG_PM=n

CONFIG_FLASH=y
CONFIG_FPROTECT=y

CONFIG_MBEDTLS_CFG_FILE="mcuboot-mbedtls-cfg.h"

CONFIG_BOOT_MAX_IMG_SECTORS=256

# Use minimal C library instead of the Picolib
CONFIG_MINIMAL_LIBC=y

# Bootloader size optimization
CONFIG_CONSOLE=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=n
CONFIG_GPIO=n
CONFIG_LOG=n
CONFIG_CONSOLE_HANDLER=n
CONFIG_BOOT_BANNER=n
CONFIG_TIMESLICING=n
CONFIG_RESET_ON_FATAL_ERROR=n
CONFIG_MULTITHREADING=n
CONFIG_TICKLESS_KERNEL=n
CONFIG_TIMEOUT_64BIT=n
CONFIG_NRF_ENABLE_ICACHE=n

0 comments on commit 94f3d07

Please sign in to comment.