
Arm Keil MDK

Keil Studio for VS Code - with the Edge Impulse SDK pack

Open-CMSIS
Performance Benchmark: Arm Clang v16.9 vs. GCC 10.3
It is worth noting that when comparing the performance of the Arm Clang v16.9 and GCC 10.c compilers, the Arm Clang v16.9 compiler outperforms the GCC 10.c compiler in terms of DSP processing time and classification time. The Arm Clang v16.9 compiler is 24.25% faster in DSP processing time and 20.58% faster in classification time. This is a significant improvement in performance when using the Arm Clang v16.9 compiler.Metric | Improvement using Arm Clang v16.9 compiler |
---|---|
DSP Processing Time | 24.25% |
Classification Time | 20.58% |
- DSP Time: 709 microseconds
- Classification Time: 18908 microseconds
- Anomaly Detection Time: 0 microseconds Detected Faces:
- Face 1: Confidence 98.437% at [x: 80, y: 16, width: 8, height: 8]
- Face 2: Confidence 85.156% at [x: 0, y: 32, width: 16, height: 16]
- DSP Time: 936 microseconds
- Classification Time: 23807 microseconds
- Anomaly Detection Time: 0 microseconds Detected Faces:
- Face 1: Confidence 98.437% at [x: 80, y: 16, width: 8, height: 8]
- Face 2: Confidence 85.156% at [x: 0, y: 32, width: 16, height: 16]
Prerequisites
To get started with Arm Keil MDK, you will need to install one of the following tools:Getting started
First we will need the Edge Impulse SDK pack and an Edge Impulse project CMSIS-packs. You can download these from the deployment section of the Edge Impulse Studio.Deploy your project to an Open CMSIS pack

Open-CMSIS Deploy
- EdgeImpulse.EI-SDK.x.y.z.pack
- EdgeImpulse.project_name.x.y.z.pack
Edge Impulse SDK Pack
The Edge Impulse SDK pack contains the Edge Impulse library and the required dependencies. The pack will be listed under theEdgeImpulse::EI-SDK
category, and is now available from the Arm Keil Pack Installer.

Arm Keil - Edge Impulse SDK pack
CMSIS-Pack Requirements
The Edge Impulse SDK pack requires the following CMSIS packs:- CMSIS-NN 4.0.0 Focuses on optimizing ML operators for Cortex-M, targeting Edge AI applications.
- CMSIS-DSP 1.15.0 A collection of DSP functions optimized for Cortex-M processors, suitable for DSP applications.
Standalone Inference Example
If you want to test the model on your target device, you can clone one of the example projects. We have created standalone examples for the following boards:
µVision project structure
ei_main.cpp
. In this minimal code example, inference is run from a static buffer of input feature data. To verify that our embedded model achieves the exact same results as the model trained in Studio, we want to copy the same input features from Studio into the static buffer in ei_main.cpp
.
To do this, first head back to the studio and click on the Live classification tab. Then load a validation sample, and click on a row under ‘Detailed result’.

Selecting the row with timestamp '320' under 'Detailed result'.

Copying the raw features.
ei_main.cpp
paste the raw features inside the static const float features[]
definition, for example:
ei_standalone.cpp
to run classification on live data.

Standalone Example - µVision IDE
Arm Keil µVision - Steps
We will now go through each of these steps in detail for µVision and finish with a brief overview of the VS Code integration, and demonstrate how to import the µVision project to VS Code. To run the standalone example, follow these steps:Open the standalone example project in Arm Keil µVision
The file extension is *.UVPROJ for MDK version 4, or *.UVPROJX for later versions. First open the standalone example project in Arm Keil µVision and follow the steps below to import the Edge Impulse SDK pack into your project. standalone_nucleo.uvguix.projx example-standalone-inferencing-stm32h747i-disco-CM7.uvprojx
now the project is loaded in µVision IDE
Import the Edge Impulse SDK pack into Arm Keil µVision
The EI-SDK pack contains the Edge Impulse library and the required dependencies. The pack will be listed under theEdgeImpulse::EI-SDK
category, and is now available from the Arm Keil Pack Installer
To import the Edge Impulse SDK pack into Arm Keil µVision, from our examples, follow these steps:
- Open Arm µVision project.
- Select File->Import from Folder.
- Select the EdgeImpulse.EI-SDK.x.y.z.pack file from the downloaded zip file.
- Click Next and then Finish.
- The Edge Impulse SDK pack is now imported into your project.

Import Edge Impulse SDK pack - µVision IDE
Import the Edge Impulse project pack into Arm keil µVision
To import the Edge Impulse project pack into Arm Keil µVision, follow these steps:- Open Arm Keil µVision and select the project you want to import the Edge Impulse project pack into.
- Select File->Import.
- Select the EdgeImpulse.project_name.x.y.z.pack file from the downloaded zip file.
- Accept the terms and conditions and click Next.
- Click Finish to import the Edge Impulse project pack into your project.
Import the Project Model Software Pack into Arm Keil µVision
To import the ML model and inference SDK follow these steps:- Place and unzip the downloaded library in the root folder of your project.
- Open your project in Arm Keil µVision.
- File->Import from Folder->Select the model pack from the downloaded folder.
- If the import is successful, the library will be added to the project. You may see “Software Packs folder has been updated” in the console.
- Reload Packs by selecting
Project->Reload Software Packs
. - Select software packs and ensure that the model pack is listed under the
EdgeImpulse::Motion_recognition
category and is set to latest version.

Import Edge Impulse Project pack - µVision IDE
Configure the target
To configure the project to use the Edge Impulse SDK, follow these steps:- Open the project settings by selecting
Project->Select Software Packs for the target
. - Select the Edge Impulse SDK pack from the list of available software packs. The pack will be listed under the
EdgeImpulse::EI-SDK
category. Update Selection to latest version. - Select the Edge Impulse SDK pack from the list of available software packs. The pack will be listed under the
EdgeImpulse::Motion_recognition
category. Update Selection to latest version.
Configure the Run-Time Environment
To configure the Run-Time Environment to use the Edge Impulse SDK, follow these steps:- Open the project settings by selecting
Project->Manage Run-Time Environment
. - Select the EdgeImpulse from the list of software components. Mark the checkbox to include the software component in the project.
- Select model and Motion_recognition mark the checkbox to include the software component in the project.
- Click OK to close the dialog.

Configure the RTE - µVision IDE
Build the project
To build the project, follow these steps:- Select
Project->Build Target
. - The project will be built and the output will be displayed in the console.
Run the project
To run the project, follow these steps:- Select
Debug->Start/Stop Debug Session
. - The project will be built and the debugger will be started.
VS Code Integration - Steps
Once completed, the project will be configured to use the Edge Impulse SDK. You can now import the Edge Impulse µVision project to VS Code.
Import the µVision project to VS Code
VS Code Extension - Installation
Adapting the procedure from the Arm Keil extension documentation.Using Arm Keil Studio for VS Code
These steps will install the VS Code extension:1. Install Arm Keil Studio Extension and CMSIS extension for VS Code
- Search for “Keil Studio” in the VS Code extensions marketplace and install it. vslink
- Search for “CMSIS csolution” in the VS Code extensions marketplace and install it. vslink
2. Import Project Packs
- Open VS Code and navigate to the >CMSIS: Packs view.
- Choose to import an existing µVision project or start a new one.
- Import the Edge Impulse SDK and project packs you’ve downloaded earlier.
3. Configure Project for Target Hardware
- Access the project settings.
- Set the target device and adjust settings specific to your hardware.
4. Add Edge Impulse SDK Pack to Project
- Open VS Code and navigate to the ctl+shift+p >CMSIS: Manage Software Components.
- Search for and install the EdgeImpulse SDK, accept the CMSIS-NN and CMSIS-DSP packs install the required packages.
- Import the Edge Impulse project pack you’ve downloaded earlier.
Keil Studio - µVision Project import
Fist, you need to install the Keil Studio VS Code extension. You can find the extension in the VS Code Marketplace. Now open your existing µVision project in VS Code and follow the steps below to import the Edge Impulse SDK pack into your project.- Open Arm Keil Studio and select the CMSIS Pack Installer extension.
- Select the import existing µVision project option.
- Select your existing µVision project.

Arm Keil Studio IDE - new project
- Open Arm Keil Studio and select the CMSIS Pack Installer extension.
- Cmsis->Manage Software Components.->Software Packs:all packs->Search for EdgeImpulse SDK

Arm Keil Studio IDE - with the Edge Impulse SDK
- Open Arm Keil Studio and select the CMSIS Pack Installer extension.
- Cmsis->Manage Software Components.->Software Packs:all packs->Search for any pack and validate the installation of the EdgeImpulse SDK pack.
- Accept the packages required for the project.

DSP 1.15.0 - required packages

NN 4.0.0 - required packages