From ed5bba87e784e3a1c1ba06778fcdacba48238150 Mon Sep 17 00:00:00 2001 From: Arkadiusz Balys Date: Tue, 1 Apr 2025 15:36:21 +0200 Subject: [PATCH 1/7] Revert "[nrf noup] boards: nordic: nrf7002dk: Bring back NS variants" This reverts commit fdf281511b1253c6625bc6d0ce61eb31d76c710e. Signed-off-by: Arkadiusz Balys --- boards/nordic/nrf7002dk/CMakeLists.txt | 11 --- boards/nordic/nrf7002dk/Kconfig | 6 +- boards/nordic/nrf7002dk/Kconfig.defconfig | 76 ------------------- boards/nordic/nrf7002dk/Kconfig.nrf7002dk | 4 +- boards/nordic/nrf7002dk/board.cmake | 13 +--- boards/nordic/nrf7002dk/board.yml | 4 - .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts | 39 ---------- .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml | 19 ----- ...7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig | 27 ------- .../nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 40 ---------- .../nrf7002dk_nrf5340_cpuapp_ns.yaml | 19 ----- .../nrf7002dk_nrf5340_cpuapp_ns_defconfig | 26 ------- 12 files changed, 3 insertions(+), 281 deletions(-) delete mode 100644 boards/nordic/nrf7002dk/CMakeLists.txt delete mode 100644 boards/nordic/nrf7002dk/Kconfig.defconfig delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml delete mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig diff --git a/boards/nordic/nrf7002dk/CMakeLists.txt b/boards/nordic/nrf7002dk/CMakeLists.txt deleted file mode 100644 index db20255712b..00000000000 --- a/boards/nordic/nrf7002dk/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if((CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) AND - CONFIG_BOARD_ENABLE_CPUNET) - zephyr_library() - zephyr_library_sources(nrf5340_cpunet_reset.c) -endif() diff --git a/boards/nordic/nrf7002dk/Kconfig b/boards/nordic/nrf7002dk/Kconfig index bf5b239c98c..e599cbcce07 100644 --- a/boards/nordic/nrf7002dk/Kconfig +++ b/boards/nordic/nrf7002dk/Kconfig @@ -10,9 +10,7 @@ config MBOX_NRFX_IPC default MBOX if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 config BT_HCI_IPC default y if BT @@ -40,9 +38,7 @@ config BT_ECC config DOMAIN_CPUAPP_BOARD string default "nrf7002dk/nrf5340/cpuapp" if BOARD_NRF7002DK_NRF5340_CPUAPP - default "nrf7002dk/nrf5340/cpuapp/ns" if BOARD_NRF7002DK_NRF5340_CPUAPP_NS default "nrf7002dk/nrf5340/cpuapp/nrf7001" if BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 - default "nrf7002dk/nrf5340/cpuapp/nrf7001/ns" if BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS help The board which will be used for CPUAPP domain when creating a multi image application where one or more images should be located on diff --git a/boards/nordic/nrf7002dk/Kconfig.defconfig b/boards/nordic/nrf7002dk/Kconfig.defconfig deleted file mode 100644 index a6357ae50b2..00000000000 --- a/boards/nordic/nrf7002dk/Kconfig.defconfig +++ /dev/null @@ -1,76 +0,0 @@ -# nRF5340 DK nRF5340 board configuration - -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -# By default, if we build for a Non-Secure version of the board, -# force building with TF-M as the Secure Execution Environment. -config BUILD_WITH_TFM - default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -if BUILD_WITH_TFM - -# By default, if we build with TF-M, instruct build system to -# flash the combined TF-M (Secure) & Zephyr (Non Secure) image -config TFM_FLASH_MERGED_BINARY - bool - default y - -endif # BUILD_WITH_TFM - -# Code Partition: -# -# For the secure version of the board the firmware is linked at the beginning -# of the flash, or into the code-partition defined in DT if it is intended to -# be loaded by MCUboot. If the secure firmware is to be combined with a non- -# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always -# be restricted to the size of its code partition. -# -# For the non-secure version of the board, the firmware -# must be linked into the code-partition (non-secure) defined in DT, regardless. -# Apply this configuration below by setting the Kconfig symbols used by -# the linker according to the information extracted from DT partitions. - -# SRAM Partition: -# -# If the secure firmware is to be combined with a non-secure image -# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always -# be restricted to the secure image SRAM partition (sram-secure-partition). -# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram -# may be used by the image. -# -# For the non-secure version of the board, the firmware image SRAM is -# always restricted to the allocated non-secure SRAM partition. -# -# Workaround for not being able to have commas in macro arguments -DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition -DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition - -if (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) && \ - TRUSTED_EXECUTION_SECURE - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config SRAM_SIZE - default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) - -endif - -if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS - -config FLASH_LOAD_OFFSET - default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -config FLASH_LOAD_SIZE - default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) - -endif - -endif diff --git a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk index 91f52ee6f08..61b9e818f36 100644 --- a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk +++ b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk @@ -4,6 +4,4 @@ config BOARD_NRF7002DK select SOC_NRF5340_CPUNET_QKAA if BOARD_NRF7002DK_NRF5340_CPUNET select SOC_NRF5340_CPUAPP_QKAA if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 diff --git a/boards/nordic/nrf7002dk/board.cmake b/boards/nordic/nrf7002dk/board.cmake index 53193d460fd..d3afa4bb8ca 100644 --- a/boards/nordic/nrf7002dk/board.cmake +++ b/boards/nordic/nrf7002dk/board.cmake @@ -1,22 +1,11 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) - set(TFM_PUBLIC_KEY_FORMAT "full") -endif() - if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") endif() -if(CONFIG_TFM_FLASH_MERGED_BINARY) - set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex") -endif() - if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") endif() diff --git a/boards/nordic/nrf7002dk/board.yml b/boards/nordic/nrf7002dk/board.yml index 39db5dcfa3a..4f41341e442 100644 --- a/boards/nordic/nrf7002dk/board.yml +++ b/boards/nordic/nrf7002dk/board.yml @@ -5,9 +5,5 @@ board: socs: - name: nrf5340 variants: - - name: ns - cpucluster: cpuapp - name: nrf7001 cpucluster: cpuapp - variants: - - name: ns diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts deleted file mode 100644 index 5ff28accf3f..00000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include -#include "nrf5340_cpuapp_common.dtsi" - -/ { - model = "Nordic NRF5340 DK NRF5340 Application"; - compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; - - chosen { - zephyr,sram = &sram0_ns; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_ns_partition; - zephyr,entropy = &psa_rng; - zephyr,wifi = &wlan0; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; -}; - -&qspi { - nrf70: nrf7001@1 { - compatible = "nordic,nrf7001-qspi"; - status = "okay"; - reg = <1>; - qspi-frequency = <24000000>; - qspi-quad-mode; - - #include "nrf70_common.dtsi" - }; -}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml deleted file mode 100644 index 16575969126..00000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml +++ /dev/null @@ -1,19 +0,0 @@ -identifier: nrf7002dk/nrf5340/cpuapp/nrf7001/ns -name: NRF7002-DK-NRF7001-NRF5340-application-MCU-Non-Secure -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -ram: 192 -flash: 192 -supported: - - gpio - - i2c - - pwm - - watchdog - - usbd - - usb_device - - netif:openthread -vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig deleted file mode 100644 index c536aae767d..00000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2024 Nordic Semiconductor ASA -# SPDX-License-Identifier: Apache-2.0 - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# Enable TrustZone-M -CONFIG_ARM_TRUSTZONE_M=y - -# This Board implies building Non-Secure firmware -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# enable GPIO -CONFIG_GPIO=y - -# enable PINCTRL -CONFIG_PINCTRL=y - -# Enable uart driver -CONFIG_SERIAL=y - -# enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts deleted file mode 100644 index 0deb8ccc1bf..00000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2024 Nordic Semiconductor ASA - * - * SPDX-License-Identifier: Apache-2.0 - */ - -/dts-v1/; -#include -#include "nrf5340_cpuapp_common.dtsi" - -/ { - model = "Nordic NRF5340 DK NRF5340 Application"; - compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; - - chosen { - zephyr,sram = &sram0_ns_app; - zephyr,flash = &flash0; - zephyr,code-partition = &slot0_ns_partition; - zephyr,entropy = &psa_rng; - zephyr,wifi = &wlan0; - }; - - psa_rng: psa-rng { - compatible = "zephyr,psa-crypto-rng"; - status = "okay"; - }; -}; - -&qspi { - nrf70: nrf7002@1 { - compatible = "nordic,nrf7002-qspi"; - status = "okay"; - reg = <1>; - qspi-frequency = <24000000>; - qspi-quad-mode; - - #include "nrf70_common.dtsi" - #include "nrf70_common_5g.dtsi" - }; -}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml deleted file mode 100644 index ea43785b455..00000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml +++ /dev/null @@ -1,19 +0,0 @@ -identifier: nrf7002dk/nrf5340/cpuapp/ns -name: NRF7002-DK-NRF5340-application-MCU-Non-Secure -type: mcu -arch: arm -toolchain: - - gnuarmemb - - xtools - - zephyr -ram: 192 -flash: 192 -supported: - - gpio - - i2c - - pwm - - watchdog - - usbd - - usb_device - - netif:openthread -vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig deleted file mode 100644 index c5b2eaadc16..00000000000 --- a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig +++ /dev/null @@ -1,26 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 - -# Enable MPU -CONFIG_ARM_MPU=y - -# Enable hardware stack protection -CONFIG_HW_STACK_PROTECTION=y - -# Enable TrustZone-M -CONFIG_ARM_TRUSTZONE_M=y - -# This Board implies building Non-Secure firmware -CONFIG_TRUSTED_EXECUTION_NONSECURE=y - -# enable GPIO -CONFIG_GPIO=y - -# enable PINCTRL -CONFIG_PINCTRL=y - -# Enable uart driver -CONFIG_SERIAL=y - -# enable console -CONFIG_CONSOLE=y -CONFIG_UART_CONSOLE=y From 77425f16b2ca74e7bfa457bcc424937650619509 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Tue, 21 Jan 2025 08:21:03 +0000 Subject: [PATCH 2/7] [nrf fromtree] boards: nordic: Fix some CMake inconsistencies Fixes some oddities with CMake code Signed-off-by: Jamie McCrae (cherry picked from commit 4fa91b5c35c087d9a69317a0f3761da2b93702d9) --- boards/nordic/nrf5340dk/board.cmake | 4 ++-- boards/nordic/nrf54l15dk/board.cmake | 6 ++---- boards/nordic/nrf7002dk/board.cmake | 7 ++----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/boards/nordic/nrf5340dk/board.cmake b/boards/nordic/nrf5340dk/board.cmake index ba7bf5c1185..3634697dd77 100644 --- a/boards/nordic/nrf5340dk/board.cmake +++ b/boards/nordic/nrf5340dk/board.cmake @@ -5,7 +5,7 @@ if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP_NS) endif() if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP_NS) -board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") + board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") endif() if(CONFIG_TFM_FLASH_MERGED_BINARY) @@ -13,7 +13,7 @@ if(CONFIG_TFM_FLASH_MERGED_BINARY) endif() if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUNET) -board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") + board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") endif() include(${ZEPHYR_BASE}/boards/common/nrfutil.board.cmake) diff --git a/boards/nordic/nrf54l15dk/board.cmake b/boards/nordic/nrf54l15dk/board.cmake index 81af434c648..1d700816356 100644 --- a/boards/nordic/nrf54l15dk/board.cmake +++ b/boards/nordic/nrf54l15dk/board.cmake @@ -1,11 +1,9 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_SOC_NRF54L05_CPUAPP OR CONFIG_SOC_NRF54L10_CPUAPP OR - CONFIG_SOC_NRF54L15_CPUAPP) +if(CONFIG_SOC_NRF54L05_CPUAPP OR CONFIG_SOC_NRF54L10_CPUAPP OR CONFIG_SOC_NRF54L15_CPUAPP) board_runner_args(jlink "--device=cortex-m33" "--speed=4000") -elseif(CONFIG_SOC_NRF54L05_CPUFLPR OR CONFIG_SOC_NRF54L10_CPUFLPR OR - CONFIG_SOC_NRF54L15_CPUFLPR) +elseif(CONFIG_SOC_NRF54L05_CPUFLPR OR CONFIG_SOC_NRF54L10_CPUFLPR OR CONFIG_SOC_NRF54L15_CPUFLPR) set(JLINKSCRIPTFILE ${CMAKE_CURRENT_LIST_DIR}/support/nrf54l_05_10_15_cpuflpr.JLinkScript) board_runner_args(jlink "--device=RISC-V" "--speed=4000" "-if SW" "--tool-opt=-jlinkscriptfile ${JLINKSCRIPTFILE}") endif() diff --git a/boards/nordic/nrf7002dk/board.cmake b/boards/nordic/nrf7002dk/board.cmake index d3afa4bb8ca..56982511034 100644 --- a/boards/nordic/nrf7002dk/board.cmake +++ b/boards/nordic/nrf7002dk/board.cmake @@ -1,12 +1,9 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR - CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") -endif() - -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) +elseif(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") endif() From 901db857222d13b2eafbdcd8720cd80bb75d5990 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Mon, 3 Feb 2025 12:22:47 +0100 Subject: [PATCH 3/7] [nrf fromtree] scripts: runners: nrf: Honor the --erase flag for external memory Both backends supported as runners for nRF ICs, nrfjprog and nrfutil, support erasing external memory as part of the programming operation. Before this patch, and when the firmware was detected to be partially or fully placed in external flash by inspecting the .hex address range, the runner would instruct the backend tool to fully erase the external flash (but the nrfjprog runner would ignore that, always erasing only the sectors required). Instead, correctly default to erasing only the sectors that are required to program the new firmware image in both tools, and erase it completely only when the --erase flag is provided by the user. Signed-off-by: Carles Cufi (cherry picked from commit f20168fe892e86b3a1a6dfbdf659fd8e3c51a80f) --- doc/releases/migration-guide-4.1.rst | 7 +++++++ scripts/west_commands/runners/nrf_common.py | 2 +- scripts/west_commands/runners/nrfjprog.py | 7 +++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/releases/migration-guide-4.1.rst b/doc/releases/migration-guide-4.1.rst index 868f7511aad..ab6355ed77d 100644 --- a/doc/releases/migration-guide-4.1.rst +++ b/doc/releases/migration-guide-4.1.rst @@ -46,6 +46,13 @@ Boards instead of pin reset when flashing with ``west flash``. If you want to keep using pin reset on the nRF52 family of ICs you can use ``west flash --pinreset``. +* Erasing the external memory when programming a new firmware image with ``west + flash`` on the nRF52 and nRF53 series now always correctly honors the + ``--erase`` flag (and its absence) both when using the ``nrfjprog`` and + ``nrfutil`` backends. Prior to this release, the ``nrjfprog`` backend would + always erase only the sectors of the external flash used by the new firmware, + and the ``nrfutil`` one would always erase the whole external flash. + Devicetree ********** diff --git a/scripts/west_commands/runners/nrf_common.py b/scripts/west_commands/runners/nrf_common.py index 4c944eeea79..75d39b271c9 100644 --- a/scripts/west_commands/runners/nrf_common.py +++ b/scripts/west_commands/runners/nrf_common.py @@ -416,7 +416,7 @@ def program_hex(self): if self.family in xip_ranges: xip_start, xip_end = xip_ranges[self.family] if self.hex_refers_region(xip_start, xip_end): - ext_mem_erase_opt = 'ERASE_ALL' + ext_mem_erase_opt = erase_arg self.op_program(self.hex_, erase_arg, ext_mem_erase_opt, defer=True, core=core) self.flush(force=False) diff --git a/scripts/west_commands/runners/nrfjprog.py b/scripts/west_commands/runners/nrfjprog.py index c7e003824a3..36461b7236d 100644 --- a/scripts/west_commands/runners/nrfjprog.py +++ b/scripts/west_commands/runners/nrfjprog.py @@ -91,8 +91,11 @@ def do_exec_op(self, op, force=False): raise RuntimeError(f'Invalid erase mode: {erase}') if opts.get('ext_mem_erase_mode'): - # In the future there might be multiple QSPI erase modes - cmd.append('--qspisectorerase') + if opts['ext_mem_erase_mode'] == 'ERASE_RANGES_TOUCHED_BY_FIRMWARE': + cmd.append('--qspisectorerase') + elif opts['ext_mem_erase_mode'] == 'ERASE_ALL': + cmd.append('--qspichiperase') + if opts.get('verify'): # In the future there might be multiple verify modes cmd.append('--verify') From fde2dfdb69ced179051a92e12324a55c29154126 Mon Sep 17 00:00:00 2001 From: Carles Cufi Date: Mon, 3 Feb 2025 14:28:00 +0100 Subject: [PATCH 4/7] [nrf fromtree] scripts: runners: nrfutil: Add a new external memory config param This acts in a similar way to nrfjprog's --qspiini parameter introduced in 7eb364b, but works slightly differently in nrfutil: it requires a config file in JSON format instead of .ini, and it is passed along to the `execute-batch` command instead of providing it together with the `program` command. Signed-off-by: Carles Cufi (cherry picked from commit 2effae5594fa602ef3dd80fc9137079aab74ee54) --- scripts/west_commands/runners/nrfutil.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/scripts/west_commands/runners/nrfutil.py b/scripts/west_commands/runners/nrfutil.py index a4f17282259..f937da74c07 100644 --- a/scripts/west_commands/runners/nrfutil.py +++ b/scripts/west_commands/runners/nrfutil.py @@ -18,12 +18,13 @@ class NrfUtilBinaryRunner(NrfBinaryRunner): def __init__(self, cfg, family, softreset, pinreset, dev_id, erase=False, reset=True, tool_opt=None, force=False, recover=False, - suit_starter=False): + suit_starter=False, ext_mem_config_file=None): super().__init__(cfg, family, softreset, pinreset, dev_id, erase, reset, tool_opt, force, recover) self.suit_starter = suit_starter + self.ext_mem_config_file = ext_mem_config_file self._ops = [] self._op_id = 1 @@ -43,7 +44,8 @@ def do_create(cls, cfg, args): reset=args.reset, tool_opt=args.tool_opt, force=args.force, recover=args.recover, - suit_starter=args.suit_manifest_starter) + suit_starter=args.suit_manifest_starter, + ext_mem_config_file=args.ext_mem_config_file) @classmethod def do_add_parser(cls, parser): @@ -51,6 +53,10 @@ def do_add_parser(cls, parser): parser.add_argument('--suit-manifest-starter', required=False, action='store_true', help='Use the SUIT manifest starter file') + parser.add_argument('--ext-mem-config-file', required=False, + dest='ext_mem_config_file', + help='path to an JSON file with external memory configuration') + def _exec(self, args): jout_all = [] @@ -139,8 +145,13 @@ def _exec_batch(self): self._ops = [] self._op_id = 1 self.logger.debug(f'Executing batch in: {json_file}') - self._exec(['x-execute-batch', '--batch-path', f'{json_file}', - '--serial-number', f'{self.dev_id}']) + precmd = [] + if self.ext_mem_config_file: + # This needs to be prepended, as it's a global option + precmd = ['--x-ext-mem-config-file', self.ext_mem_config_file] + + self._exec(precmd + ['x-execute-batch', '--batch-path', f'{json_file}', + '--serial-number', f'{self.dev_id}']) def do_exec_op(self, op, force=False): self.logger.debug(f'Executing op: {op}') From 4b35914c4d996abbeb53126427a37bd78e1be859 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Mon, 31 Mar 2025 11:15:18 +0100 Subject: [PATCH 5/7] [nrf fromlist] boards: nordic: nrf7002dk: Add SPI nrfutil config Adds a configuration file which is used with nrfutil to allow programming the SPI flash on the device Upstream PR #: 86985 Signed-off-by: Jamie McCrae --- boards/nordic/nrf7002dk/board.cmake | 1 + .../nrf7002dk/nrf7002dk_spi_nrfutil_config.json | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_spi_nrfutil_config.json diff --git a/boards/nordic/nrf7002dk/board.cmake b/boards/nordic/nrf7002dk/board.cmake index 56982511034..77b78fdd1a7 100644 --- a/boards/nordic/nrf7002dk/board.cmake +++ b/boards/nordic/nrf7002dk/board.cmake @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) + board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/nrf7002dk_spi_nrfutil_config.json") board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") elseif(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") diff --git a/boards/nordic/nrf7002dk/nrf7002dk_spi_nrfutil_config.json b/boards/nordic/nrf7002dk/nrf7002dk_spi_nrfutil_config.json new file mode 100644 index 00000000000..af668581877 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_spi_nrfutil_config.json @@ -0,0 +1,17 @@ +{ + "firmware_config": { + "peripheral": "SPIM0" + }, + "pins": { + "sck": 8, + "csn": 11, + "io0": 9, + "io1": 10, + "io2": 4294967295, + "io3": 4294967295 + }, + "flash_size": 8388608, + "page_size": 4096, + "sck_frequency": 8000000, + "address_mode": "MODE24BIT" +} From f01d8d7d34991d6f8bc0f9c05b04f1496b33337d Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Wed, 12 Mar 2025 11:40:29 +0000 Subject: [PATCH 6/7] [nrf fromlist] boards: nordic: thingy53: Add QSPI nrfutil config Adds a configuration file which is used with nrfutil to allow programming QSPI on the device Upstream PR #: 86985 Signed-off-by: Jamie McCrae --- boards/nordic/thingy53/board.cmake | 1 + .../thingy53_qspi_nrfutil_config.json | 22 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 boards/nordic/thingy53/thingy53_qspi_nrfutil_config.json diff --git a/boards/nordic/thingy53/board.cmake b/boards/nordic/thingy53/board.cmake index 916d982b65c..f03b026d9fb 100644 --- a/boards/nordic/thingy53/board.cmake +++ b/boards/nordic/thingy53/board.cmake @@ -1,6 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 if(CONFIG_BOARD_THINGY53_NRF5340_CPUAPP OR CONFIG_BOARD_THINGY53_NRF5340_CPUAPP_NS) + board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/thingy53_qspi_nrfutil_config.json") board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") elseif(CONFIG_BOARD_THINGY53_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") diff --git a/boards/nordic/thingy53/thingy53_qspi_nrfutil_config.json b/boards/nordic/thingy53/thingy53_qspi_nrfutil_config.json new file mode 100644 index 00000000000..8138801cd91 --- /dev/null +++ b/boards/nordic/thingy53/thingy53_qspi_nrfutil_config.json @@ -0,0 +1,22 @@ +{ + "firmware_config": { + "peripheral": "QSPI" + }, + "pins": { + "sck": 17, + "csn": 18, + "io0": 13, + "io1": 14, + "io2": 15, + "io3": 16 + }, + "flash_size": 67108864, + "sck_frequency": 8000000, + "address_mode": "MODE24BIT", + "readoc": "READ2IO", + "writeoc": "PP", + "pp_size": "PPSIZE256", + "sck_delay": 128, + "rx_delay": 2, + "page_size": 4096 +} From 1dd0f7c137f94135e321b0446a7dc9c7b2833e8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20G=C5=82=C4=85bek?= Date: Wed, 8 Jan 2025 11:15:56 +0100 Subject: [PATCH 7/7] [nrf noup] boards: nordic: nrf7002dk: Bring back NS variants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Non-secure variants for nRF7002 DK were removed from upstream in commit 10d49736cffa14d3798e615e70d58b3be8ee2cfc. Revert these changes downstream, so that the NS variants are still available. Signed-off-by: Andrzej Głąbek --- boards/nordic/nrf7002dk/CMakeLists.txt | 11 +++ boards/nordic/nrf7002dk/Kconfig | 6 +- boards/nordic/nrf7002dk/Kconfig.defconfig | 76 +++++++++++++++++++ boards/nordic/nrf7002dk/Kconfig.nrf7002dk | 4 +- boards/nordic/nrf7002dk/board.cmake | 18 ++++- boards/nordic/nrf7002dk/board.yml | 4 + .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts | 39 ++++++++++ .../nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml | 19 +++++ ...7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig | 27 +++++++ .../nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts | 40 ++++++++++ .../nrf7002dk_nrf5340_cpuapp_ns.yaml | 19 +++++ .../nrf7002dk_nrf5340_cpuapp_ns_defconfig | 26 +++++++ 12 files changed, 285 insertions(+), 4 deletions(-) create mode 100644 boards/nordic/nrf7002dk/CMakeLists.txt create mode 100644 boards/nordic/nrf7002dk/Kconfig.defconfig create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml create mode 100644 boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig diff --git a/boards/nordic/nrf7002dk/CMakeLists.txt b/boards/nordic/nrf7002dk/CMakeLists.txt new file mode 100644 index 00000000000..db20255712b --- /dev/null +++ b/boards/nordic/nrf7002dk/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if((CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) AND + CONFIG_BOARD_ENABLE_CPUNET) + zephyr_library() + zephyr_library_sources(nrf5340_cpunet_reset.c) +endif() diff --git a/boards/nordic/nrf7002dk/Kconfig b/boards/nordic/nrf7002dk/Kconfig index e599cbcce07..bf5b239c98c 100644 --- a/boards/nordic/nrf7002dk/Kconfig +++ b/boards/nordic/nrf7002dk/Kconfig @@ -10,7 +10,9 @@ config MBOX_NRFX_IPC default MBOX if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS config BT_HCI_IPC default y if BT @@ -38,7 +40,9 @@ config BT_ECC config DOMAIN_CPUAPP_BOARD string default "nrf7002dk/nrf5340/cpuapp" if BOARD_NRF7002DK_NRF5340_CPUAPP + default "nrf7002dk/nrf5340/cpuapp/ns" if BOARD_NRF7002DK_NRF5340_CPUAPP_NS default "nrf7002dk/nrf5340/cpuapp/nrf7001" if BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 + default "nrf7002dk/nrf5340/cpuapp/nrf7001/ns" if BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS help The board which will be used for CPUAPP domain when creating a multi image application where one or more images should be located on diff --git a/boards/nordic/nrf7002dk/Kconfig.defconfig b/boards/nordic/nrf7002dk/Kconfig.defconfig new file mode 100644 index 00000000000..a6357ae50b2 --- /dev/null +++ b/boards/nordic/nrf7002dk/Kconfig.defconfig @@ -0,0 +1,76 @@ +# nRF5340 DK nRF5340 board configuration + +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +if BOARD_NRF7002DK_NRF5340_CPUAPP || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +# By default, if we build for a Non-Secure version of the board, +# force building with TF-M as the Secure Execution Environment. +config BUILD_WITH_TFM + default y if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +if BUILD_WITH_TFM + +# By default, if we build with TF-M, instruct build system to +# flash the combined TF-M (Secure) & Zephyr (Non Secure) image +config TFM_FLASH_MERGED_BINARY + bool + default y + +endif # BUILD_WITH_TFM + +# Code Partition: +# +# For the secure version of the board the firmware is linked at the beginning +# of the flash, or into the code-partition defined in DT if it is intended to +# be loaded by MCUboot. If the secure firmware is to be combined with a non- +# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always +# be restricted to the size of its code partition. +# +# For the non-secure version of the board, the firmware +# must be linked into the code-partition (non-secure) defined in DT, regardless. +# Apply this configuration below by setting the Kconfig symbols used by +# the linker according to the information extracted from DT partitions. + +# SRAM Partition: +# +# If the secure firmware is to be combined with a non-secure image +# (TRUSTED_EXECUTION_SECURE=y), the secure FW image SRAM shall always +# be restricted to the secure image SRAM partition (sram-secure-partition). +# Otherwise (if TRUSTED_EXECUTION_SECURE is not set) the whole zephyr,sram +# may be used by the image. +# +# For the non-secure version of the board, the firmware image SRAM is +# always restricted to the allocated non-secure SRAM partition. +# +# Workaround for not being able to have commas in macro arguments +DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition +DT_CHOSEN_Z_SRAM_PARTITION := zephyr,sram-secure-partition + +if (BOARD_NRF7002DK_NRF5340_CPUAPP || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) && \ + TRUSTED_EXECUTION_SECURE + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config SRAM_SIZE + default $(dt_chosen_reg_size_int,$(DT_CHOSEN_Z_SRAM_PARTITION),0,K) + +endif + +if BOARD_NRF7002DK_NRF5340_CPUAPP_NS || BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS + +config FLASH_LOAD_OFFSET + default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +config FLASH_LOAD_SIZE + default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION)) + +endif + +endif diff --git a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk index 61b9e818f36..91f52ee6f08 100644 --- a/boards/nordic/nrf7002dk/Kconfig.nrf7002dk +++ b/boards/nordic/nrf7002dk/Kconfig.nrf7002dk @@ -4,4 +4,6 @@ config BOARD_NRF7002DK select SOC_NRF5340_CPUNET_QKAA if BOARD_NRF7002DK_NRF5340_CPUNET select SOC_NRF5340_CPUAPP_QKAA if BOARD_NRF7002DK_NRF5340_CPUAPP || \ - BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 + BOARD_NRF7002DK_NRF5340_CPUAPP_NS || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 || \ + BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS diff --git a/boards/nordic/nrf7002dk/board.cmake b/boards/nordic/nrf7002dk/board.cmake index 77b78fdd1a7..c4f86afedf7 100644 --- a/boards/nordic/nrf7002dk/board.cmake +++ b/boards/nordic/nrf7002dk/board.cmake @@ -1,10 +1,24 @@ # Copyright (c) 2024 Nordic Semiconductor ASA # SPDX-License-Identifier: Apache-2.0 -if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001) +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) + set(TFM_PUBLIC_KEY_FORMAT "full") +endif() + +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NS OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001 OR + CONFIG_BOARD_NRF7002DK_NRF5340_CPUAPP_NRF7001_NS) board_runner_args(nrfutil "--ext-mem-config-file=${BOARD_DIR}/nrf7002dk_spi_nrfutil_config.json") board_runner_args(jlink "--device=nrf5340_xxaa_app" "--speed=4000") -elseif(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) +endif() + +if(CONFIG_TFM_FLASH_MERGED_BINARY) + set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/zephyr/tfm_merged.hex") +endif() + +if(CONFIG_BOARD_NRF7002DK_NRF5340_CPUNET) board_runner_args(jlink "--device=nrf5340_xxaa_net" "--speed=4000") endif() diff --git a/boards/nordic/nrf7002dk/board.yml b/boards/nordic/nrf7002dk/board.yml index 4f41341e442..39db5dcfa3a 100644 --- a/boards/nordic/nrf7002dk/board.yml +++ b/boards/nordic/nrf7002dk/board.yml @@ -5,5 +5,9 @@ board: socs: - name: nrf5340 variants: + - name: ns + cpucluster: cpuapp - name: nrf7001 cpucluster: cpuapp + variants: + - name: ns diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts new file mode 100644 index 00000000000..5ff28accf3f --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.dts @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "nrf5340_cpuapp_common.dtsi" + +/ { + model = "Nordic NRF5340 DK NRF5340 Application"; + compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; + + chosen { + zephyr,sram = &sram0_ns; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + zephyr,entropy = &psa_rng; + zephyr,wifi = &wlan0; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; + +&qspi { + nrf70: nrf7001@1 { + compatible = "nordic,nrf7001-qspi"; + status = "okay"; + reg = <1>; + qspi-frequency = <24000000>; + qspi-quad-mode; + + #include "nrf70_common.dtsi" + }; +}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml new file mode 100644 index 00000000000..16575969126 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns.yaml @@ -0,0 +1,19 @@ +identifier: nrf7002dk/nrf5340/cpuapp/nrf7001/ns +name: NRF7002-DK-NRF7001-NRF5340-application-MCU-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 192 +flash: 192 +supported: + - gpio + - i2c + - pwm + - watchdog + - usbd + - usb_device + - netif:openthread +vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig new file mode 100644 index 00000000000..c536aae767d --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_nrf7001_ns_defconfig @@ -0,0 +1,27 @@ +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# enable GPIO +CONFIG_GPIO=y + +# enable PINCTRL +CONFIG_PINCTRL=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts new file mode 100644 index 00000000000..0deb8ccc1bf --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2024 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/dts-v1/; +#include +#include "nrf5340_cpuapp_common.dtsi" + +/ { + model = "Nordic NRF5340 DK NRF5340 Application"; + compatible = "nordic,nrf5340-dk-nrf5340-cpuapp"; + + chosen { + zephyr,sram = &sram0_ns_app; + zephyr,flash = &flash0; + zephyr,code-partition = &slot0_ns_partition; + zephyr,entropy = &psa_rng; + zephyr,wifi = &wlan0; + }; + + psa_rng: psa-rng { + compatible = "zephyr,psa-crypto-rng"; + status = "okay"; + }; +}; + +&qspi { + nrf70: nrf7002@1 { + compatible = "nordic,nrf7002-qspi"; + status = "okay"; + reg = <1>; + qspi-frequency = <24000000>; + qspi-quad-mode; + + #include "nrf70_common.dtsi" + #include "nrf70_common_5g.dtsi" + }; +}; diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml new file mode 100644 index 00000000000..ea43785b455 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.yaml @@ -0,0 +1,19 @@ +identifier: nrf7002dk/nrf5340/cpuapp/ns +name: NRF7002-DK-NRF5340-application-MCU-Non-Secure +type: mcu +arch: arm +toolchain: + - gnuarmemb + - xtools + - zephyr +ram: 192 +flash: 192 +supported: + - gpio + - i2c + - pwm + - watchdog + - usbd + - usb_device + - netif:openthread +vendor: nordic diff --git a/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig new file mode 100644 index 00000000000..c5b2eaadc16 --- /dev/null +++ b/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig @@ -0,0 +1,26 @@ +# SPDX-License-Identifier: Apache-2.0 + +# Enable MPU +CONFIG_ARM_MPU=y + +# Enable hardware stack protection +CONFIG_HW_STACK_PROTECTION=y + +# Enable TrustZone-M +CONFIG_ARM_TRUSTZONE_M=y + +# This Board implies building Non-Secure firmware +CONFIG_TRUSTED_EXECUTION_NONSECURE=y + +# enable GPIO +CONFIG_GPIO=y + +# enable PINCTRL +CONFIG_PINCTRL=y + +# Enable uart driver +CONFIG_SERIAL=y + +# enable console +CONFIG_CONSOLE=y +CONFIG_UART_CONSOLE=y