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-310 target support #14

Merged
merged 11 commits into from
Oct 25, 2023
24 changes: 12 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ workflow:
before_script:
- python -m pip install pyelftools
- |
if [ $TARGET == "Corstone-300" ];then
AVH=/opt/VHT/VHT_Corstone_SSE-300_Ethos-U55
if [ $TARGET == "corstone300" ];then
FVP_BIN=FVP_Corstone_SSE-300_Ethos-U55
fi
- |
if [ $TARGET == "Corstone-310" ];then
AVH=/opt/VHT/VHT_Corstone_SSE-310
if [ $TARGET == "corstone310" ];then
FVP_BIN=FVP_Corstone_SSE-310
fi
parallel:
matrix:
- TARGET: [Corstone-300]
- TARGET: [corstone300, corstone310]
TOOLCHAIN: [GNU, ARMCLANG]
variables:
PYTHONUNBUFFERED: 1

# The test job extends .basejob. It add rules to map targets to AVH binaries,
# The test job extends .basejob. It add rules to map targets to FVP binaries,
# require the application to be built and retrieve the artifacts.
.test_job:
stage: test
Expand All @@ -77,24 +77,24 @@ build-applications:
- ./ci/generate_credentials.sh -f -p Config/aws_configs
- git config --global user.email "[email protected]"
- git config --global user.name "ci"
- ./Tools/scripts/build.sh aws-iot-example --toolchain $TOOLCHAIN --certificate_path $PWD/certificate.pem --private_key_path $PWD/private_key.pem
- ./Tools/scripts/build.sh aws-iot-example --target $TARGET --toolchain $TOOLCHAIN --certificate_path $PWD/certificate.pem --private_key_path $PWD/private_key.pem
- |
tar -czf ${TOOLCHAIN}_build.tar.gz \
tar -czf ${TARGET}_${TOOLCHAIN}_build.tar.gz \
build/Projects/aws-iot-example/aws-iot-example_merged.elf \
build/Projects/aws-iot-example/aws-iot-example-update_signed.bin \
build/Projects/aws-iot-example/update-signature.txt \
Config/aws_configs
artifacts:
paths:
- ${TOOLCHAIN}_build.tar.gz
- ${TARGET}_${TOOLCHAIN}_build.tar.gz
expire_in: 1 week

# Test connection to the AWS cloud
test-ota-aws:
extends: .test_job
script:
- tar xf ${TOOLCHAIN}_build.tar.gz
- pytest -s Tools/tests/test_ota.py --build-path "build" --avh $AVH --credentials-path "Config/aws_configs"
- tar xf ${TARGET}_${TOOLCHAIN}_build.tar.gz
- pytest -s Tools/tests/test_ota.py --build-path "build" --fvp $FVP_BIN --credentials-path "Config/aws_configs"

integration-tests:
stage: test
Expand All @@ -112,7 +112,7 @@ integration-tests:
- go run echo_server.go&
- popd
- sleep 1
- pytest -s Tools/tests/test_integration.py --build-path "build" --avh $AVH --credentials-path "Config/aws_configs"
- pytest -s Tools/tests/test_integration.py --build-path "build" --fvp $FVP_BIN --credentials-path "Config/aws_configs"

aws-cleanup:
stage: cleanup
Expand Down
18 changes: 13 additions & 5 deletions Bsp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@ add_subdirectory(arm-corstone-platform-bsp)
# Target specific image loading addresses
if(ARM_CORSTONE_BSP_TARGET_PLATFORM STREQUAL "corstone300")
set(BL2_IMAGE_LOAD_ADDRESS 0x00000000 PARENT_SCOPE)
set(S_IMAGE_LOAD_ADDRESS 0x11000000 PARENT_SCOPE)
set(NS_IMAGE_LOAD_ADDRESS 0x01060000 PARENT_SCOPE)
set(S_IMAGE_LOAD_ADDRESS 0x38000000 PARENT_SCOPE)
set(NS_IMAGE_LOAD_ADDRESS 0x28080000 PARENT_SCOPE)
set(S_PROVISIONING_BUNDLE_LOAD_ADDRESS 0x10022000 PARENT_SCOPE)
set(NS_PROVISIONING_BUNDLE_LOAD_ADDRESS 0x210FF000 PARENT_SCOPE)
set(NS_PROVISIONING_BUNDLE_LOAD_ADDRESS 0x211FF000 PARENT_SCOPE)
elseif(ARM_CORSTONE_BSP_TARGET_PLATFORM STREQUAL "corstone310")
set(BL2_IMAGE_LOAD_ADDRESS 0x11000000 PARENT_SCOPE)
set(S_IMAGE_LOAD_ADDRESS 0x38000000 PARENT_SCOPE)
set(NS_IMAGE_LOAD_ADDRESS 0x28080000 PARENT_SCOPE)
set(S_PROVISIONING_BUNDLE_LOAD_ADDRESS 0x11022000 PARENT_SCOPE)
set(NS_PROVISIONING_BUNDLE_LOAD_ADDRESS 0x213FF000 PARENT_SCOPE)
endif()

# BSP serial library
Expand All @@ -19,12 +25,14 @@ add_library(fri-bsp STATIC)

target_sources(fri-bsp
PRIVATE
platform/bsp_serial.c
common/bsp_serial.c
)

target_include_directories(fri-bsp
PUBLIC
platform
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone300>:${CMAKE_CURRENT_LIST_DIR}/corstone300/include>
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone310>:${CMAKE_CURRENT_LIST_DIR}/corstone310/include>
common
)

target_link_libraries(fri-bsp
Expand Down
2 changes: 1 addition & 1 deletion Bsp/arm-corstone-platform-bsp
Submodule arm-corstone-platform-bsp updated from ce35a0 to 2e44de
22 changes: 22 additions & 0 deletions Bsp/cmake/BspUtilities.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2023 Arm Limited and/or its affiliates
# <[email protected]>
# SPDX-License-Identifier: Apache-2.0

# Set the linker script for the target specified
macro(set_linker_script executable_target)
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
target_link_options(${executable_target}
PRIVATE
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone300>:-T ${PRJ_DIR}/Bsp/corstone300/an552_ns.ld>
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone310>:-T ${PRJ_DIR}/Bsp/corstone310/an555_ns.ld>
--specs=nosys.specs
)
else()
target_link_options(${executable_target}
PRIVATE
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone300>:--scatter=${PRJ_DIR}/Bsp/corstone300/an552_ns.sct>
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone310>:--scatter=${PRJ_DIR}/Bsp/corstone310/an555_ns.sct>
--map
)
endif()
endmacro(set_linker_script executable_target)
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions Bsp/an552_ns.ld → Bsp/corstone300/an552_ns.ld
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ __HEAP_SIZE = 0x00000400;

MEMORY
{
FLASH (rx) : ORIGIN = (0x01060000 + 0x400), LENGTH = (0x60000 - 0x400 - 0x800)
RAM (rwx) : ORIGIN = 0x21000000, LENGTH = 0x00100000
FLASH (rx) : ORIGIN = (0x28080000 + 0x400), LENGTH = (0x300000 - 0x400 - 0x800)
RAM (rwx) : ORIGIN = 0x21100000, LENGTH = 0x00100000
}

/* Linker script to place sections and symbol values.
Expand Down
6 changes: 3 additions & 3 deletions Bsp/an552_ns.sct → Bsp/corstone300/an552_ns.sct
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
* SPDX-License-Identifier: Apache-2.0
*/

LR_CODE (0x01000000 + ((((0) + (0x60000)) + (0x400)))) {
ER_CODE (0x01000000 + ((((0) + (0x60000)) + (0x400)))) { ;(((0x60000) - (0x400) - (0xC00))) {
LR_CODE (0x28000000 + ((((0) + (0x80000)) + (0x400)))) {
ER_CODE (0x28000000 + ((((0) + (0x80000)) + (0x400)))) { ;(((0x300000) - (0x400) - (0xC00))) {
*.o (RESET +First)
* (InRoot$$Sections)
* (+RO)
}

ER_DATA (0x21000000) {
ER_DATA (0x21100000) {
* (+ZI +RW)
}

Expand Down
30 changes: 30 additions & 0 deletions Bsp/corstone300/include/FreeRTOSConfig_target.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* FreeRTOS Kernel V10.4.1
* Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2023 Arm Limited and/or its affiliates
* <[email protected]>
* SPDX-License-Identifier: MIT
*/

/* From the "Fast Models Reference Guide" (https://developer.arm.com/documentation/100964/1123/About-the-models),
* "Programmer's View (PV) models of processors and devices work at a level
* where functional behavior is equivalent to what a programmer would see using
* the hardware.
*
* They sacrifice timing accuracy to achieve fast simulation execution speeds:
* you can use the PV models for confirming software functionality, but you
* must not rely on the accuracy of cycle counts, low-level component
* interactions, or other hardware-specific behavior."
*
* As described above, FVPs sacrifice timing accuracy to achieve fast
* simulation execution speeds. Therefore, we need this work around of setting
* `configTICK_RATE_HZ` to `100` to simulate scheduler polling rate of
* `1000 Hz` or 1 tick per second.
*
* In addition, the macro `pdMS_TO_TICKS` is defined here to match the 1 tick
* per second instead of using the macro defined in
* `FreeRTOS-kernel/include/projdefs.h`
*/
#define configTICK_RATE_HZ ( ( uint32_t ) 100 )
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) xTimeInMs )
#define TICKS_TO_pdMS( xTicks ) ( ( uint32_t ) xTicks )
11 changes: 11 additions & 0 deletions Bsp/corstone300/include/provisioning_config_target.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/* Copyright 2023 Arm Limited and/or its affiliates
* <[email protected]>
* SPDX-License-Identifier: MIT
*/

#ifndef _PROVISIONING_CONFIG_TARGET_H_
#define _PROVISIONING_CONFIG_TARGET_H_

#define PROVISIONING_DATA_START ( 0x211FF000 )

#endif /* _PROVISIONING_CONFIG_TARGET_H_ */
Loading
Loading