Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify TF-M Build Configuration Options #6

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions Middleware/ARM/TF-M/cmake/TF-M-build.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set(tfm_ns_interface_generated
<BINARY_DIR>/install/interface/src/tfm_platform_api.c
<BINARY_DIR>/install/interface/src/os_wrapper/tfm_ns_interface_rtos.c
)
if(TFM_PSA_FIRMWARE_UPDATE)
if(TFM_CMAKE_ARGS MATCHES "TFM_PARTITION_FIRMWARE_UPDATE=ON")
list(APPEND tfm_ns_interface_generated <BINARY_DIR>/install/interface/src/tfm_fwu_api.c)
endif()

Expand Down Expand Up @@ -50,13 +50,6 @@ ExternalProject_Add(

CMAKE_ARGS
-D TFM_TOOLCHAIN_FILE=<SOURCE_DIR>/${tfm_toolchain_file}
-D TFM_PLATFORM=${TFM_PLATFORM}
-D TFM_PARTITION_FIRMWARE_UPDATE=${TFM_PSA_FIRMWARE_UPDATE}
-D PLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT=${TFM_PSA_FIRMWARE_UPDATE}
-D MCUBOOT_UPGRADE_STRATEGY=${TFM_PLATFORM_UPGRADE_STRATEGY}
-D MCUBOOT_CONFIRM_IMAGE=${TFM_PLATFORM_CONFIRM_IMAGE}
-D MCUBOOT_DATA_SHARING=${TFM_PSA_FIRMWARE_UPDATE}
-D MCUBOOT_IMAGE_VERSION_NS=${MCUBOOT_IMAGE_VERSION_NS}
-D CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
${TFM_CMAKE_ARGS}

Expand Down
6 changes: 6 additions & 0 deletions Projects/aws-iot-example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ set(TFM_CMAKE_ARGS
-DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON
-DTFM_PARTITION_PLATFORM=ON
-DTFM_PARTITION_PROTECTED_STORAGE=ON
-DTFM_PLATFORM=${TFM_PLATFORM_LOCAL_PATH}
-DPLATFORM_HAS_FIRMWARE_UPDATE_SUPPORT=ON
-DMCUBOOT_DATA_SHARING=ON
-DMCUBOOT_CONFIRM_IMAGE=${TFM_PLATFORM_CONFIRM_IMAGE}
-DMCUBOOT_UPGRADE_STRATEGY=${TFM_PLATFORM_UPGRADE_STRATEGY}
-DMCUBOOT_IMAGE_VERSION_NS=${MCUBOOT_IMAGE_VERSION_NS}
)

# Configuration of executable
Expand Down
25 changes: 16 additions & 9 deletions Projects/blinky/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,27 @@ set(ARM_CORSTONE_BSP_TARGET_PLATFORM "corstone300" CACHE STRING "Featured Refere
# Configure target
if (${ARM_CORSTONE_BSP_TARGET_PLATFORM} STREQUAL "corstone300")
set(TFM_PLATFORM_LOCAL_PATH "arm/mps3/an552")
set(TFM_PLATFORM_UPGRADE_STRATEGY "SWAP_USING_SCRATCH")
set(TFM_PLATFORM_CONFIRM_IMAGE ON)
else()
message(FATAL_ERROR "Invalid ARM_CORSTONE_BSP_TARGET_PLATFORM (${ARM_CORSTONE_BSP_TARGET_PLATFORM}) set. It should be corstone300")
endif()

set(TFM_PLATFORM "${TFM_PLATFORM_LOCAL_PATH}")
set(TFM_PARTITION_FIRMWARE_UPDATE ON)
set(TFM_PSA_FIRMWARE_UPDATE ON)
set(CONFIG_TFM_ENABLE_CP10CP11 ON)
set(MCUBOOT_IMAGE_VERSION_NS "0.0.0" )

# Extra arguments for TF-M and ML
set(TFM_CMAKE_ARGS "-DPROJECT_CONFIG_HEADER_FILE=${PRJ_DIR}/Config/tfm-config/project_config.h;-DCONFIG_TFM_ENABLE_CP10CP11=ON;-DTFM_EXCEPTION_INFO_DUMP=ON;-DNS=ON;-DPLATFORM_DEFAULT_UART_STDOUT=ON;-DMCUBOOT_SIGNATURE_KEY_LEN=2048;-DMCUBOOT_LOG_LEVEL=INFO;-DTFM_SPM_LOG_LEVEL=TFM_SPM_LOG_LEVEL_INFO;-DTFM_PARTITION_CRYPTO=ON;-DTFM_PARTITION_FIRMWARE_UPDATE=ON;-DTFM_PARTITION_INITIAL_ATTESTATION=ON;-DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON;-DTFM_PARTITION_PLATFORM=ON;-DTFM_PARTITION_PROTECTED_STORAGE=ON")
set(TFM_CMAKE_ARGS
-DPROJECT_CONFIG_HEADER_FILE=${PRJ_DIR}/Config/tfm-config/project_config.h
-DCONFIG_TFM_ENABLE_CP10CP11=ON
-DTFM_EXCEPTION_INFO_DUMP=ON
-DNS=ON;
-DPLATFORM_DEFAULT_UART_STDOUT=ON;
-DMCUBOOT_SIGNATURE_KEY_LEN=2048
-DMCUBOOT_LOG_LEVEL=INFO
-DTFM_SPM_LOG_LEVEL=TFM_SPM_LOG_LEVEL_INFO
-DTFM_PARTITION_CRYPTO=ON
-DTFM_PARTITION_INITIAL_ATTESTATION=ON
-DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE=ON
-DTFM_PARTITION_PLATFORM=ON
-DTFM_PARTITION_PROTECTED_STORAGE=ON
-DTFM_PLATFORM=${TFM_PLATFORM_LOCAL_PATH}
)

# Configuration of executable
set(EXE_SUFFIX ".axf")
Expand Down
Loading