Skip to content

Commit

Permalink
Merge pull request #149 from kshitij-sisodia-arm/feature/mleco-5494
Browse files Browse the repository at this point in the history
MLECO-5494: Updating to CMSIS-6 and other latest packs
  • Loading branch information
kshitij-sisodia-arm authored Oct 7, 2024
2 parents bae03eb + 2566af6 commit b9c9bf2
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 85 deletions.
75 changes: 18 additions & 57 deletions cmsis-pack-examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,17 @@ Python3.9 but this may change for future releases.

## Launch project in Visual Studio Code

Upon opening the project in Visual Studio Code, `vcpkg` will automatically install the required packages as specified in the manifest file [vcpkg-configuration.json](vcpkg-configuration.json).
Upon opening the project in Visual Studio Code, `vcpkg` will automatically install the required packages as specified in
the manifest file [vcpkg-configuration.json](vcpkg-configuration.json). These may include the FVP binaries.

## Download Software Packs

Once `vcpkg` has finished configuring the environment, a prompt will appear to install the required CMSIS packs for this project:

![](docs/01-install-cmsis-packs.png)

Recent versions of CMSIS toolbox will automatically install the missing packs when a project is built.

Alternatively, the packs can be installed manually be opening up a Terminal in Visual Studio Code (Ctrl + Shift + `) and running the following commands:

```
Expand All @@ -166,46 +169,21 @@ Use the CMSIS tab in the Activity Bar to build, run and debug the use case sampl
Simply use the drop-down menus to specify your build, then click the Build button. The output should look similar to the following:

```log
* Executing task: Workspace: cmsis-csolution.build: Build
info cbuild: Build Invocation 2.0.0 (C) 2023 Arm Ltd. and Contributors
/home/armuser/Development/ML-examples/cmsis-pack-examples/object-detection/object-detection.Debug+AVH-SSE-300-U55.cprj - info csolution: file generated successfully
/home/armuser/Development/ML-examples/cmsis-pack-examples/object-detection/object-detection.Debug+AVH-SSE-300-U55.cbuild.yml - info csolution: file is already up-to-date
/home/armuser/Development/ML-examples/cmsis-pack-examples/mlek.cbuild-idx.yml - info csolution: file is already up-to-date
info cbuild: Processing 1 context(s)
===============================================================================
info cbuild: (1/1) Processing context: "object-detection.Debug+AVH-SSE-300-U55"
info cbuild: clean finished successfully!
M650: Command completed successfully.
M652: Generated file for project build: '/home/armuser/Development/ML-examples/cmsis-pack-examples/tmp/object-detection/AVH-SSE-300-U55/Debug/CMakeLists.txt'
-- The C compiler identification is ARMClang 6.20.2
-- The CXX compiler identification is ARMClang 6.20.2
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/armuser/.config/Code/User/globalStorage/ms-vscode.vscode-embedded-tools/vcpkg/root/downloads/artifacts/vcpkg-artifacts-arm/compilers.arm.armclang/6.20.0/bin/armclang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/armuser/.config/Code/User/globalStorage/ms-vscode.vscode-embedded-tools/vcpkg/root/downloads/artifacts/vcpkg-artifacts-arm/compilers.arm.armclang/6.20.0/bin/armclang - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Registered toolchain version 6.20.0 does not match running version 6.20.2
-- Configuring done
-- Generating done
-- Build files have been written to: /home/armuser/Development/ML-examples/cmsis-pack-examples/tmp/object-detection/AVH-SSE-300-U55/Debug
[1/257] Building C object CMakeFiles/object-detection.dir/home/armuser/.cache/arm/packs/ARM/V2M_MPS3_SSE_300_BSP/1.3.0/Native_Driver/systimer_armv8-m_timeout.o
...
* Executing task: cmsis-csolution.build: Build
> cbuild /home/kshsis01/eco-projects/oss/ML-examples/cmsis-pack-examples/mlek.csolution.yml --update-rte --packs --context object-detection.Release+AVH-SSE-300-U55
/home/kshsis01/eco-projects/oss/ML-examples/cmsis-pack-examples/mlek.csolution.yml - warning csolution: cproject.yml files should be placed in separate sub-directories
/home/kshsis01/eco-projects/oss/ML-examples/cmsis-pack-examples/mlek.csolution.yml - warning csolution: cproject.yml files should be placed in separate sub-directories
+-----------------------------------------------------------------
(1/1) Building context: "object-detection.Release+AVH-SSE-300-U55"
Building CMake target 'object-detection.Release+AVH-SSE-300-U55'
[1/306] Building CXX object CMakeFiles/Group_MainStatic.dir/home/kshsis01/eco-projects/oss/ML-examples/cmsis-pack-examples/object-detection/src/InputFiles.o
[2/306] Building C object CMakeFiles/Group_Retarget.dir/home/kshsis01/eco-projects/oss/ML-examples/cmsis-pack-examples/device/corstone/src/retarget.o
...
[257/257] Linking CXX executable /home/armuser/Development/ML-examples/cmsis-pack-examples/out/object-detection/AVH-SSE-300-U55/Debug/object-detection.axf
Warning: L6439W: Multiply defined Global Symbol flatbuffers::flatbuffer_version_string defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(Model.o) rejected in favor of Symbol defined in .data._ZN11flatbuffers25flatbuffer_version_stringE(Classifier.o).
...
...
"/home/armuser/Development/ML-examples/cmsis-pack-examples/object-detection/linker/mps3-sse-300.sct", line 104 (column 14): Warning: L6314W: No section matches pattern *.o(activation_buf_dram).
Finished: 0 information, 129 warning and 0 error messages.
info cbuild: build finished successfully!
[306/306] Linking CXX executable /home/kshsis01/eco-projects/oss/ML-examples/cmsis-pack-examples/out/object-detection/AVH-SSE-300-U55/Release/object-detection.axf
+------------------------------------------------------------
Build summary: 1 succeeded, 0 failed - Time Elapsed: 00:00:23
+============================================================
Build complete
* Terminal will be reused by tasks, press any key to close it.
```
Expand All @@ -219,7 +197,7 @@ a physical hardware board.

- When using a Fixed Virtual Platform (FVP) installed locally:
```shell
$ <path_to_installed_FVP> -a ./out/kws/AVH-SSE-300-U55/Debug/kws.Debug+AVH-SSE-300-U55.axf -f ./FVP/FVP_Corstone_SSE-300/fvp_config.txt
$ FVP_Corstone_SSE-300_Ethos-U55 -a out/object-detection/AVH-SSE-300-U55/Release/object-detection.axf -f ./FVP/FVP_Corstone_SSE-300/fvp_config.txt
```
> **NOTE**: The FVP defaults to running 128 MAC configuration for Arm® Ethos™-U55 NPU.
> However, our default neural network model for the NPU is for 256 MAC configuration.
Expand Down Expand Up @@ -436,20 +414,3 @@ spot immediately. Please help us improve this section by reporting them via GitH
virtual targets.
You can build the project but will have to run it on your local machine on an
installation of the equivalent Fixed Virtual Platform containing Arm® Ethos™-U65 NPU.

7. The newer versions of BSP packs for Arm® Corstone™-300 and Arm® Corstone™-310 require CMSIS 6.
There are warnings about some unsatisfied requirements because of this. For example:
```shell
MISSING ARM::Device:Definition@2.0.0
require CMSIS:CORE@6.0.0
MISSING ARM::Device:Native Driver:SysCounter@1.1.0
require CMSIS:CORE@6.0.0
MISSING ARM::Device:Native Driver:SysTimer@1.1.0
require CMSIS:CORE@6.0.0
MISSING ARM::Device:Native Driver:Timeout@1.0.0
require CMSIS:CORE@6.0.0
MISSING ARM::Device:Startup&C Startup@2.0.0
require CMSIS:CORE@6.0.0
```
These are expected to be resolved once we bump up the version of CMSIS core pack. Currently,
this is blocked by other dependencies.
7 changes: 4 additions & 3 deletions cmsis-pack-examples/cdefault.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ default:
misc:
- for-compiler: AC6
CPP:
- -std=c++14
- -std=c++17
- -fno-exceptions
- -Wno-license-management
- -fno-rtti
- -ffp-mode=full
- -Wno-license-management
C:
- -std=c99
- -std=c17
- -Wno-license-management
Link:
- --entry=Reset_Handler
Expand Down
11 changes: 0 additions & 11 deletions cmsis-pack-examples/common/common.clayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ layer:
- file: include/BufAttributes.hpp
- file: include/ethosu_mem_config.h

# Workaround 4001: for TensorFlow's pack referring to
# CMSIS_DEVICE_ARM_CORTEX_M_XX_HEADER_FILE.
# Can be removed once the pack has been fixed.
misc:
- for-compiler: AC6
CPP:
- "-include \"RTE_Components.h\""

components:
- component: ARM::CMSIS:CORE
- component: ARM::CMSIS:DSP&Source
Expand All @@ -44,9 +36,6 @@ layer:
- component: tensorflow::Data Processing:Math:kissfft
- component: tensorflow::Data Processing:Math:ruy
- component: tensorflow::Machine Learning:TensorFlow:Kernel Utils
# Workaround 4001 (see description above)
define:
- CMSIS_DEVICE_ARM_CORTEX_M_XX_HEADER_FILE: CMSIS_device_header
- component: tensorflow::Machine Learning:TensorFlow:Testing
- component: ARM::ML Eval Kit:Common:API
- component: ARM::ML Eval Kit:Common:Log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ layer:
- file: ./include/BoardInit.hpp
- file: ./src/BoardInit.cpp

define:
# For profiling under micro_time.cpp in TensorFlow Lite Micro pack
- ARM_MODEL_USE_PMU_COUNTERS

components:
- component: Arm::Machine Learning:NPU Support:Ethos-U Driver&Generic U55
- component: tensorflow::Machine Learning:TensorFlow:Kernel&Ethos-U
Expand All @@ -67,7 +71,6 @@ layer:
- component: AlifSemiconductor::Device:SOC Peripherals:PINCONF
- component: AlifSemiconductor::Device:SOC Peripherals:MHU
- component: AlifSemiconductor::Device:Startup
- component: ARM::CMSIS Driver:USART:Custom

- component: AlifSemiconductor::Device:SOC Peripherals:DMA
for-context: +Alif-E7-M55-HE
Expand Down Expand Up @@ -104,5 +107,3 @@ layer:

- component: AlifSemiconductor::Device:SE runtime Services:Initialization Helper
for-context: +Alif-E7-M55-HP


Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ layer:
- file: src/uart_stdout.h
- file: include/BoardInit.hpp

define:
# For profiling under micro_time.cpp in TensorFlow Lite Micro pack
- ARM_MODEL_USE_PMU_COUNTERS

components:
- component: ARM::Device:Definition
- component: ARM::Device:Startup&C Startup
Expand All @@ -65,4 +69,4 @@ layer:
for-context:
- +AVH-SSE-300
- +AVH-SSE-310
- +AVH-SSE-315
- +AVH-SSE-315
Binary file modified cmsis-pack-examples/docs/02-build-run.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions cmsis-pack-examples/mlek.csolution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ solution:
cdefault: # use default setup of toolchain specific controls.

packs:
- pack: ARM::CMSIS@5.9.0
- pack: ARM::CMSIS-DSP@1.15.0
- pack: ARM::CMSIS-NN@4.0.0
- pack: Arm::ethos-u-core-driver@1.23.2
- pack: ARM::ml-embedded-eval-kit-uc-api@23.2.0
- pack: tensorflow::flatbuffers@1.23.2
- pack: tensorflow::gemmlowp@1.23.2
- pack: tensorflow::kissfft@1.23.2
- pack: tensorflow::ruy@1.23.2
- pack: tensorflow::tensorflow-lite-micro@1.23.2
- pack: ARM::CMSIS@6.0.0
- pack: ARM::CMSIS-DSP@1.16.0
- pack: ARM::CMSIS-NN@6.0.0
- pack: Arm::ethos-u-core-driver@1.24.8
- pack: ARM::ml-embedded-eval-kit-uc-api@24.8.0
- pack: tensorflow::flatbuffers@1.24.8
- pack: tensorflow::gemmlowp@1.24.8
- pack: tensorflow::kissfft@1.24.8
- pack: tensorflow::ruy@1.24.8
- pack: tensorflow::tensorflow-lite-micro@1.24.8

- pack: ARM::V2M_MPS3_SSE_300_BSP@1.5.0
- pack: ARM::V2M_MPS3_SSE_310_BSP@1.4.0
Expand Down

0 comments on commit b9c9bf2

Please sign in to comment.