Skip to content

Commit a9f63ac

Browse files
Merge pull request #146 from AlexTawseArm/mleco-4409-corstone-315
MLECO-4409: Arm Corstone-315 support
2 parents e20d889 + 5126e7a commit a9f63ac

17 files changed

+394
-38
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,6 @@ out/
116116
tmp/
117117
*.cbuild.yml
118118
*.cbuild-idx.yml
119+
*.cbuild-pack.yml
120+
*.cbuild-set.yml
121+

cmsis-pack-examples/README.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,19 @@ Currently, the following examples are supported:
4242

4343
Target platforms supported:
4444

45-
| Name | Type | IP | Examples |
46-
|-----------------------|---------------------|-----------------------------------------------|----------|
47-
| Arm® Corstone™-300 | Virtual or physical | Arm® Cortex®-M55 CPU | All |
48-
| Arm® Corstone™-300-U55 | Virtual or physical | Arm® Cortex®-M55 CPU with Arm® Ethos™-U55 | All |
49-
| Arm® Corstone™-300-U65 | Virtual or physical | Arm® Cortex®-M55 CPU with Arm® Ethos™-U65 | All |
50-
| Arm® Corstone™-310 | Virtual or physical | Arm® Cortex®-M85 CPU | All |
51-
| Arm® Corstone™-310 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U55 | All |
52-
| Arm® Corstone™-310-U65 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U65 NPU | All |
45+
| Name | Type | IP | Examples |
46+
|------------------------------|---------------------|-----------------------------------------------|----------|
47+
| Arm® Corstone™-300 | Virtual or physical | Arm® Cortex®-M55 CPU | All |
48+
| Arm® Corstone™-300-U55 | Virtual or physical | Arm® Cortex®-M55 CPU with Arm® Ethos™-U55 | All |
49+
| Arm® Corstone™-300-U65 | Virtual or physical | Arm® Cortex®-M55 CPU with Arm® Ethos™-U65 | All |
50+
| Arm® Corstone™-310 | Virtual or physical | Arm® Cortex®-M85 CPU | All |
51+
| Arm® Corstone™-310 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U55 | All |
52+
| Arm® Corstone™-310-U65 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U65 NPU | All |
53+
| Arm® Corstone™-315 | Virtual or physical | Arm® Cortex®-M85 CPU | All |
54+
| Arm® Corstone™-315-U65 | Virtual or physical | Arm® Cortex®-M85 CPU with Arm® Ethos™-U65 NPU | All |
5355
| Alif™ Ensemble™ E7 AI/ML Kit | Physical board | Arm® Cortex®-M55 CPU with Arm® Ethos™-U55 NPU | All |
54-
| STM32® F746G-Discovery| Physical board | Arm® Cortex®-M7 CPU | KWS |
55-
| NXP® FRDM-K64F | Physical board | Arm® Cortex®-M4 CPU | KWS |
56+
| STM32® F746G-Discovery | Physical board | Arm® Cortex®-M7 CPU | KWS |
57+
| NXP® FRDM-K64F | Physical board | Arm® Cortex®-M4 CPU | KWS |
5658

5759

5860
Use this import button to open the solution in Keil Studio Cloud: [![Open in Keil Studio](https://img.shields.io/badge/Keil%20Studio-Import-blue?logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNS40LjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCA0NyAxNCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDcgMTQ7IiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+DQoJ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gljLTAuNywwLTEuMywwLjMtMS43LDAuOWMtMC41LDAuOC0wLjYsMS45LTAuNiwyLjl2Ni43aC0yLjlMMjguMiwwLjV6Ii8+DQo8L3N2Zz4NCg==&logoWidth=47)](https://studio.keil.arm.com/?import=https://github.com/Arm-Examples/mlek-cmsis-pack-examples.git)
@@ -130,7 +132,7 @@ In addition to the above, the VSI Python scripts depend on `opencv-python` packa
130132
a virtual environment and installing this with pip.
131133

132134
```shell
133-
$ pip install opencv-python
135+
$ pip install opencv-python "numpy<2.0.0"
134136
```
135137

136138
**NOTE**: The requirement for Python version is driven by the FVP executable. Versions <= 11.26 require
@@ -249,19 +251,30 @@ $ cp ./out/kws/STM32F746-DISCO/Release/kws.Release+STM32F746-DISCO.bin /media/us
249251

250252
### Working with Virtual Streaming Interface
251253

252-
The object detection example for Arm Corstone-300 and Corstone-310 supports Virtual Streaming Interface (VSI).
254+
The object detection example supports the Virtual Streaming Interface (VSI) feature found in the FVPs for Arm Corstone-300, Corstone-310 and Corstone-315.
253255
This allows the locally installed FVP application (or an AVH instance) to read images in from a camera connected to
254256
your local machine and stream these over to the application running within the FVP.
255257

256258
To run the VSI application, append the command line with the v_path argument. For example:
257259

260+
#### Arm Corstone-300 + Arm Corstone-310
261+
258262
```shell
259263
$ <path_to_installed_FVP> \
260264
-a ./out/object-detection-vsi/AVH-SSE-300-U55/Release/object-detection-vsi.axf \
261265
-C ethosu.num_macs=256 \
262266
-C mps3_board.v_path=./device/corstone/vsi/video/python/
263267
```
264268

269+
#### Arm Corstone-315
270+
271+
```shell
272+
$ <path_to_installed_FVP> \
273+
-a ./out/object-detection-vsi/AVH-SSE-315-U65/Release/object-detection-vsi.axf \
274+
-C ethosu.num_macs=256 \
275+
-C mps4_board.v_path=./device/corstone/vsi/video/python/
276+
```
277+
265278
## Application output
266279

267280
Once the project can be built successfully, the execution on target hardware will show output of

cmsis-pack-examples/device/corstone/corstone-device.clayer.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,12 @@ layer:
2525
for-context:
2626
- +AVH-SSE-300
2727
- +AVH-SSE-310
28+
- +AVH-SSE-315
2829
- +AVH-SSE-300-U55
2930
- +AVH-SSE-310-U55
3031
- +AVH-SSE-300-U65
3132
- +AVH-SSE-310-U65
33+
- +AVH-SSE-315-U65
3234
files:
3335
- file: src/retarget.c
3436
- file: src/uart_cmsdk_apb.c
@@ -51,13 +53,16 @@ layer:
5153
for-context:
5254
- +AVH-SSE-300-U65
5355
- +AVH-SSE-310-U65
56+
- +AVH-SSE-315-U65
5457
- component: tensorflow::Machine Learning:TensorFlow:Kernel&Ethos-U
5558
for-context:
5659
- +AVH-SSE-300-U55
5760
- +AVH-SSE-310-U55
5861
- +AVH-SSE-300-U65
5962
- +AVH-SSE-310-U65
63+
- +AVH-SSE-315-U65
6064
- component: tensorflow::Machine Learning:TensorFlow:Kernel&CMSIS-NN
6165
for-context:
6266
- +AVH-SSE-300
63-
- +AVH-SSE-310
67+
- +AVH-SSE-310
68+
- +AVH-SSE-315

cmsis-pack-examples/device/corstone/src/BoardInit.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ static void arm_ethosu_npu_irq_handler(void)
6666
/** @brief Initialises the NPU IRQ */
6767
static void arm_ethosu_npu_irq_init(void)
6868
{
69-
#if defined(CORSTONE310_FVP)
70-
const IRQn_Type ethosu_irqnum = (IRQn_Type)NPU0_IRQn;
71-
#else
69+
#if defined(CORSTONE300_FVP)
7270
const IRQn_Type ethosu_irqnum = (IRQn_Type)ETHOS_U55_IRQn;
71+
#else
72+
const IRQn_Type ethosu_irqnum = (IRQn_Type)NPU0_IRQn;
7373
#endif
7474

7575
/* Register the EthosU IRQ handler in our vector table.
@@ -91,10 +91,10 @@ static int arm_ethosu_npu_init(void)
9191
arm_ethosu_npu_irq_init();
9292

9393
/* Initialise Ethos-U device */
94-
#if defined(CORSTONE310_FVP)
95-
void* const ethosu_base_address = (void*)(NPU0_APB_BASE_NS);
96-
#else
94+
#if defined(CORSTONE300_FVP)
9795
void* const ethosu_base_address = (void*)(ETHOS_U55_APB_BASE_S);
96+
#else
97+
void* const ethosu_base_address = (void*)(NPU0_APB_BASE_NS);
9898
#endif
9999

100100
debug("Cache arena: 0x%p\n", get_cache_arena());

cmsis-pack-examples/device/corstone/src/uart_cmsdk_apb.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its
2+
* SPDX-FileCopyrightText: Copyright 2022, 2024 Arm Limited and/or its
33
* affiliates <[email protected]>
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -20,6 +20,11 @@
2020

2121
#include "uart_config.h"
2222
#include "uart_stdout.h"
23+
24+
/* Platform dependent files */
25+
#include "RTE_Components.h" /* Provides definition for CMSIS_device_header */
26+
#include CMSIS_device_header /* Gives us IRQ num, base addresses. */
27+
2328
#include <stdint.h>
2429
#include <stdio.h>
2530

@@ -46,7 +51,7 @@ typedef struct {
4651
__IO uint32_t BAUDDIV; /* Offset: 0x010 (R/W) Baudrate Divider Register */
4752
} CMSDK_UART_TypeDef;
4853

49-
#define CMSDK_UART0_BASE UART0_BASE
54+
#define CMSDK_UART0_BASE UART0_BASE_NS
5055
#define CMSDK_UART0 ((CMSDK_UART_TypeDef*)CMSDK_UART0_BASE)
5156
#define CMSDK_UART0_BAUDRATE UART0_BAUDRATE
5257

cmsis-pack-examples/device/corstone/src/uart_config.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright 2022 Arm Limited and/or its
2+
* SPDX-FileCopyrightText: Copyright 2022, 2024 Arm Limited and/or its
33
* affiliates <[email protected]>
44
* SPDX-License-Identifier: Apache-2.0
55
*
@@ -19,7 +19,6 @@
1919
#ifndef _UART_CONFIG_H_
2020
#define _UART_CONFIG_H_
2121

22-
#define UART0_BASE (0x49303000)
2322
#define UART0_BAUDRATE (115200)
2423
#define SYSTEM_CORE_CLOCK (25000000)
2524

cmsis-pack-examples/kws/kws.cproject.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ project:
2727
for-context:
2828
- +AVH-SSE-300
2929
- +AVH-SSE-310
30+
- +AVH-SSE-315
3031
- +AVH-SSE-300-U65
3132
- +AVH-SSE-310-U65
33+
- +AVH-SSE-315-U65
3234
- +AVH-SSE-300-U55
3335
- +AVH-SSE-310-U55
3436
- +FRDM-K64F
@@ -65,13 +67,15 @@ project:
6567
for-context:
6668
- +AVH-SSE-300-U65
6769
- +AVH-SSE-310-U65
70+
- +AVH-SSE-315-U65
6871

6972
- file: src/kws_micronet_m.tflite.cpp
7073
for-context:
7174
- +FRDM-K64F
7275
- +STM32F746-DISCO
7376
- +AVH-SSE-300
7477
- +AVH-SSE-310
78+
- +AVH-SSE-315
7579

7680
- group: Device Files
7781
files:
@@ -85,6 +89,10 @@ project:
8589
- +AVH-SSE-310
8690
- +AVH-SSE-310-U55
8791
- +AVH-SSE-310-U65
92+
- file: linker/mps4-sse-315.sct
93+
for-context:
94+
- +AVH-SSE-315
95+
- +AVH-SSE-315-U65
8896
- file: linker/frdm-k64f.sct
8997
for-context: +FRDM-K64F
9098
- file: linker/stm32f746-disco.sct
@@ -105,6 +113,8 @@ project:
105113
- +AVH-SSE-310
106114
- +AVH-SSE-310-U55
107115
- +AVH-SSE-310-U65
116+
- +AVH-SSE-315
117+
- +AVH-SSE-315-U65
108118

109119
- layer: ../device/frdm-k64f/frdm-k64f-device.clayer.yml
110120
for-context:

cmsis-pack-examples/kws/linker/mps3-sse-300.sct

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; Copyright (c) 2021-2022 Arm Limited. All rights reserved.
1+
; SPDX-FileCopyrightText: Copyright 2021-2022, 2024 Arm Limited and/or its affiliates <[email protected]>
22
; SPDX-License-Identifier: Apache-2.0
33
;
44
; Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,8 +16,6 @@
1616
; *************************************************************
1717
; *** Scatter-Loading Description File ***
1818
; *************************************************************
19-
; Please see docs/sections/appendix.md for memory mapping
20-
; information.
2119
;
2220
; Note: Ethos-U NPU can access BRAM, internal SRAM and the DDR
2321
; sections => activation buffers and the model should

cmsis-pack-examples/kws/linker/mps3-sse-310.sct

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; Copyright (c) 2021-2022 Arm Limited. All rights reserved.
1+
; SPDX-FileCopyrightText: Copyright 2021-2022, 2024 Arm Limited and/or its affiliates <[email protected]>
22
; SPDX-License-Identifier: Apache-2.0
33
;
44
; Licensed under the Apache License, Version 2.0 (the "License");
@@ -16,14 +16,11 @@
1616
; *************************************************************
1717
; *** Scatter-Loading Description File ***
1818
; *************************************************************
19-
; Please see docs/sections/appendix.md for memory mapping
20-
; information.
2119
;
2220
; Note: Ethos-U NPU can access BRAM, internal SRAM and the DDR
2321
; sections => activation buffers and the model should
2422
; only be placed in those regions.
2523
;
26-
2724
;---------------------------------------------------------
2825
; First load region (SRAM/BRAM) 2MiB region
2926
;---------------------------------------------------------

0 commit comments

Comments
 (0)