Verified Commit 53958d4d authored by Vincent Coubard's avatar Vincent Coubard
Browse files

2022.01 release:


- Use CMake as the build system. CMSIS build and CMSIS packs
have been removed as a consequence.
- Use Open IoT SDK instead of gitmodules to fetch dependencies.
- Use AWS embedded C SDK instead of Amazon FreeRTOS distribution
- Use MCU Driver HAL for serial, SAI and EMAC driver.
- Move TF-M target into BSP
Signed-off-by: Vincent Coubard's avatarVincent Coubard <vincent.coubard@arm.com>
parent a051757b
......@@ -28,3 +28,6 @@ tfz
**/ota_build
**/cmake-build-debug
**/.idea
# build dirs
lib/tf-m-build/
[submodule "lib/amazon_freertos"]
path = lib/amazon_freertos
url = https://github.com/aws/amazon-freertos.git
[submodule "lib/mbedcrypto"]
path = lib/mbedcrypto
url = https://github.com/ARMmbed/mbedtls.git
[submodule "lib/mcuboot"]
path = lib/mcuboot
url = https://github.com/mcu-tools/mcuboot.git
[submodule "lib/tf-m"]
path = lib/tf-m
url = https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git
branch = master
[submodule "lib/tfm_test"]
path = lib/tfm_test
url = https://git.trustedfirmware.org/TF-M/tf-m-tests.git
[submodule "lib/VHT"]
path = lib/VHT
url = https://github.com/ARM-software/VHT
[submodule "lib/ml-embedded-evaluation-kit"]
path = lib/ml-embedded-evaluation-kit
url = https://review.mlplatform.org/ml/ethos-u/ml-embedded-evaluation-kit
# Copyright (c) 2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.21)
include(ExternalProject)
include(FetchContent)
# Declare root and other build paths
set(PRJ_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
# Declare relative path to TFM target
# Underscore are used to accomodate TF-M conversion in install folder from dash
# to underscore
set(TFM_PLATFORM_LOCAL_PATH "bsp/tf_m_targets/arm/mps3/an547")
# Declare the Open IoT SDK
FetchContent_Declare(
open_iot_sdk
GIT_REPOSITORY https://git.gitlab.arm.com/iot/open-iot-sdk/sdk.git
GIT_TAG v2022.01
)
# Declare the Open IoT SDK configuration flags
set(IOTSDK_FREERTOS ON)
set(IOTSDK_TFM ON)
set(IOTSDK_ML ON)
set(IOTSDK_CMSIS_RTOS_API ON)
set(IOTSDK_MDH_ARM ON)
set(FETCHCONTENT_QUIET OFF)
set(TFM_PLATFORM "${CMAKE_CURRENT_SOURCE_DIR}/${TFM_PLATFORM_LOCAL_PATH}")
set(TFM_PSA_API OFF)
set(TFM_PARTITION_FIRMWARE_UPDATE ON)
# Extra arguments for TF-M and ML
set(TFM_CMAKE_ARGS "-DNS=OFF;-DPLATFORM_DEFAULT_UART_STDOUT=ON;-DMCUBOOT_SIGNATURE_KEY_LEN=2048;-DTFM_SYSTEM_FP=2;-DTFM_SYSTEM_FP_NS=2;-DTFM_SYSTEM_FPU=2;-DTFM_PARTITION_AUDIT_LOG=ON;-DITS_MAX_ASSET_SIZE=1300;-DCRYPTO_ENGINE_BUF_SIZE=0x8000")
set(ML_CMAKE_ARGS "-Dkws_LABELS_TXT_FILE=resources/kws/labels/ds_cnn_labels.txt;-Dkws_MODEL_TFLITE_PATH=resources_downloaded/kws/ds_cnn_clustered_int8_vela_H128.tflite;-DUSE_CASE_BUILD=kws;-Dkws_ACTIVATION_BUF_SZ=0x00400000")
# Set library to std
set(MBED_C_LIB "std")
# Set FVP variant
set(VARIANT "FVP")
# Apply TF-M patch
find_package(Git)
set(TFM_PATCH_COMMAND ${GIT_EXECUTABLE} apply "${PRJ_DIR}/patches/tf-m.patch" || true)
set(ML_PATCH_COMMAND ${GIT_EXECUTABLE} apply "${PRJ_DIR}/patches/ml-embedded-evaluation-kit.patch" || true)
# Make the Open IoT SDK available
FetchContent_MakeAvailable(open_iot_sdk)
# get paths for the ml kit
ExternalProject_Get_Property(ml-embedded-evaluation-kit SOURCE_DIR)
ExternalProject_Get_Property(ml-embedded-evaluation-kit BINARY_DIR)
set(ml-embedded-evaluation-kit_SOURCE_DIR "${SOURCE_DIR}")
set(ml-embedded-evaluation-kit_BINARY_DIR "${BINARY_DIR}")
set(ml-embedded-evaluation-kit_GENERATED_DIR "${ml-embedded-evaluation-kit_BINARY_DIR}/generated")
set(ml-embedded-evaluation-kit_LIB_DIR ${ml-embedded-evaluation-kit_BINARY_DIR}/lib)
# Setup project
# Start of the project
project(tfm_ns LANGUAGES C CXX)
# Include module path from Open IoT SDK
list(APPEND CMAKE_MODULE_PATH ${open_iot_sdk_SOURCE_DIR}/components/TF-M)
list(APPEND CMAKE_MODULE_PATH ${open_iot_sdk_SOURCE_DIR}/cmake)
# Configuration of executable
set(EXE_SUFFIX ".axf")
set(CMAKE_EXECUTABLE_SUFFIX ${EXE_SUFFIX})
# Include modules from the SDK
include(ElfToBin)
include(TfmSignImage)
# Test management
include(CTest)
# Patch the FreeRTOS target to match config requirements
target_include_directories(freertos-kernel
INTERFACE
${PRJ_DIR}/bsp/aws_configs
${PRJ_DIR}/bsp/freertos-platform
${PRJ_DIR}/kws/include
)
# Compilation Database
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_custom_target(database COMMAND ${CMAKE_COMMAND} -E copy_if_different "${INT_DIR}/compile_commands.json" "${CMAKE_BINARY_DIR}")
# handle libraries
set(MQTT_CONFIG_PATH ${PRJ_DIR}/bsp/aws_configs)
set(HTTP_CONFIG_PATH ${PRJ_DIR}/bsp/aws_configs)
set(PKCS11_CONFIG_PATH ${PRJ_DIR}/bsp/aws_configs)
set(MBEDTLS_CONFIG_PATH ${PRJ_DIR}/bsp/aws_libraries/3rdparty/mbedtls_config)
add_subdirectory(lib/lwip)
add_subdirectory(lib/AWS)
add_subdirectory(bsp)
# Setup Target
set(CMAKE_EXECUTABLE_SUFFIX ${EXE_SUFFIX})
# Add examples targets
add_subdirectory(kws)
add_subdirectory(blinky)
# Copy tf-m binaries at the root
ExternalProject_Get_Property(tf-m BINARY_DIR)
ExternalProject_Get_Property(tf-m SOURCE_DIR)
add_custom_target(tfm-binaries
BYPRODUCTS
${CMAKE_BINARY_DIR}/bootloader/bl2.axf
${CMAKE_BINARY_DIR}/secure_partition/tfm_s.axf
${CMAKE_BINARY_DIR}/secure_partition/tfm_s_unsigned.bin
${CMAKE_BINARY_DIR}/secure_partition/tfm_s_signed.bin
COMMAND ${CMAKE_COMMAND} -E copy
${BINARY_DIR}/install/outputs/$<UPPER_CASE:"EXTERNAL/${TFM_PLATFORM_LOCAL_PATH}">/bl2.axf
"${CMAKE_CURRENT_BINARY_DIR}/bootloader/bl2.axf"
COMMAND ${CMAKE_COMMAND} -E copy
${BINARY_DIR}/install/outputs/$<UPPER_CASE:"EXTERNAL/${TFM_PLATFORM_LOCAL_PATH}">/tfm_s.axf
"${CMAKE_CURRENT_BINARY_DIR}/secure_partition/tfm_s.axf"
COMMAND
${ARM_ELF2BIN} --bin --output ${CMAKE_BINARY_DIR}/secure_partition/tfm_s_unsigned.bin ${CMAKE_BINARY_DIR}/secure_partition/tfm_s.axf --bincombined
COMMAND
python3 ${BINARY_DIR}/install/image_signing/scripts/wrapper/wrapper.py
-v 1.3.0
--layout ${PRJ_DIR}/bsp/signing_layout_s.c
-k ${SOURCE_DIR}/bl2/ext/mcuboot/root-RSA-2048.pem
--public-key-format full
--align 1
--pad
--pad-header
-H 0x400
-s auto
${CMAKE_BINARY_DIR}/secure_partition/tfm_s_unsigned.bin
${CMAKE_BINARY_DIR}/secure_partition/tfm_s_signed.bin
)
add_dependencies(tfm-binaries tf-m)
add_dependencies(tfm-ns-interface tfm-binaries)
......@@ -3,15 +3,12 @@ as can be found in: LICENSE-apache-2.0.txt
Folders containing files under different permissive license than Apache 2.0 are listed below. Each folder should contain its own README file with license specified for its files. The original license text is included in those source files.
- [lib/amazon_freertos](https://github.com/aws/amazon-freertos) - MIT
- [lib/mbedcrypto](https://github.com/ARMmbed/mbedtls) - Apache-2.0
- [lib/mcuboot](https://github.com/mcu-tools/mcuboot) - Apache-2.0
- [lib/ml-embedded-evaluation-kit](https://review.mlplatform.org/plugins/gitiles/ml/ethos-u/ml-embedded-evaluation-kit) - Apache-2.0
- [lib/tf-m](https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git) - BSD-3-Clause
- [lib/tfm_test](https://git.trustedfirmware.org/TF-M/tf-m-tests.git) - BSD-3-Clause
- [bsp/aws_configs](https://github.com/aws/amazon-freertos) - MIT
- [bsp/aws_libraries](https://github.com/aws/amazon-freertos) - MIT
- [lib/aws](https://github.com/aws/aws-iot-device-sdk-embedded-C) - MIT
- [lib/lwip](https://github.com/lwip-tcpip/lwip) - BSD-3-Clause
- [bsp/tf_m_targets](https://git.trustedfirmware.org/TF-M/trusted-firmware-m.git) - BSD-3-Clause
- [lib/VHT](https://github.com/ARM-software/VHT) - Apache-2.0
- [tinycbor](kws/ota/ota_for_aws/source/dependency/3rdparty/tinycbor) - MIT License
- [coreJSON](kws/ota/ota_for_aws/source/dependency/coreJSON) - MIT License
- [tfm test service](bsp/test_services) - BSD-3-Clause
- [tfm secure fw](bsp/secure_fw) - BSD-3-Clause
- [tfm interface](bsp/interface) - BSD-3-Clause
- [Open IoT SDK](https://gitlab.oss.arm.com/engineering/iot-m-sw/open-iot-sdk/sdk) - Apache-2.0
- [bsp/freertos-platform](bsp/freertos-platform/portmacro.h) - Apache-2.0
- [bsp/freertos-platform/portmacro.h](bsp/freertos-platform/portmacro.h) - MIT
......@@ -8,8 +8,6 @@ This repo contains Arm's first [IoT Total Solution](https://www.arm.com/solution
The software supports multiple configurations of the Arm Corstone™-300 subsystem, incorporating the Cortex-M55 processor and Arm Ethos™-U55 microNPU. This total solution provides the complex, non differentiated secure platform software on behalf of the ecosystem, thus enabling you to focus on your next killer app.
This repo also supports a GitHub runner CI/CD workflow right out of the box which leverages [Arm Virtual Hardware](https://www.arm.com/virtual-hardware), a simulation environment that enables software development without the need of physical SoCs.
## Keyword detection application
The keyword detection application runs the DS-CNN model on top of [AWS FreeRTOS](https://docs.aws.amazon.com/freertos/). It detects keywords and inform the user of which keyword has been spotted. The audio data to process are injected at run time using the [Arm Virtual Hardware](https://www.arm.com/virtual-hardware) audio driver.
......@@ -138,9 +136,6 @@ pytest -s kws/tests
To build, run and launch a test of the blinky application, replace `kws` by `blinky`.
Alternatively, the projects can be build using [Keil MDK](https://www.arm.com/products/development-tools/embedded-and-software/keil-mdk).
`blinky.uvmpw` and `kws.uvmpw` contains respectively the `blinky` and `kws` project.
## Updating audio data
The audio data streamed into the Arm Virtual Hardware is read from the file `test.wav` located at the root of the repository. It can be replaced with another audio file with the following configuration:
......@@ -151,66 +146,7 @@ The audio data streamed into the Arm Virtual Hardware is read from the file `tes
# Continuous integration setup
Follow these simple steps to setup a GitHub continuous integration pipeline in a mirror of this repository.
1. Mirror the repository
```sh
# create a mirror (assumes new repo is already created https://docs.github.com/en/articles/creating-a-new-repository)
git clone --bare https://github.com/ARM-software/ATS-Keyword
cd ATS-Keyword
git push --mirror https://github.com/exampleuser/my-ats-keyword.git
cd ..
# clone your new repo
git clone https://github.com/exampleuser/my-ats-keyword.git
# optionally remove the original repo from your hard drive
rm -rf ATS-Keyword
```
2. Launch Arm Virtual Hardware Instance
To utilize the Arm Virtual Hardware, you will need to create an AWS Account if you don’t already have one.
```sh
./scripts/vht_cli.py -k <key pair> start
```
3. Launch GitHub Self-Hosted Runner
```sh
# Login to the ami
ssh ubuntu@<your-ec2-instance>
```
Follow your repo's instructions to configure the github self hosted runner on the Arm Virtual Hardware ec2 instance
https://github.com/exampleuser/my-ats-keyword.git/settings/actions/runners/new . The runner process must be launched in detached state (`&` at the end of the command) to persist after the SSH session.
```sh
# exit the ami and return shell back to your desktop
exit
```
4. Trigger the GitHub Runner.
A first run of the existing action should start right away. Any change to the
repository will trigger a new run.
```sh
# make a trivial (whitespace) code change and watch the code example compile and
# run test cases on Arm Virtual Hardware on your ec2 instance.
# add whitespace to this file
vim .github/workflows/avh.yml
# git push it
git add .github/workflows/avh.yml
git commit -m "initial arm virtual hardware github runner test"
git push origin main
```
Refer to GitHub actions [documentation](https://docs.github.com/en/actions) to make additional changes to the workflow.
Step by step instructions on how to setup a continuous integration pipeline in GitHub are provided in a mirror of this repository located at https://github.com/ARM-software/ATS-Keyword.
# Setting up AWS connectivity
......@@ -283,7 +219,7 @@ The application includes OTA update functionality. The application will check fo
## Creating updated firmware
As part of the example build process an updated firmware will be created that will only differ in version number. That is enough to demonstrate the OTA process. If you want to add other changes you will have to copy the non-updated binary elsewhere before running the build again with your changes as the same build is used for both. The update binary is placed in `build/kws/tfm_ns_signed_update.bin`. This is already signed and is the file you will need to upload to a AWS bucket in the next section.
As part of the example build process an updated firmware will be created that will only differ in version number. That is enough to demonstrate the OTA process. If you want to add other changes you will have to copy the non-updated binary elsewhere before running the build again with your changes as the same build is used for both. The update binary is placed in `build/kws/kws_signed_update.bin`. This is already signed and is the file you will need to upload to a AWS bucket in the next section.
Upon completion of the build and sign process the signature string will be echoed. This will be needed in the next step.
......@@ -301,7 +237,7 @@ Upon completion of the build and sign process the signature string will be echoe
10. Paste the signature string that is echoed during the build of the example (it is also available in `build/kws/update-signature.txt`).
11. Select `SHA-256` and `RSA` algorithms.
12. For **Path name of code signing certificate on device** put in `0` (the path is not used)
13. Select upload new file and select the signed update binary (`build/kws/tfm_ns_signed_update.bin`)
13. Select upload new file and select the signed update binary (`build/kws/kws_signed_update.bin`)
14. Select the S3 bucket you created in step 1. to upload the binary to
15. For **Path name of file on device** put in `non_secure image`
16. As the role, select the OTA role you created in step 2.
......@@ -389,7 +325,6 @@ With ML Eval Kit you can run inferences on either a custom neural network on Eth
| Repository | Description |
|---------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Arm AI Ecosystem Catalog](https://www.arm.com/why-arm/partner-ecosystem/ai-ecosystem-catalog) | Connects you to the right partners, enabling you to build the next generation of AI solutions |
| [Arm CMSIS Build](https://arm-software.github.io/CMSIS_5/Build/html/index.html) | Documentation for the build system used by applications in this repository. |
| [Arm IoT Ecosystem Catalog](https://www.arm.com/why-arm/partner-ecosystem/iot-ecosystem-catalog) | Explore Arm IoT Ecosystem partners who can help transform an idea into a secure, market-leading device. |
| [Arm ML Model Zoo](https://github.com/ARM-software/ML-zoo) | A collection of machine learning models optimized for Arm IP. |
| [Arm Virtual Hardware Documentation](https://mdk-packs.github.io/VHT-TFLmicrospeech/overview/html/index.html) | Documentation for [Arm Virtual Hardware](https://www.arm.com/products/development-tools/simulation/virtual-hardware) |
......
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ProjectWorkspace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_mpw.xsd">
<SchemaVersion>1.0</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<WorkspaceName>WorkSpace</WorkspaceName>
<project>
<PathAndName>.\tfm.bootloader.uvprojx</PathAndName>
</project>
<project>
<PathAndName>.\tfm.secure.uvprojx</PathAndName>
</project>
<project>
<PathAndName>.\tfm.blinky_ns.uvprojx</PathAndName>
<NodeIsActive>1</NodeIsActive>
</project>
</ProjectWorkspace>
# Copyright (c) 2021, Arm Limited and Contributors. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.21)
# Declare the blinky executable
add_executable(blinky
"${PRJ_DIR}/blinky/freertos_adaptation.c"
"${PRJ_DIR}/blinky/main_ns.c"
)
target_link_libraries(blinky
startup
lib-bsp
tfm-ns-interface-cmsis-rtos
freertos-kernel-heap-4
mcu-driver-hal
cmsis-rtos-api
freertos-cmsis-rtos
freertos-kernel
)
# Copy the result of TF-M build in the top level build directory
# Convert axf files into bin
# Sign binaries
ExternalProject_Get_Property(tf-m BINARY_DIR)
ExternalProject_Get_Property(tf-m SOURCE_DIR)
add_custom_command(
TARGET
blinky
POST_BUILD
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/blinky.axf
BYPRODUCTS
${CMAKE_CURRENT_BINARY_DIR}/blinky_unsigned.bin
${CMAKE_CURRENT_BINARY_DIR}/blinky_signed.bin
COMMAND
${ARM_ELF2BIN} --bin --output ${CMAKE_CURRENT_BINARY_DIR}/blinky_unsigned.bin ${CMAKE_CURRENT_BINARY_DIR}/blinky.axf --bincombined
COMMAND
python3 ${BINARY_DIR}/install/image_signing/scripts/wrapper/wrapper.py
-v 1.0.0
--layout ${PRJ_DIR}/bsp/signing_layout_ns.c
-k ${BINARY_DIR}/install/image_signing/keys/root-RSA-2048_1.pem
--public-key-format full
--align 1
--pad
--pad-header
-H 0x400
-s auto
${CMAKE_CURRENT_BINARY_DIR}/blinky_unsigned.bin
${CMAKE_CURRENT_BINARY_DIR}/blinky_signed.bin
)
add_test(
NAME blinky-test
COMMAND pytest -s blinky/tests
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND_EXPAND_LISTS
)
......@@ -19,7 +19,7 @@
#include "task.h"
#include "tfm_ns_interface.h"
#include "psa/protected_storage.h"
#include "serial.h"
#include "bsp_serial.h"
/*
* Semihosting is a mechanism that enables code running on an ARM target
......@@ -62,7 +62,7 @@ static void blink_task( void *pvParameters )
int main()
{
tfm_ns_interface_init();
serial_init();
bsp_serial_init();
xTaskCreate(blink_task, "test task", configMINIMAL_STACK_SIZE*2, NULL, configMAX_PRIORITIES-2, NULL);
......
......@@ -25,7 +25,7 @@ def fvp_path():
@pytest.fixture
def binary_path():
yield os.path.dirname(os.path.abspath(__file__)) + '/../../build'
yield os.path.dirname(os.path.abspath(__file__)) + '/../../build/blinky'
@pytest.fixture
def vsi_script_path():
......@@ -39,15 +39,15 @@ def fvp(fvp_path, binary_path, vsi_script_path):
# Note: It can take few seconds to terminate the FVP
cmdline = [
fvp_path,
'-a', f'cpu_core.cpu0*={binary_path}/bootloader/bl2.axf',
'--data', f'{binary_path}/secure_partition/tfm_s_signed.bin@0x38000000',
'--data', f'{binary_path}/blinky/tfm_ns_signed.bin@0x28060000',
'-C', 'cpu_core.mps3_board.visualisation.disable-visualisation=1',
'-C', 'cpu_core.mps3_board.telnetterminal0.start_telnet=0',
'-C', 'cpu_core.mps3_board.uart0.out_file=-',
'-C', 'cpu_core.mps3_board.uart0.unbuffered_output=1',
'-C', 'cpu_core.mps3_board.uart0.shutdown_on_eot=1',
'-C', 'cpu_core.cpu0.semihosting-enable=1',
'-a', f'cpu0*={binary_path}/../bootloader/bl2.axf',
'--data', f'{binary_path}/../secure_partition/tfm_s_signed.bin@0x38000000',
'--data', f'{binary_path}/blinky_signed.bin@0x28060000',
'-C', 'mps3_board.visualisation.disable-visualisation=1',
'-C', 'mps3_board.telnetterminal0.start_telnet=0',
'-C', 'mps3_board.uart0.out_file=-',
'-C', 'mps3_board.uart0.unbuffered_output=1',
'-C', 'mps3_board.uart0.shutdown_on_eot=1',
'-C', 'cpu0.semihosting-enable=1',
'-V', f'{vsi_script_path}'
]
proc = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
......@@ -59,7 +59,7 @@ def test_blinky(fvp):
# Traces expected in the output
expectations = [
'Starting bootloader',
'Booting TFM v1.3.0',
'Booting TFM v1.4.1',
'FreeRTOS blink task started',
'LED on',
'LED off',
......
# Copyright (c) 2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.18)
set(LIB_NAME lib-bsp)
add_library(${LIB_NAME} STATIC)
target_include_directories(${LIB_NAME}
PRIVATE
${freertos-plus-tcp_SOURCE_DIR}/include
${freertos-plus-tcp_SOURCE_DIR}/portable/Compiler/GCC
${aws-iot-device-sdk_SOURCE_DIR}/libraries/standard/corePKCS11/source/dependency/3rdparty/mbedtls_utils
${aws-iot-device-sdk_SOURCE_DIR}/libraries/standard/corePKCS11/source/dependency/3rdparty/pkcs11
${aws-iot-device-sdk_SOURCE_DIR}/libraries/standard/corePKCS11/source/include
${PRJ_DIR}/kws
${PRJ_DIR}/kws/include
${PRJ_DIR}/kws/ota/ota_pal_psa
${PRJ_DIR}/kws/ota/ota_pal_psa/version
${PRJ_DIR}/kws/ota/provision
${PRJ_DIR}/lib/tf-m
${PRJ_DIR}/lib/tf-m/interface/include
${PRJ_DIR}/lib/tf-m/interface/include/psa
${PRJ_DIR}/lib/tf-m/platform/ext
${PRJ_DIR}/lib/tf-m/platform/ext/cmsis
${PRJ_DIR}/lib/tf-m/platform/ext/common
${PRJ_DIR}/lib/tf-m/platform/ext/driver
${PRJ_DIR}/lib/tf-m/platform/include
${PRJ_DIR}/lib/tfm_test/ns_interface
PUBLIC
${TFM_PLATFORM_TARGET_DIR}/arm/mps3/an547
${TFM_PLATFORM_TARGET_DIR}/arm/mps3/an547/cmsis_drivers
${TFM_PLATFORM_TARGET_DIR}/arm/mps3/an547/cmsis_drivers/config
${TFM_PLATFORM_TARGET_DIR}/arm/mps3/an547/device
${TFM_PLATFORM_TARGET_DIR}/arm/mps3/an547/device/config
${TFM_PLATFORM_TARGET_DIR}/arm/mps3/an547/device/include
${TFM_PLATFORM_TARGET_DIR}/arm/mps3/an547/device/source/armclang
${TFM_PLATFORM_TARGET_DIR}/arm/mps3/an547/native_drivers
${TFM_PLATFORM_TARGET_DIR}/arm/mps3/an547/partition
${TFM_PLATFORM_TARGET_DIR}/arm/mps3/an547/services/src
${TFM_PLATFORM_TARGET_DIR}/arm/mps3/common
${PRJ_DIR}/bsp/aws_configs
${PRJ_DIR}/bsp/aws_libraries/3rdparty/jsmn
${PRJ_DIR}/bsp/aws_libraries/3rdparty/mbedtls_config
${PRJ_DIR}/bsp/aws_libraries/3rdparty/mbedtls_utils
${PRJ_DIR}/bsp/aws_libraries/3rdparty/mbedtls/include
${PRJ_DIR}/bsp/aws_libraries/3rdparty/pkcs11
${PRJ_DIR}/bsp/aws_libraries/abstractions/backoff_algorithm/source/include
${PRJ_DIR}/bsp/aws_libraries/abstractions/mqtt_agent/include
${PRJ_DIR}/bsp/aws_libraries/abstractions/pkcs11/psa
${PRJ_DIR}/bsp/aws_libraries/abstractions/platform/freertos/include
${PRJ_DIR}/bsp/aws_libraries/abstractions/platform/freertos/include/platform
${PRJ_DIR}/bsp/aws_libraries/abstractions/platform/include
${PRJ_DIR}/bsp/aws_libraries/abstractions/platform/include/platform
${PRJ_DIR}/bsp/aws_libraries/abstractions/platform/include/types
${PRJ_DIR}/bsp/aws_libraries/abstractions/secure_sockets/include
${PRJ_DIR}/bsp/aws_libraries/abstractions/transport/secure_sockets
${PRJ_DIR}/bsp/aws_libraries/c_sdk/standard/common/include
${PRJ_DIR}/bsp/aws_libraries/c_sdk/standard/common/include/private
${PRJ_DIR}/bsp/aws_libraries/c_sdk/standard/common/include/types
${PRJ_DIR}/bsp/aws_libraries/c_sdk/standard/https/include
${PRJ_DIR}/bsp/aws_libraries/c_sdk/standard/mqtt/include
${PRJ_DIR}/bsp/aws_libraries/c_sdk/standard/mqtt/include/types
${PRJ_DIR}/bsp/aws_libraries/c_sdk/standard/mqtt/src/private
${PRJ_DIR}/bsp/aws_libraries/coreHTTP/source/dependency/3rdparty/http_parser
${PRJ_DIR}/bsp/aws_libraries/coreHTTP/source/include
${PRJ_DIR}/bsp/aws_libraries/coreHTTP/source/interface
${PRJ_DIR}/bsp/aws_libraries/coreMQTT-Agent/source/include
${PRJ_DIR}/bsp/aws_libraries/coreMQTT/source/include
${PRJ_DIR}/bsp/aws_libraries/coreMQTT/source/interface
${PRJ_DIR}/bsp/aws_libraries/demos/common/http_demo_helpers
${PRJ_DIR}/bsp/aws_libraries/demos/common/mqtt_demo_helpers
${PRJ_DIR}/bsp/aws_libraries/demos/common/mqtt_subscription_manager
${PRJ_DIR}/bsp/aws_libraries/demos/common/ota_demo_helpers
${PRJ_DIR}/bsp/aws_libraries/demos/common/pkcs11_helpers
${PRJ_DIR}/bsp/aws_libraries/demos/coreMQTT_Agent
${PRJ_DIR}/bsp/aws_libraries/demos/dev_mode_key_provisioning/include
${PRJ_DIR}/bsp/aws_libraries/demos/network_manager
${PRJ_DIR}/bsp/aws_libraries/freertos_plus/aws/ota/include
${PRJ_DIR}/bsp/aws_libraries/freertos_plus/aws/ota/src
${PRJ_DIR}/bsp/aws_libraries/freertos_plus/aws/ota/src/http
${PRJ_DIR}/bsp/aws_libraries/freertos_plus/aws/ota/src/mqtt
${PRJ_DIR}/bsp/aws_libraries/freertos_plus/standard/crypto/include
${PRJ_DIR}/bsp/aws_libraries/freertos_plus/standard/tls/include
${PRJ_DIR}/bsp/aws_libraries/logging/include
${PRJ_DIR}/bsp/aws_libraries/3rdparty/lwip_osal/include
${PRJ_DIR}/bsp/freertos-platform
)
target_sources(${LIB_NAME}
PRIVATE
"${PRJ_DIR}/bsp/freertos-platform/application_helpers.c"
"${PRJ_DIR}/bsp/freertos-platform/print_log.c"
)
target_link_libraries(${LIB_NAME}
PRIVATE
FreeRTOS-Plus-TCP
freertos-kernel
tfm-ns-interface
)
target_compile_definitions(${LIB_NAME}
PRIVATE
-DACTIVATION_BUF_SRAM_SZ=0x00400000
-DACTIVATION_BUF_SZ=0x00400000
-DARM_MATH_DSP
-DARM_MATH_LOOPUNROLL
-DARM_MATH_MVEI
-DARM_NPU=1
-DBL2
-DCONFIG_KWS_SCORE_THRESHOLD=0.8
-DCPU_CORTEX_M55=1
-DDAUTH_CHIP_DEFAULT
-DLIBRARY_LOG_LEVEL=3
-DMBEDTLS_CONFIG_FILE=\"<aws_mbedtls_config.h>\"
-DMCUBOOT_DATA_SHARING=1
-DMCUBOOT_IMAGE_NUMBER=2
-DMCUBOOT_SIGN_RSA
-DMCUBOOT_SIGN_RSA_LEN=2048
-DMPS3_PLATFORM=1
-DTFM_PARTITION_AUDIT_LOG
-DTFM_PARTITION_CRYPTO
-DTFM_PARTITION_FIRMWARE_UPDATE
-DTFM_PARTITION_INITIAL_ATTESTATION
-DTFM_PARTITION_INTERNAL_TRUSTED_STORAGE
-DTFM_PARTITION_LOG_LEVEL=TFM_PARTITION_LOG_LEVEL_DEBUG
-DTFM_PARTITION_PLATFORM
-DTFM_PARTITION_PROTECTED_STORAGE
-DTFM_SPM_LOG_LEVEL=0
-DTFM_SYSTEM_FP=2
-DTFM_SYSTEM_FP_NS=2
)
# BSP serial library
add_library(bsp_serial STATIC)
target_sources(bsp_serial
PRIVATE
"${PRJ_DIR}/bsp/freertos-platform/bsp_serial.c"
)
target_include_directories(bsp_serial
PUBLIC
${PRJ_DIR}/bsp/freertos-platform
)
target_link_libraries(bsp_serial
PRIVATE
mcu-driver-hal
)
target_link_libraries(${LIB_NAME}
PRIVATE
bsp_serial
)
target_compile_options(${LIB_NAME}
PRIVATE
--target=arm-arm-none-eabi
-Ofast
-Wall
-Wno-error=cpp
-Wno-ignored-optimization-argument