Skip to content

Commit 52d0c8a

Browse files
joerchancarlescufi
authored andcommitted
boards: nrf9161dk_nrf9161_ns: Add TF-M support to nrf9161 DK
Add TF-M support for nrf9161 DK and enable it by default for the non-secure board variant. Disable UART1 since TF-M use this for output and it is configured as a secure peripheral. Enabling this will trigger a BusFault in TF-M. Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
1 parent 376f0a5 commit 52d0c8a

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

boards/arm/nrf9161dk_nrf9161/Kconfig.defconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,21 @@ if BOARD_NRF9161DK_NRF9161 || BOARD_NRF9161DK_NRF9161_NS
88
config BOARD
99
default "nrf9161dk_nrf9161"
1010

11+
# By default, if we build for a Non-Secure version of the board,
12+
# enable building with TF-M as the Secure Execution Environment.
13+
config BUILD_WITH_TFM
14+
default y if BOARD_NRF9161DK_NRF9161_NS
15+
16+
if BUILD_WITH_TFM
17+
18+
# By default, if we build with TF-M, instruct build system to
19+
# flash the combined TF-M (Secure) & Zephyr (Non Secure) image
20+
config TFM_FLASH_MERGED_BINARY
21+
bool
22+
default y
23+
24+
endif # BUILD_WITH_TFM
25+
1126
# For the secure version of the board the firmware is linked at the beginning
1227
# of the flash, or into the code-partition defined in DT if it is intended to
1328
# be loaded by MCUboot. If the secure firmware is to be combined with a non-

boards/arm/nrf9161dk_nrf9161/board.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ if(CONFIG_BOARD_NRF9161DK_NRF9161_NS)
55
endif()
66

77
if(CONFIG_TFM_FLASH_MERGED_BINARY)
8-
set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/tfm_merged.hex")
8+
set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex)
99
endif()
1010

1111
# TODO: change to nRF9161_xxAA when such device is available in JLink

boards/arm/nrf9161dk_nrf9161/nrf9161dk_nrf9161_ns.dts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@
1515
zephyr,code-partition = &slot0_ns_partition;
1616
};
1717
};
18+
19+
/* Disable UART1, because it is used by default in TF-M */
20+
&uart1 {
21+
status = "disabled";
22+
};

modules/trusted-firmware-m/Kconfig.tfm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ config ZEPHYR_TRUSTED_FIRMWARE_M_MODULE
1010
config TFM_BOARD
1111
string
1212
default "nordic_nrf/nrf9160dk_nrf9160" if BOARD_NRF9160DK_NRF9160_NS
13+
default "nordic_nrf/nrf9161dk_nrf9161" if BOARD_NRF9161DK_NRF9161_NS
1314
default "nordic_nrf/nrf5340dk_nrf5340_cpuapp" if BOARD_NRF5340DK_NRF5340_CPUAPP_NS
1415
default "nxp/lpcxpresso55s69" if BOARD_LPCXPRESSO55S69_CPU0
1516
default "arm/mps2/an521" if BOARD_MPS2_AN521_CPU0_NS

0 commit comments

Comments
 (0)