Work with solutions
This section explains how to create a CMSIS solution-based project that is using CMSIS-Packs.
In the
CMSIS view, click Create a New Solution. If you already have a
solution opened, use the menu (...) item Create a Solution.

The Create new solution dialog allows to start projects based on a Target Board or Target Device selection.
Examples, templates, and reference applications depend on the selected board or device and on installed CMSIS-Packs.
-
Examples are created for a specific hardware or evaluation board. These are typically complete projects that directly interface with board and device peripherals.
-
Reference applications use defined interfaces (APIs) and are therefore hardware agnostic. These projects require the installation of related CMSIS-Packs and additional software layers for an evaluation board.
-
Templates are stub projects that help you getting started. Some CMSIS-Packs may contain device-specific templates.
-
GitHub repositories may contain projects showcasing a specific use case. These repos can be cloned directly into VS Code. The Source Control view
helps maintaining these repos. -
The Zephyr/west integration enables to build and run Zephyr projects in Keil Studio.
Further settings include:
-
The Solution Sub Folder is typically a sub-directory in your workspace.
-
The Solution Base Folder specifies your workspace location that may contain multiple projects.
-
With Initialize Git repository the related
.gitignorefile is created. -
Show project opening options allows you to open the solution a new instance of VS Code. By default, it is loaded into the current VS Code instance.
Examples
- Click the Target Board (Optional) drop-down list.
- Enter a search term tp filter the list and then select your board. The details of the selected board are displayed.
- Click Select.
Next, select the example project. There are two types of example projects (available either from Local packs and/or from the Web):
-
Csolution Examples are using Keil Studio's native project format.
-
uVision Examples are in
*.uvprojxformat and are converted automatically.
To verify the Keil Studio installation, select a Blinky project for example.
Specify a Solution Base Folder and click Create.
Note
First time users may need to confirm that the Arm Tools Environment Manager extension can automatically
activate the workspace and download the tools specified in the vcpkg-configuration.json file included in a
project.
A typical Blinky example includes a REAMDE.md file that contains valuable information about the hardware setup and
specific tasks that need to be done before working with the target board:

Continue to build the project.
Reference applications
Reference applications show the usage of middleware, software libraries, and custom code that can run on many different target hardware boards. Examples display only if you selected a board and a software layer is available for that board. Reference applications are not dependent on specific hardware. You can deploy them to various evaluation boards using additional software layers that provide driver APIs for specific target hardware. Layers are provided using CMSIS-Packs.
Reference applications are available with these CMSIS-Packs:
-
MDK-Middleware: use software components for IPv4 and IPv6 networking, USB Host and Device communication, and file system for data storage.
-
SDS Framework: record real-world data off a device and playing it back on Arm Virtual Hardware.
-
LiteRT: demonstrates the fundamental integration and usage of the LiteRT stack for ML inference on a microcontroller.
Attention
You need to have the CMSIS-Packs installed before you can create a new reference application. Please follow the instruction for installing packs.
Configuration
Reference applications use software layers that help scaling example projects to many different target boards. To be able to use the selected board with the reference application, you need to configure the solution and select an appropriate layer.
More information about the layer requirements and other configuration options can be found in the documentation:
Continue to build the project.
Templates
Templates help you to get started without application-specific code.
-
Blank solution: Start a project from scratch with an empty
main.cfile and the CMSIS device startup component selected -
TrustZone solution: If the board or device that you selected is compatible, you can use TrustZone and define whether projects in the solution use secure or non-secure zones
Continue to build the project.
GitHub repositories
Nowadays, many projects are available in GitHub repositories. VS Code provides easy access to these repos with the built-in Git support. The easiest way to do so is to clone a repository directly in VS Code:
- In the Explorer view
, click Clone Repository (you can do the same
in the Source Control view
). - Open the CMSIS view
and use the ... menu to choose an example via
Select Active Solution from workspace. - The related tools and software packs are downloaded and installed.
Continue to build the project.
Note
- You can also download the repository content as a ZIP file. In that case, extract the content and open the top-level folder in VS Code (File - Open Folder...).
- Ready-to-run examples are available on GitHub.
Zephyr/west integration
It is possible to build and debug Zephyr projects that use the west build system with Keil Studio. The CMSIS solution
extension displays an outline view of the Zephyr project.

Refer to CMSIS-Zephyr for more information.
Build
Before you can download the application on your target device, you need to build it. There are various ways to trigger a build:
-
In the Explorer view
, right-click the *.csolution.ymlfile and select Build solution. -
In the CMSIS view
, click
.
Continue to load and run the solution.
Build output
After you initiate the build process, a Terminal opens and displays the build operation:
Execute: cbuild /Users/user/03_work/02_Projects/ST/Nucleo-F756ZG/Blinky/Blinky.csolution.yml --active NUCLEO-F756ZG --packs
+---------------------------------------------------
(1/1) Building context: "Blinky.Debug+NUCLEO-F756ZG"
Using AC6 V6.24.0 compiler, from: '/Users/user/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/'
Building CMake target 'Blinky.Debug+NUCLEO-F756ZG'
[1/51] Building C object CMakeFiles/Group_Source_Files_retarget_stdio_c.dir/Users/user/03_work/02_Projects/ST/Nucleo-F756ZG/Blinky/retarget_stdio.o
[2/51] Building ASM object CMakeFiles/Group_CubeMX.dir/Users/user/03_work/02_Projects/ST/Nucleo-F756ZG/Blinky/STM32CubeMX/NUCLEO-F756ZG/STM32CubeMX/MDK-ARM/startup_stm32f756xx.o
Warning: A1950W: The legacy armasm assembler is deprecated. Consider using the armclang integrated assembler instead.
0 Errors, 1 Warning
[3/51] Building C object CMakeFiles/Group_CubeMX.dir/Users/user/03_work/02_Projects/ST/Nucleo-F756ZG/Blinky/STM32CubeMX/NUCLEO-F756ZG/STM32CubeMX/Src/stm32f7xx_hal_timebase_tim.o
...
[49/51] Building C object CMakeFiles/Keil_CMSIS_Driver_USART_3_0_0.dir/Users/user/.cache/arm/packs/ARM/CMSIS-Driver_STM32/1.1.0/Drivers/USART_STM32.o
[50/51] Building C object CMakeFiles/ARM_CMSIS_RTOS2_Keil_RTX5_Source_5_9_0.dir/Users/user/.cache/arm/packs/ARM/CMSIS-RTX/5.9.0/Source/rtx_thread.o
[51/51] Linking C executable /Users/user/03_work/02_Projects/ST/Nucleo-F756ZG/Blinky/out/Blinky/NUCLEO-F756ZG/Debug/Blinky.axf
Program Size: Code=31972 RO-data=1076 RW-data=512 ZI-data=38760
+------------------------------------------------------------
Build summary: 1 succeeded, 0 failed - Time Elapsed: 00:00:04
+============================================================
Completed: cbuild succeed with exit code 0
Build complete
The output directory usually contains an ELF (.axf) and a HEX (.hex) file.
Note
If the build fails with an ENOENT error, follow the instructions in the pop-up message that displays in the
bottom right-hand corner to install CMSIS-Toolbox.
To learn about the solution structure, refer to CMSIS-Toolbox documentation
Load and Run
Check target information
In the CMSIS view, click
and then select "Target Information" to
check that your target is connected.

In the Terminal, the result of the pyocd list command is shown:
* Executing task: pyocd list --cbuild-run /Users/user/Blinky/Blinky+B-U585I-IOT02A.cbuild-run.yml
# Probe/Board Unique ID Target
-------------------------------------------------------------------
0 STLINK-V3 001000254D46501220383832 ✖︎ stm32u585aiix
B-U585I-IOT02A
Note
- Various debug adapters are supported. Select them using the manage solutions dialog. The configure run and debug chapter explains the details.
- If your debug adapter is not shown, make sure that all drivers are installed and that the target is connected to the PC.
Download and run the application
In the CMSIS view, click
. This executes the "Load & Run application" command
that executes the commands CMSIS Load and CMSIS Run from the tasks.json file. This flashes the project onto the
target and issues a reset to start the application.
To verify that the step has run correctly, check the Terminal output:
* Executing task: pyocd load --probe stlink: --cbuild-run /Users/user/B-U585-Board/Blinky/Blinky+B-U585I-IOT02A.cbuild-run.yml
0000712 I Loading /Users/user/B-U585-Board/Blinky/out/Blinky/B-U585I-IOT02A/Debug/Blinky.axf [load_cmd]
[==================================================] 100%
0003015 I Erased 49152 bytes (6 sectors), programmed 49152 bytes (48 pages), skipped 0 bytes (0 pages) at 20.96 kB/s [loader]
* Terminal will be reused by tasks, press any key to close it.
* Executing task: pyocd gdbserver --probe stlink: --connect attach --persist --reset-run --cbuild-run /Users/user/B-U585-Board/Blinky/Blinky+B-U585I-IOT02A.cbuild-run.yml
0000251 I Target type is stm32u585aiix [board]
0000434 I DP IDR = 0x0be12477 (v2 MINDP rev0) [dap]
0000511 I debugvar 'DbgMCU_AHB1_Fz' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'DbgMCU_AHB3_Fz' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'DbgMCU_APB1H_Fz' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'DbgMCU_APB1L_Fz' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'DbgMCU_APB2_Fz' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'DbgMCU_APB3_Fz' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'DbgMCU_CR' = 0x6 (6) [cbuild_run]
0000511 I debugvar 'DoOptionByteLoading' = 0x0 (0) [cbuild_run]
0000511 I debugvar 'TraceClk_Pin' = 0x40002 (262146) [cbuild_run]
0000511 I debugvar 'TraceD0_Pin' = 0x20009 (131081) [cbuild_run]
0000511 I debugvar 'TraceD1_Pin' = 0x2000a (131082) [cbuild_run]
0000511 I debugvar 'TraceD2_Pin' = 0x40005 (262149) [cbuild_run]
0000511 I debugvar 'TraceD3_Pin' = 0x2000c (131084) [cbuild_run]
0000516 I AHB5-AP#0 IDR = 0x14770015 (AHB5-AP var1 rev1) [discovery]
0000517 I AHB5-AP#0 Class 0x1 ROM table #0 @ 0xe00fe000 (designer=020:ST part=482) [rom_table]
0000518 I [0]<e00ff000:ROM class=1 designer=43b:Arm part=4c9> [rom_table]
0000518 I AHB5-AP#0 Class 0x1 ROM table #1 @ 0xe00ff000 (designer=43b:Arm part=4c9) [rom_table]
0000520 I [0]<e000e000:SCS M33 class=9 designer=43b:Arm part=d21 devtype=00 archid=2a04 devid=0:0:0> [rom_table]
0000520 I [1]<e0001000:DWT M33 class=9 designer=43b:Arm part=d21 devtype=00 archid=1a02 devid=0:0:0> [rom_table]
0000521 I [2]<e0002000:BPU M33 class=9 designer=43b:Arm part=d21 devtype=00 archid=1a03 devid=0:0:0> [rom_table]
0000522 I [3]<e0000000:ITM M33 class=9 designer=43b:Arm part=d21 devtype=43 archid=1a01 devid=0:0:0> [rom_table]
0000523 I [5]<e0041000:ETM M33 class=9 designer=43b:Arm part=d21 devtype=13 archid=4a13 devid=0:0:0> [rom_table]
0000524 I [6]<e0042000:CTI M33 class=9 designer=43b:Arm part=d21 devtype=14 archid=1a14 devid=40800:0:0> [rom_table]
0000524 I [1]<e0040000:TPIU M33 class=9 designer=43b:Arm part=d21 devtype=11 archid=0000 devid=ca1:0:0> [rom_table]
0000525 I [2]<e0044000:DBGMCU class=15 designer=020:ST part=000> [rom_table]
0000533 I CPU core #0: Cortex-M33 r0p4, v8.0-M architecture [cortex_m]
0000533 I Extensions: [DSP, FPU, FPU_V5, MPU] [cortex_m]
0000533 I FPU present: FPv5-SP-D16-M [cortex_m]
0000534 I Setting core #0 (Cortex-M33) default reset sequence to ResetSystem [cbuild_run]
0000534 I 4 hardware watchpoints [dwt]
0000537 I 8 hardware breakpoints, 1 literal comparators [fpb]
0000662 I Semihost server started on port 4444 (core 0) [server]
0000718 I GDB server started on port 3333 (core 0) [gdbserver]
When running,
changes to
. Use it to stop
the GDB session anytime.
Notes
- When you have several solutions in one folder, VS Code ignores the
tasks.jsonandlaunch.jsonfiles that you created for each solution. Instead, VS Code generates new JSON files at the root of the workspace in a.vscodefolder and ignores the other JSON files. As a workaround, open one solution first, then add other solutions to your workspace with the File > Add Folder to Workspace option. - If you are using a multi-core device and you did not specify a
"processorName"in thelaunch.jsonfile, select the appropriate processor for your project in the Select a processor drop-down list at the top of the window. - If you want to run the application on an Arm FVP simulation model, you need to configure it in the Manage Solution dialog.
Monitor printf messages
Keil Studio includes the Serial Monitor extension that connects to the target's serial output port. If your example
contains printf statements, use the Serial Monitor to observe them.

Debug
Debugging is an essential task for every embedded developer.
Attention
Before entering a debug session, make sure you have set up your debug adapter correctly.
In the CMSIS view, click
. This executes the "Load & Debug application"
command that executes the commands CMSIS Load from the launch.json file. This flashes the project onto the target,
starts a debug session, and runs to main:

The Debug Console show the output of the debug operations:
0000223 I Target device: LPC55S69JBD100 [cbuild_run]
GNU gdb (Arm GNU Toolchain 14.3.Rel1 (Build arm-14.174)) 15.2.90.20241229-git
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=aarch64-apple-darwin20.6.0 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.linaro.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
0000575 I core 0: Cortex-M33 r0p3, pname: cm33_core0 [cbuild_run]
0000575 I core 1: Cortex-M33 r0p3, pname: cm33_core1 [cbuild_run]
0000575 I start-pname: cm33_core0 [cbuild_run]
0000610 I Semihost server started on port 4444 (core 0) [server]
0000658 I GDB server listening on port 3333 (core 0) [gdbserver]
0000666 I Semihost server started on port 4445 (core 1) [server]
0000666 I GDB server listening on port 3334 (core 1) [gdbserver]
GNU gdb (Arm GNU Toolchain 14.3.Rel1 (Build arm-14.174)) 15.2.90.20241229-git
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=aarch64-apple-darwin20.6.0 --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://bugs.linaro.org/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
warning: Loadable section "RW_m_data" outside of ELF segments
in /Users/user/Arm-Examples/Hello_LPCXpresso55S69/out/hello/LPCXpresso55S69/Debug/hello.axf
warning: Loadable section "RW_m_data" outside of ELF segments
in /Users/user/Arm-Examples/Hello_LPCXpresso55S69/out/hello/LPCXpresso55S69/Debug/hello.axf
0000869 I Client 1 connected on port 3333 from remote address localhost:51675 [gdbserver]
warning: Loadable section "RW_m_data" outside of ELF segments
in /Users/user/Arm-Examples/Hello_LPCXpresso55S69/out/hello/LPCXpresso55S69/Debug/hello.axf
0x14005f30 in ?? ()
0000966 I Client 1: Loaded rtx5 RTOS plugin [gdbserver]
connected to remote target localhost:3333
set mem inaccessible-by-default off
set stack-cache off
set remote interrupt-on-connect off
target remote localhost:3333
Remote debugging using localhost:3333
0000978 I Client 2 connected on port 3333 from remote address localhost:51677 [gdbserver]
warning: Loadable section "RW_m_data" outside of ELF segments
in /Users/user/Arm-Examples/Hello_LPCXpresso55S69/out/hello/LPCXpresso55S69/Debug/hello.axf
0x14005f30 in ?? ()
connected auxiliary GDB to target
monitor reset halt
Resetting target with halt
Successfully halted device on reset
tbreak main
Temporary breakpoint 1 at 0x2f80: file /Users/user/Arm-Examples/Hello_LPCXpresso55S69/main.c, line 30.
Note: automatically using hardware breakpoints for read-only addresses.
In the Debug Console view you can interact directly with GDB.
To display the value of an expression, type that expression which can reference
variables that are in scope. For example type '2 + 3' or the name of a variable.
Arbitrary commands can be sent to GDB by prefixing the input with a '>',
for example type '>show version' or '>help'.
Temporary breakpoint 1, main () at /Users/user/Arm-Examples/Hello_LPCXpresso55S69/main.c:30
30 BOARD_InitBootPeripherals();
Tip
Refer to the Arm CMSIS Debugger extension for a detailed description of debug features.