Skip to content

Commit

Permalink
samples: tfm: psa_template: Add support for netcore update
Browse files Browse the repository at this point in the history
Add support for updating network core with nRF5340.

External flash will be used for update images.

Signed-off-by: Markus Lassila <markus.lassila@nordicsemi.no>
  • Loading branch information
MarkusLassila committed Sep 2, 2024
1 parent 5c93263 commit dd2e330
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 2 deletions.
30 changes: 30 additions & 0 deletions samples/tfm/tfm_psa_template/Kconfig.sysbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# Copyright (c) 2024 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

source "${ZEPHYR_BASE}/share/sysbuild/Kconfig"

if BOARD_NRF5340DK_NRF5340_CPUAPP_NS

choice NETCORE
default NETCORE_EMPTY
endchoice

config SECURE_BOOT_NETCORE
default y

config NETCORE_APP_UPDATE
default y

config MCUBOOT_APP_SYNC_UPDATEABLE_IMAGES
default y

config PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY
default y

config MCUBOOT_USE_ALL_AVAILABLE_RAM
default y

endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_FPU=y
CONFIG_BOARD_ENABLE_CPUNET=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
1 change: 0 additions & 1 deletion samples/tfm/tfm_psa_template/sysbuild.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,3 @@ SB_CONFIG_SECURE_BOOT_APPCORE=y
SB_CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256=y
SB_CONFIG_MCUBOOT_MODE_OVERWRITE_ONLY=y
SB_CONFIG_MCUBOOT_UPDATEABLE_IMAGES=2
SB_CONFIG_MCUBOOT_APP_SYNC_UPDATEABLE_IMAGES=n
29 changes: 29 additions & 0 deletions samples/tfm/tfm_psa_template/sysbuild/b0n/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_NCS_SAMPLES_DEFAULTS=y

CONFIG_IS_SECURE_BOOTLOADER=y
CONFIG_MULTITHREADING=n
CONFIG_GPIO=n
CONFIG_ARM_MPU=n
CONFIG_TICKLESS_KERNEL=n
CONFIG_ERRNO=n
CONFIG_SYS_CLOCK_EXISTS=y
CONFIG_FPROTECT=y
CONFIG_FW_INFO=y
CONFIG_SECURE_BOOT_CRYPTO=y
CONFIG_SECURE_BOOT_VALIDATION=y
CONFIG_SECURE_BOOT_STORAGE=y
CONFIG_PCD_NET=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_LOG=y

# To build with a minimal configuration, use the overlay file
# '-DOVERLAY_CONFIG=overlay-minimal-size.conf'

# Enable locking the network core for debugging
CONFIG_PCD_LOCK_NETCORE_DEBUG=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright (c) 2024 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

CONFIG_BOOT_MAX_IMG_SECTORS=256

CONFIG_PCD_APP=y

CONFIG_UPDATEABLE_IMAGE_NUMBER=2
CONFIG_NRF53_MULTI_IMAGE_UPDATE=y
CONFIG_BOOT_IMAGE_ACCESS_HOOK_NRF5340=y
CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y

CONFIG_FLASH_SIMULATOR=y
CONFIG_FLASH_SIMULATOR_DOUBLE_WRITES=y
CONFIG_FLASH_SIMULATOR_STATS=n

CONFIG_NORDIC_QSPI_NOR=y
CONFIG_NORDIC_QSPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_NORDIC_QSPI_NOR_STACK_WRITE_BUFFER_SIZE=16
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2024 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

/ {
chosen {
nordic,pm-ext-flash = &mx25r64;
};
};
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ manifest:
compare-by-default: true
- name: mcuboot
repo-path: sdk-mcuboot
revision: v2.1.0-ncs1
revision: pull/330/head
path: bootloader/mcuboot
- name: qcbor
url: https://github.com/laurencelundblade/QCBOR
Expand Down

0 comments on commit dd2e330

Please sign in to comment.