Skip to content

Commit c2d9ce2

Browse files
gergelykarmurutva
authored andcommitted
bsp: Add Corstone-320
Signed-off-by: Gergely Korcsák <[email protected]>
1 parent ddcaf7b commit c2d9ce2

File tree

22 files changed

+1406
-23
lines changed

22 files changed

+1406
-23
lines changed

.gitlab-ci.yml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ variables:
1919

2020
# Those fragments contain base variables required by pipelines for applications.
2121
# They can be used to set matrix parameters and extended using << : .anchor syntax
22+
.pipeline_config_corstone320: &pipeline_config_corstone320
23+
TARGET: [corstone320]
2224
.pipeline_config_corstone315: &pipeline_config_corstone315
2325
TARGET: [corstone315]
2426
.pipeline_config_corstone310: &pipeline_config_corstone310
@@ -77,6 +79,26 @@ workflow:
7779
applications/${APP_UNDERSCORED}/configs/aws_configs
7880
fi
7981
82+
# Build Corstone320 applications which later are tested.
83+
build-applications-corstone320:
84+
stage: build
85+
extends: .build_job
86+
parallel:
87+
matrix:
88+
-
89+
<< : [*pipeline_config_corstone320, *pipeline_config_toolchain]
90+
APP: [blinky, keyword-detection, speech-recognition, object-detection]
91+
INFERENCE: [ETHOS]
92+
AUDIO: [ROM]
93+
CONN_STACK: [FREERTOS_PLUS_TCP]
94+
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
95+
artifacts:
96+
paths:
97+
- ${TARGET}_${APP}_${TOOLCHAIN}_${INFERENCE}_${AUDIO}_${CONN_STACK}_${PSA_CRYPTO_IMPLEMENTATION}_build.tar.gz
98+
expire_in: 1 week
99+
variables:
100+
GIT_SUBMODULE_STRATEGY: recursive
101+
80102
# Build Corstone315 applications which later are tested.
81103
build-applications-corstone315:
82104
stage: build
@@ -157,8 +179,13 @@ build-applications-corstone300:
157179
if [ $TARGET == "corstone315" ];then
158180
FVP_BIN=FVP_Corstone_SSE-315
159181
fi
182+
- |
183+
if [ $TARGET == "corstone320" ];then
184+
FVP_BIN=FVP_Corstone_SSE-320
185+
fi
160186
parallel:
161187
matrix:
188+
- *pipeline_config_corstone320
162189
- *pipeline_config_corstone315
163190
- *pipeline_config_corstone310
164191
- *pipeline_config_corstone300
@@ -168,6 +195,8 @@ build-applications-corstone300:
168195
test-blinky-output:
169196
extends: .test_job
170197
needs:
198+
- job: build-applications-corstone320
199+
artifacts: true
171200
- job: build-applications-corstone315
172201
artifacts: true
173202
- job: build-applications-corstone310
@@ -186,6 +215,13 @@ test-blinky-output:
186215
--fail-output-file "applications/${APP}/tests/fail_output.log"
187216
parallel:
188217
matrix:
218+
-
219+
<< : [*pipeline_config_corstone320, *pipeline_config_toolchain]
220+
APP: [blinky]
221+
INFERENCE: [ETHOS]
222+
AUDIO: [ROM]
223+
CONN_STACK: [FREERTOS_PLUS_TCP]
224+
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
189225
-
190226
<< : [*pipeline_config_corstone315, *pipeline_config_toolchain]
191227
APP: [blinky]
@@ -257,6 +293,8 @@ test-blinky-output:
257293
test-ml-applications-output:
258294
extends: .test-applications_base
259295
needs:
296+
- job: build-applications-corstone320
297+
artifacts: true
260298
- job: build-applications-corstone315
261299
artifacts: true
262300
- job: build-applications-corstone310
@@ -265,6 +303,14 @@ test-ml-applications-output:
265303
artifacts: true
266304
parallel:
267305
matrix:
306+
-
307+
<< : *pipeline_config_corstone320
308+
APP: [keyword-detection, speech-recognition, object-detection]
309+
INFERENCE: [ETHOS]
310+
AUDIO: [ROM]
311+
TOOLCHAIN: [ARMCLANG]
312+
CONN_STACK: [FREERTOS_PLUS_TCP]
313+
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
268314
-
269315
<< : *pipeline_config_corstone315
270316
APP: [keyword-detection, speech-recognition, object-detection]
@@ -341,6 +387,11 @@ integration-tests:
341387
--timeout-seconds 14400
342388
parallel:
343389
matrix:
390+
-
391+
<< : [*pipeline_config_corstone320, *pipeline_config_toolchain]
392+
APP: [freertos-iot-libraries-tests]
393+
CONN_STACK: [FREERTOS_PLUS_TCP, IOT_VSOCKET]
394+
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
344395
-
345396
<< : [*pipeline_config_corstone315, *pipeline_config_toolchain]
346397
APP: [freertos-iot-libraries-tests]
@@ -383,6 +434,30 @@ sw-vsi-configs-test:
383434
- !reference [.test-applications_base, script]
384435
parallel:
385436
matrix:
437+
-
438+
<< : *pipeline_config_corstone320
439+
APP: [keyword-detection, speech-recognition]
440+
INFERENCE: [ETHOS]
441+
AUDIO: [VSI]
442+
TOOLCHAIN: [ARMCLANG]
443+
CONN_STACK: [FREERTOS_PLUS_TCP]
444+
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
445+
-
446+
<< : *pipeline_config_corstone320
447+
APP: [keyword-detection, speech-recognition]
448+
INFERENCE: [SOFTWARE]
449+
AUDIO: [ROM, VSI]
450+
TOOLCHAIN: [ARMCLANG]
451+
CONN_STACK: [FREERTOS_PLUS_TCP]
452+
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
453+
-
454+
<< : *pipeline_config_corstone320
455+
APP: [object-detection]
456+
INFERENCE: [SOFTWARE]
457+
AUDIO: [ROM]
458+
TOOLCHAIN: [ARMCLANG]
459+
CONN_STACK: [FREERTOS_PLUS_TCP]
460+
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
386461
-
387462
<< : *pipeline_config_corstone315
388463
APP: [keyword-detection, speech-recognition]
@@ -466,6 +541,22 @@ gnu-toolchain-test:
466541
- !reference [.test-applications_base, script]
467542
parallel:
468543
matrix:
544+
-
545+
<< : *pipeline_config_corstone320
546+
APP: [keyword-detection, speech-recognition]
547+
INFERENCE: [ETHOS, SOFTWARE]
548+
AUDIO: [ROM,VSI]
549+
TOOLCHAIN: [GNU]
550+
CONN_STACK: [FREERTOS_PLUS_TCP]
551+
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
552+
-
553+
<< : *pipeline_config_corstone320
554+
APP: [object-detection]
555+
INFERENCE: [ETHOS, SOFTWARE]
556+
AUDIO: [ROM]
557+
TOOLCHAIN: [GNU]
558+
CONN_STACK: [FREERTOS_PLUS_TCP]
559+
PSA_CRYPTO_IMPLEMENTATION: [TF-M]
469560
-
470561
<< : *pipeline_config_corstone315
471562
APP: [keyword-detection, speech-recognition]
@@ -525,6 +616,14 @@ iot-vsocket-psa-crypto-mbedtls-test:
525616
- !reference [.test-applications_base, script]
526617
parallel:
527618
matrix:
619+
-
620+
<< : *pipeline_config_corstone320
621+
APP: [keyword-detection, speech-recognition, object-detection]
622+
INFERENCE: [ETHOS]
623+
AUDIO: [ROM]
624+
TOOLCHAIN: [GNU, ARMCLANG]
625+
CONN_STACK: [IOT_VSOCKET]
626+
PSA_CRYPTO_IMPLEMENTATION: [MBEDTLS]
528627
-
529628
<< : *pipeline_config_corstone315
530629
APP: [keyword-detection, speech-recognition, object-detection]

.vscode/tasks.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@
124124
"options": [
125125
"-tcorstone300",
126126
"-tcorstone310",
127-
"-tcorstone315"
127+
"-tcorstone315",
128+
"-tcorstone320"
128129
],
129130
"default": "-tcorstone315"
130131
},
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Waiting for DM provisioning bundle
2+
Running DM provisioning bundle
3+
Booting TF-M v2.1.0
4+
psa_framework_version is: 257
5+
LED on
6+
LED off
7+
LED on
8+
LED off
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Waiting for DM provisioning bundle
2+
Running DM provisioning bundle
3+
Application version from appFirmwareVersion 0.0.10
4+
Starting bootloader
5+
Booting TF-M v2.1.0
6+
PSA Framework version is: 257
7+
Application version from appFirmwareVersion 0.0.20
8+
ML interface initialised
9+
ML_HEARD_ON
10+
ML UNKNOWN
11+
ML_HEARD_OFF
12+
ML UNKNOWN
13+
ML_HEARD_GO
14+
ML UNKNOWN
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Waiting for DM provisioning bundle
2+
Running DM provisioning bundle
3+
Application version from appFirmwareVersion 0.0.10
4+
Starting bootloader
5+
Booting TF-M v2.1.0
6+
PSA Framework version is: 257
7+
Application version from appFirmwareVersion 0.0.20
8+
Complete recognition: Detected faces: 2
9+
Complete recognition: Detected faces: 2
10+
Complete recognition: Detected faces: 2
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Waiting for DM provisioning bundle
2+
Running DM provisioning bundle
3+
Application version from appFirmwareVersion 0.0.10
4+
Starting bootloader
5+
Booting TF-M v2.1.0
6+
PSA Framework version is: 257
7+
Application version from appFirmwareVersion 0.0.20
8+
Init speex
9+
ML interface initialised
10+
Complete recognition: turn down the temperature in the bedroom

bsp/CMakeLists.txt

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ function(build_ethosu_target_npu_config_values id num_macs)
1010
set(ETHOS_U_NPU_CONFIG_ID "Y${num_macs}" CACHE STRING "Specifies the configuration ID for the NPU." FORCE)
1111
set(ETHOS_U_NPU_MEMORY_MODE Dedicated_Sram CACHE STRING "Specifies the memory mode used in the Vela command." FORCE)
1212
set(ETHOS_U_NPU_CACHE_SIZE "393216" CACHE STRING "Arm Ethos-U65 NPU Cache Size" FORCE)
13+
elseif(id STREQUAL "U85")
14+
set(ETHOS_U_NPU_CONFIG_ID "Z${num_macs}" CACHE STRING "Specifies the configuration ID for the NPU." FORCE)
15+
set(ETHOS_U_NPU_MEMORY_MODE Dedicated_Sram CACHE STRING "Specifies the memory mode used in the Vela command." FORCE)
16+
set(ETHOS_U_NPU_CACHE_SIZE "393216" CACHE STRING "Arm Ethos-U85 NPU Cache Size" FORCE)
1317
endif()
1418
string(TOLOWER "${id}" id)
1519
set(ETHOSU_TARGET_NPU_CONFIG "ethos-${id}-${num_macs}" CACHE STRING "Default NPU configuration" FORCE)
@@ -125,9 +129,44 @@ elseif(ARM_CORSTONE_BSP_TARGET_PLATFORM STREQUAL "corstone315")
125129

126130
set(ISP_MVE_FP ON CACHE BOOL "MVE FP is used by ISP driver" FORCE)
127131

132+
add_subdirectory(isp_mali-c55)
133+
elseif(ARM_CORSTONE_BSP_TARGET_PLATFORM STREQUAL "corstone320")
134+
set(TFM_PLATFORM_LOCAL_PATH "arm/mps4/corstone320" CACHE STRING "TFM Platform local path")
135+
set(TFM_FLASH_S_PARTITION_SIZE "0x40000")
136+
set(TFM_FLASH_NS_PARTITION_SIZE "0x340000")
137+
138+
set(BL1_IMAGE_LOAD_ADDRESS 0x11000000 CACHE STRING "Bootload stage 1 image loading address")
139+
set(BL2_IMAGE_LOAD_ADDRESS 0x12031400 CACHE STRING "Bootload image loading address")
140+
set(S_IMAGE_LOAD_ADDRESS 0x38000000 CACHE STRING "Secure TF-M firmware loading address")
141+
set(NS_IMAGE_LOAD_ADDRESS 0x28040000 CACHE STRING "Non-secure user application loading address")
142+
set(S_CM_PROVISIONING_BUNDLE_LOAD_ADDRESS 0x12024000 CACHE STRING "Secure CM provisioning bundle loading address")
143+
set(S_DM_PROVISIONING_BUNDLE_LOAD_ADDRESS 0x1202aa00 CACHE STRING "Secure DM provisioning bundle loading address")
144+
set(NS_PROVISIONING_BUNDLE_LOAD_ADDRESS 0x213FF000 CACHE STRING "Non-Secure provisioning bundle loading address")
145+
set(NS_DDR4_IMAGE_LOAD_ADDRESS 0x60000000 CACHE STRING "Non-Secure Double Data Rate RAM image loading address")
146+
147+
set(ETHOS_U_BASE_ADDR "0x40004000" CACHE STRING "Ethos-U NPU base address" FORCE)
148+
set(ETHOS_U_IRQN "16" CACHE STRING "Ethos-U NPU Interrupt" FORCE)
149+
set(ETHOS_U_SEC_ENABLED "0" CACHE STRING "Ethos-U NPU Security enable" FORCE)
150+
set(ETHOS_U_PRIV_ENABLED "0" CACHE STRING "Ethos-U NPU Privilege enable" FORCE)
151+
set(ETHOS_U_NPU_ID "U85" CACHE STRING "Arm Ethos-U NPU IP U85")
152+
set(DEFAULT_ML_MAC_U85 "256")
153+
set(VALID_ETHOSU_TARGET_NPU_CONFIGS
154+
"ethos-u85-128"
155+
"ethos-u85-256"
156+
"ethos-u85-512"
157+
"ethos-u85-1024"
158+
"ethos-u85-2048"
159+
)
160+
161+
list(APPEND TFM_CMAKE_APP_ARGS
162+
-DTFM_BL1_LOGGING=ON
163+
)
164+
165+
set(ISP_MVE_FP ON CACHE BOOL "MVE FP is used by ISP driver" FORCE)
166+
128167
add_subdirectory(isp_mali-c55)
129168
else()
130-
message(FATAL_ERROR "Invalid ARM_CORSTONE_BSP_TARGET_PLATFORM (${ARM_CORSTONE_BSP_TARGET_PLATFORM}) set. Supported are corstone300/corstone310")
169+
message(FATAL_ERROR "Invalid ARM_CORSTONE_BSP_TARGET_PLATFORM (${ARM_CORSTONE_BSP_TARGET_PLATFORM}) set. Supported are corstone300/corstone310/corstone315/corstone320")
131170
endif()
132171
set(ETHOS_U_NPU_NUM_MACS ${DEFAULT_ML_MAC_${ETHOS_U_NPU_ID}} CACHE STRING "Number of 8x8 MACs performed per cycle by the NPU")
133172

@@ -182,6 +221,7 @@ target_include_directories(arm-corstone-platform-bsp
182221
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone300>:${CMAKE_CURRENT_LIST_DIR}/corstone300/include>
183222
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone310>:${CMAKE_CURRENT_LIST_DIR}/corstone310/include>
184223
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone315>:${CMAKE_CURRENT_LIST_DIR}/corstone315/include>
224+
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone320>:${CMAKE_CURRENT_LIST_DIR}/corstone320/include>
185225
)
186226

187227
# BSP serial library

bsp/cmake/SetLinkerOptions.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ macro(set_linker_script executable_target)
1010
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone300>:-T ${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/corstone300/an552_ns.ld>
1111
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone310>:-T ${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/corstone310/an555_ns.ld>
1212
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone315>:-T ${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/corstone315/corstone_315_ns.ld>
13+
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone320>:-T ${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/corstone320/corstone_320_ns.ld>
1314
-Wl,--gc-sections,-Map=${executable_target}.map
1415
)
1516
else()
@@ -18,6 +19,7 @@ macro(set_linker_script executable_target)
1819
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone300>:--scatter=${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/corstone300/an552_ns.sct>
1920
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone310>:--scatter=${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/corstone310/an555_ns.sct>
2021
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone315>:--scatter=${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/corstone315/corstone_315_ns.sct>
22+
$<$<STREQUAL:${ARM_CORSTONE_BSP_TARGET_PLATFORM},corstone320>:--scatter=${IOT_REFERENCE_ARM_CORSTONE3XX_SOURCE_DIR}/bsp/corstone320/corstone_320_ns.sct>
2123
--map
2224
)
2325
endif()

0 commit comments

Comments
 (0)