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

Add Corstone-320 Platform support #96

Merged
merged 12 commits into from
Oct 22, 2024
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
14 changes: 14 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,20 @@ RUN rm -rf /home/ubuntu/FVP_Corstone_SSE-315; \
rm -rf /tmp/arm-ecosystem-fvp
ENV PATH="/home/ubuntu/FVP_Corstone_SSE-315/models/Linux64_armv8l_GCC-9.3:/home/ubuntu/FVP_Corstone_SSE-315/models/Linux64_GCC-9.3:${PATH}"

# Download and install Corstone-320 ecosystem FVP
RUN rm -rf /home/ubuntu/FVP_Corstone_SSE-320; \
mkdir /tmp/arm-ecosystem-fvp; \
FVP_LINK=""; \
if [[ $(uname -m) == "aarch64" ]]; then \
FVP_LINK="_armv8l"; \
fi; \
wget -qO - https://developer.arm.com/-/media/Arm%20Developer%20Community/Downloads/OSS/FVP/Corstone-320/FVP_Corstone_SSE-320_11.27_25_Linux64${FVP_LINK}.tgz \
| tar -xz -C /tmp/arm-ecosystem-fvp; \
cd /tmp/arm-ecosystem-fvp && ./FVP_Corstone_SSE-320.sh --i-agree-to-the-contained-eula --no-interactive -q; \
rm -rf /tmp/arm-ecosystem-fvp
ENV PATH="/home/ubuntu/FVP_Corstone_SSE-320/models/Linux64_armv8l_GCC-9.3:/home/ubuntu/FVP_Corstone_SSE-320/models/Linux64_GCC-9.3:${PATH}"
ENV LD_LIBRARY_PATH=/home/ubuntu/FVP_Corstone_SSE-320/python/lib

# Install uncrustify
# With ubuntu 22.04, the version of uncrustify installed is 0.72.0+dfsg1-2.
# However, we need the version 0.69.0. Therefore, build and install it manually.
Expand Down
104 changes: 104 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ variables:

# Those fragments contain base variables required by pipelines for applications.
# They can be used to set matrix parameters and extended using << : .anchor syntax
.pipeline_config_corstone320: &pipeline_config_corstone320
TARGET: [corstone320]
.pipeline_config_corstone315: &pipeline_config_corstone315
TARGET: [corstone315]
.pipeline_config_corstone310: &pipeline_config_corstone310
Expand Down Expand Up @@ -74,9 +76,30 @@ workflow:
build/${APP}_merged.elf \
build/${APP}-update_signed.bin \
build/update-signature.txt \
build/CMakeCache.txt \
applications/${APP_UNDERSCORED}/configs/aws_configs
fi

# Build Corstone320 applications which later are tested.
build-applications-corstone320:
stage: build
extends: .build_job
parallel:
matrix:
-
<< : [*pipeline_config_corstone320, *pipeline_config_toolchain]
APP: [blinky, keyword-detection, speech-recognition, object-detection]
INFERENCE: [ETHOS]
AUDIO: [ROM]
CONN_STACK: [FREERTOS_PLUS_TCP]
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
artifacts:
paths:
- ${TARGET}_${APP}_${TOOLCHAIN}_${INFERENCE}_${AUDIO}_${CONN_STACK}_${PSA_CRYPTO_IMPLEMENTATION}_build.tar.gz
expire_in: 1 week
variables:
GIT_SUBMODULE_STRATEGY: recursive

# Build Corstone315 applications which later are tested.
build-applications-corstone315:
stage: build
Expand Down Expand Up @@ -157,8 +180,13 @@ build-applications-corstone300:
if [ $TARGET == "corstone315" ];then
FVP_BIN=FVP_Corstone_SSE-315
fi
- |
if [ $TARGET == "corstone320" ];then
FVP_BIN=FVP_Corstone_SSE-320
fi
parallel:
matrix:
- *pipeline_config_corstone320
- *pipeline_config_corstone315
- *pipeline_config_corstone310
- *pipeline_config_corstone300
Expand All @@ -168,6 +196,8 @@ build-applications-corstone300:
test-blinky-output:
extends: .test_job
needs:
- job: build-applications-corstone320
artifacts: true
- job: build-applications-corstone315
artifacts: true
- job: build-applications-corstone310
Expand All @@ -186,6 +216,13 @@ test-blinky-output:
--fail-output-file "applications/${APP}/tests/fail_output.log"
parallel:
matrix:
-
<< : [*pipeline_config_corstone320, *pipeline_config_toolchain]
APP: [blinky]
INFERENCE: [ETHOS]
AUDIO: [ROM]
CONN_STACK: [FREERTOS_PLUS_TCP]
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
-
<< : [*pipeline_config_corstone315, *pipeline_config_toolchain]
APP: [blinky]
Expand Down Expand Up @@ -216,6 +253,7 @@ test-blinky-output:
tar xf ${TARGET}_${APP}_${TOOLCHAIN}_${INFERENCE}_${AUDIO}_${CONN_STACK}_${PSA_CRYPTO_IMPLEMENTATION}_build.tar.gz
fi
- export APP_UNDERSCORED=$(echo ${APP} | tr '-' '_')
- export SIGNING_ALGO=$(cat build/CMakeCache.txt | grep AWS_OTA_SIGNATURE_TYPE | sed s/.*=// | sed s/-.*//)
- |
if [[ $AUDIO == "VSI" ]]; then
pytest -s tools/tests/test_applications.py \
Expand All @@ -225,6 +263,7 @@ test-blinky-output:
--credentials-path "applications/${APP_UNDERSCORED}/configs/aws_configs" \
--merged-elf-name "${APP}_merged.elf" \
--signed-update-bin-name "${APP}-update_signed.bin" \
--signing-algo ${SIGNING_ALGO} \
--timeout-seconds 2700 \
--pass-output-file "applications/${APP_UNDERSCORED}/tests/${TARGET}_pass_output.log" \
--fail-output-file "applications/${APP_UNDERSCORED}/tests/fail_output.log" \
Expand All @@ -237,6 +276,7 @@ test-blinky-output:
--credentials-path "applications/${APP_UNDERSCORED}/configs/aws_configs" \
--merged-elf-name "${APP}_merged.elf" \
--signed-update-bin-name "${APP}-update_signed.bin" \
--signing-algo ${SIGNING_ALGO} \
--timeout-seconds 1800 \
--pass-output-file "applications/${APP_UNDERSCORED}/tests/${TARGET}_pass_output.log" \
--fail-output-file "applications/${APP_UNDERSCORED}/tests/fail_output.log"
Expand All @@ -247,6 +287,7 @@ test-blinky-output:
--credentials-path "applications/${APP_UNDERSCORED}/configs/aws_configs" \
--merged-elf-name "${APP}_merged.elf" \
--signed-update-bin-name "${APP}-update_signed.bin" \
--signing-algo ${SIGNING_ALGO} \
--timeout-seconds 2700 \
--pass-output-file "applications/${APP_UNDERSCORED}/tests/${TARGET}_pass_output.log" \
--fail-output-file "applications/${APP_UNDERSCORED}/tests/fail_output.log"
Expand All @@ -257,6 +298,8 @@ test-blinky-output:
test-ml-applications-output:
extends: .test-applications_base
needs:
- job: build-applications-corstone320
artifacts: true
- job: build-applications-corstone315
artifacts: true
- job: build-applications-corstone310
Expand All @@ -265,6 +308,14 @@ test-ml-applications-output:
artifacts: true
parallel:
matrix:
-
<< : *pipeline_config_corstone320
APP: [keyword-detection, speech-recognition, object-detection]
INFERENCE: [ETHOS]
AUDIO: [ROM]
TOOLCHAIN: [ARMCLANG]
CONN_STACK: [FREERTOS_PLUS_TCP]
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
-
<< : *pipeline_config_corstone315
APP: [keyword-detection, speech-recognition, object-detection]
Expand Down Expand Up @@ -341,6 +392,11 @@ integration-tests:
--timeout-seconds 14400
parallel:
matrix:
-
<< : [*pipeline_config_corstone320, *pipeline_config_toolchain]
APP: [freertos-iot-libraries-tests]
CONN_STACK: [FREERTOS_PLUS_TCP, IOT_VSOCKET]
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
-
<< : [*pipeline_config_corstone315, *pipeline_config_toolchain]
APP: [freertos-iot-libraries-tests]
Expand Down Expand Up @@ -383,6 +439,30 @@ sw-vsi-configs-test:
- !reference [.test-applications_base, script]
parallel:
matrix:
-
<< : *pipeline_config_corstone320
APP: [keyword-detection, speech-recognition]
INFERENCE: [ETHOS]
AUDIO: [VSI]
TOOLCHAIN: [ARMCLANG]
CONN_STACK: [FREERTOS_PLUS_TCP]
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
-
<< : *pipeline_config_corstone320
APP: [keyword-detection, speech-recognition]
INFERENCE: [SOFTWARE]
AUDIO: [ROM, VSI]
TOOLCHAIN: [ARMCLANG]
CONN_STACK: [FREERTOS_PLUS_TCP]
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
-
<< : *pipeline_config_corstone320
APP: [object-detection]
INFERENCE: [SOFTWARE]
AUDIO: [ROM]
TOOLCHAIN: [ARMCLANG]
CONN_STACK: [FREERTOS_PLUS_TCP]
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
-
<< : *pipeline_config_corstone315
APP: [keyword-detection, speech-recognition]
Expand Down Expand Up @@ -466,6 +546,22 @@ gnu-toolchain-test:
- !reference [.test-applications_base, script]
parallel:
matrix:
-
<< : *pipeline_config_corstone320
APP: [keyword-detection, speech-recognition]
INFERENCE: [ETHOS, SOFTWARE]
AUDIO: [ROM,VSI]
TOOLCHAIN: [GNU]
CONN_STACK: [FREERTOS_PLUS_TCP]
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
-
<< : *pipeline_config_corstone320
APP: [object-detection]
INFERENCE: [ETHOS, SOFTWARE]
AUDIO: [ROM]
TOOLCHAIN: [GNU]
CONN_STACK: [FREERTOS_PLUS_TCP]
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
-
<< : *pipeline_config_corstone315
APP: [keyword-detection, speech-recognition]
Expand Down Expand Up @@ -525,6 +621,14 @@ iot-vsocket-psa-crypto-mbedtls-test:
- !reference [.test-applications_base, script]
parallel:
matrix:
-
<< : *pipeline_config_corstone320
APP: [keyword-detection, speech-recognition, object-detection]
INFERENCE: [ETHOS]
AUDIO: [ROM]
TOOLCHAIN: [GNU, ARMCLANG]
CONN_STACK: [IOT_VSOCKET]
PSA_CRYPTO_IMPLEMENTATION: [MBEDTLS]
-
<< : *pipeline_config_corstone315
APP: [keyword-detection, speech-recognition, object-detection]
Expand Down
3 changes: 2 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,8 @@
"options": [
"-tcorstone300",
"-tcorstone310",
"-tcorstone315"
"-tcorstone315",
"-tcorstone320"
],
"default": "-tcorstone315"
},
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ is used to run the application artefacts.
The [currently released version <11.24.22>](https://developer.arm.com/downloads/-/arm-ecosystem-fvps)
of FVP is supported by the FRI.

* [Corstone-320](https://developer.arm.com/Processors/Corstone-320)
* Arm Cortex-M85 CPU, Ethos-U85 NPU and Mali-C55 ISP
* [Corstone-315](https://developer.arm.com/Processors/Corstone-315)
* Arm Cortex-M85 CPU, Ethos-U65 NPU and Mali-C55 ISP
* [Corstone-310](https://developer.arm.com/Processors/Corstone-310)
Expand Down
8 changes: 8 additions & 0 deletions applications/blinky/tests/corstone320_pass_output.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Waiting for DM provisioning bundle
Running DM provisioning bundle
Booting TF-M v2.1.0
psa_framework_version is: 257
LED on
LED off
LED on
LED off
3 changes: 3 additions & 0 deletions applications/freertos_iot_libraries_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

cmake_minimum_required(VERSION 3.21.0 FATAL_ERROR)

set(AWS_OTA_SIGNATURE_TYPE "RSA-3072" CACHE STRING "Supported algorithms for signature validation [RSA-2048, RSA-3072, EC-P256, EC-P384]")

# From: ota-for-aws-iot-embedded-sdk/source/include/ota_appversion32.h
# struct version
# {
Expand Down Expand Up @@ -51,6 +53,7 @@ list(APPEND CMAKE_MODULE_PATH ${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/cm
list(APPEND CMAKE_MODULE_PATH ${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/components/aws_iot/cmake)
list(APPEND CMAKE_MODULE_PATH ${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/components/security/trusted_firmware-m/integration/cmake)
include(SetLinkerOptions)
include(AWSIoTHelpers)
include(GenerateAWSUpdateDigestAndSignature)
include(MergeTfmImages)
include(SignTfmImage)
Expand Down
2 changes: 1 addition & 1 deletion applications/freertos_iot_libraries_tests/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ int main( void )

LogInfo( ( "Device key provisioning succeeded \n" ) );

psa_status_t uxStatus = xOtaProvisionCodeSigningKey( &xOTACodeVerifyKeyHandle, 3072 );
psa_status_t uxStatus = xOtaProvisionCodeSigningKey( &xOTACodeVerifyKeyHandle, AWS_OTA_SIGNATURE_KEY_LEN );

if( uxStatus != PSA_SUCCESS )
{
Expand Down
14 changes: 11 additions & 3 deletions applications/helpers/provisioning/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ else()
fri-bsp
)

ExternalProject_Get_Property(trusted_firmware-m-build BINARY_DIR)

if(FREERTOS_LIBRARIES_INTEGRATION_TESTS EQUAL 1)
set(
CODE_SIGNING_PUBLIC_KEY_PEM_PATH
Expand All @@ -33,13 +31,14 @@ else()
else()
set(
CODE_SIGNING_PUBLIC_KEY_PEM_PATH
${BINARY_DIR}/api_ns/image_signing/keys/image_ns_signing_public_key.pem
${AWS_OTA_SIGNATURE_PUBLIC_KEY_PATH}
)
endif()

add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/aws_clientcredential_keys.h
DEPENDS ${AWS_CLIENT_PRIVATE_KEY_PEM_PATH}
DEPENDS ${AWS_CLIENT_CERTIFICATE_PEM_PATH}
DEPENDS aws_ota_signing_keys
COMMAND
${Python3_EXECUTABLE} ${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/tools/scripts/generate_credentials_header.py
${CMAKE_CURRENT_BINARY_DIR}
Expand Down Expand Up @@ -89,4 +88,13 @@ else()
freertos_kernel
mbedtls
)

target_compile_definitions(provisioning-lib
PUBLIC
$<$<STREQUAL:${AWS_OTA_SIG_TYPE},RSA>:AWS_OTA_SIGN_RSA>
$<$<STREQUAL:${AWS_OTA_SIG_TYPE},EC>:AWS_OTA_SIGN_ECDSA>
$<$<STREQUAL:${AWS_OTA_SIG_TYPE},EC>:AWS_OTA_ECDSA_HEADER_SIZE=26>

AWS_OTA_SIGNATURE_KEY_LEN=${AWS_OTA_SIG_LEN}
)
endif() # BUILD_TESTING AND NOT CMAKE_CROSS_COMPILING
Loading
Loading