boards: nrf9160: use TF-M by default on non-secure builds

By default, when building for the non-secure version of the
board, use TF-M as the secure firmware binary.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2021-04-06 18:56:28 +02:00
commit 0856e4ba51
3 changed files with 26 additions and 0 deletions

View file

@ -8,6 +8,23 @@ if BOARD_NRF9160DK_NRF9160 || BOARD_NRF9160DK_NRF9160NS
config BOARD
default "nrf9160dk_nrf9160"
# 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_NRF9160DK_NRF9160NS
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
# (when building in-tree tests).
config TFM_FLASH_MERGED_BINARY
bool
default y if TEST_ARM_CORTEX_M
endif # BUILD_WITH_TFM
# 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-

View file

@ -4,6 +4,10 @@ if(CONFIG_BOARD_NRF9160DK_NRF9160NS)
set(TFM_PUBLIC_KEY_FORMAT "full")
endif()
if(CONFIG_TFM_FLASH_MERGED_BINARY)
set_property(TARGET runners_yaml_props_target PROPERTY hex_file "${CMAKE_BINARY_DIR}/tfm_merged.hex")
endif()
board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000")
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -15,3 +15,8 @@
zephyr,code-partition = &slot0_ns_partition;
};
};
/* Disable UART1, because it is used by default in TF-M */
&uart1 {
status = "disabled";
};