boards: arm: nrf5340: support building TFM for nRF5340 DK

This commit adds support for TF-M builds on nRF5340 DK.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2020-11-11 21:33:57 +01:00 committed by Carles Cufí
commit de12db1ae2
2 changed files with 12 additions and 1 deletions

View file

@ -28,6 +28,12 @@ if (CONFIG_BUILD_WITH_TFM)
set(TFM_PUBLIC_KEY_FORMAT "full") set(TFM_PUBLIC_KEY_FORMAT "full")
endif() endif()
if(CONFIG_BOARD_NRF5340PDK_NRF5340_CPUAPPNS)
set(TFM_INSTALL_DIR ${CMAKE_BINARY_DIR}/tfm/install/outputs/NORDIC_NRF/NRF5340PDK_NRF5340_CPUAPP)
elseif(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPPNS)
set(TFM_INSTALL_DIR ${CMAKE_BINARY_DIR}/tfm/install/outputs/NORDIC_NRF/NRF5340DK_NRF5340_CPUAPP)
endif()
# Set srec_cat binary name # Set srec_cat binary name
find_program(SREC_CAT srec_cat) find_program(SREC_CAT srec_cat)
if(${SREC_CAT} STREQUAL SREC_CAT-NOTFOUND) if(${SREC_CAT} STREQUAL SREC_CAT-NOTFOUND)
@ -49,7 +55,7 @@ if (CONFIG_BUILD_WITH_TFM)
${ADD_NS_IMAGE_MIN_VER} ${ADD_NS_IMAGE_MIN_VER}
-s auto -s auto
-H 0x400 -H 0x400
${CMAKE_BINARY_DIR}/tfm/install/outputs/NORDIC_NRF/NRF5340PDK_NRF5340_CPUAPP/tfm_s.bin ${TFM_INSTALL_DIR}/tfm_s.bin
${CMAKE_BINARY_DIR}/tfm_s_signed.bin ${CMAKE_BINARY_DIR}/tfm_s_signed.bin
#Sign non-secure binary image with public key #Sign non-secure binary image with public key

View file

@ -7,6 +7,11 @@ if(CONFIG_BOARD_NRF5340PDK_NRF5340_CPUAPPNS)
set(TFM_PUBLIC_KEY_FORMAT "full") set(TFM_PUBLIC_KEY_FORMAT "full")
endif() endif()
if(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPPNS)
set(TFM_TARGET_PLATFORM "nordic_nrf/nrf5340dk_nrf5340_cpuapp")
set(TFM_PUBLIC_KEY_FORMAT "full")
endif()
if((CONFIG_BOARD_NRF5340PDK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF5340PDK_NRF5340_CPUAPPNS) OR if((CONFIG_BOARD_NRF5340PDK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF5340PDK_NRF5340_CPUAPPNS) OR
(CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPPNS)) (CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPP OR CONFIG_BOARD_NRF5340DK_NRF5340_CPUAPPNS))
board_runner_args(nrfjprog "--nrf-family=NRF53" "--tool-opt=--coprocessor CP_APPLICATION") board_runner_args(nrfjprog "--nrf-family=NRF53" "--tool-opt=--coprocessor CP_APPLICATION")