Skip to content

Commit bed2033

Browse files
committed
WIP modules: tf-m: Add local t_cose path
Provide a local path for the t_cose library. This is needed because TF-M now downloads the t_cose library by default and we cannot follow this. Instead of that a fork of the t_cose was created and it's path is added here. Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
1 parent 9959e54 commit bed2033

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

modules/trusted-firmware-m/CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,18 @@ if(CONFIG_TFM_NFCT_PINS_AS_GPIOS)
155155
)
156156
endif()
157157

158+
# Forward an externally-provided T_COSE_PATH to the TF-M build so the upstream
159+
# tf-m-tests / lib/ext/t_cose fetch_remote_library() step uses a local clone
160+
# instead of cloning from GitHub at configure time. Setting T_COSE_PATH on the
161+
# top-level CMake invocation (or earlier in a sample/test CMakeLists.txt) is
162+
# enough; mirrors the upstream CMSIS_PATH / TF_PSA_CRYPTO_PATH pattern.
163+
if(T_COSE_PATH)
164+
set_property(TARGET zephyr_property_target
165+
APPEND PROPERTY TFM_CMAKE_OPTIONS
166+
-DT_COSE_PATH=${T_COSE_PATH}
167+
)
168+
endif()
169+
158170
zephyr_include_directories(${ZEPHYR_NRF_MODULE_DIR}/include/tfm)
159171

160172
# Default values from config_base.h in TF-M.

tests/tfm/tfm_psa_test/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ if(NOT DEFINED TFM_PSA_TEST_SUITE)
6666
endif()
6767
set(TEST_PSA_API "${TFM_PSA_TEST_SUITE}")
6868

69+
# Use the in-tree nrf_security copy of t_cose instead of having tf-m-tests
70+
# fetch it from GitHub at configure time.
71+
set(T_COSE_PATH "${ZEPHYR_NRF_MODULE_DIR}/subsys/nrf_security/src/t_cose")
72+
6973
set_property(TARGET zephyr_property_target
7074
APPEND PROPERTY TFM_CMAKE_OPTIONS
7175
-DCONFIG_TFM_TEST_DIR=${TFM_TEST_DIR}
@@ -128,6 +132,7 @@ ExternalProject_Add(tfm_psa_arch_test_app
128132
-DCROSS_COMPILE=${TFM_TOOLCHAIN_PATH}/${TFM_TOOLCHAIN_PREFIX}
129133
-DPSA_TOOLCHAIN_FILE=${TFM_BINARY_DIR}/api_ns/cmake/${TFM_TOOLCHAIN_NS_FILE}
130134
-DQCBOR_PATH${QCBOR_PATH_TYPE}=${CONFIG_TFM_QCBOR_PATH}
135+
-DT_COSE_PATH=${T_COSE_PATH}
131136
-DCMAKE_BUILD_TYPE=${tfm_ns_CMAKE_BUILD_TYPE}
132137
-DTEST_PSA_API=${TEST_PSA_API}
133138
-DZEPHYR_NRF_MODULE_DIR=${ZEPHYR_NRF_MODULE_DIR}

0 commit comments

Comments
 (0)