Skip to main content
Maxime_MARCHETTO1
ST Community Manager
June 9, 2026

Advanced STM32 debugging in Visual Studio Code with IAR C-SPY

Related products:STM32 software tools
  • June 9, 2026
  • 4 replies
  • 5102 views


Getting started with advanced STM32 debugging in VS Code with IAR C-SPY

Debugging embedded systems gets harder as projects grow.

At some point, breakpoints and variable windows stop being enough. You need to see how your application behaves over time, track down fast bugs, inspect registers in context, and measure what your code is really doing.

If you are building STM32 projects in VS Code, you can do that without leaving your workflow.

STM32Cube for VS Code brings together C/C++ editing, CMake and Ninja builds, Git, and one-click debugging. It also helps teams stay flexible across IDEs and operating systems while keeping CI/CD workflows consistent.Once your STM32 project is running in VS Code, the IAR C-SPY Debug extension adds a professional-grade analysis layer that scales with project complexity. C-SPY is IAR’s advanced debugging and analysis engine for embedded systems.

If you are new to STM32Cube for VS Code, start with ST official guides:

From debugging to system insight

IAR C-SPY goes beyond breakpoints and variable inspection.

With Listwindows, you get a live, spreadsheet-like view of your running target, including:

  • Core registers and custom register groups
  • Symbolic memory with direct variable navigation
  • Live Watch
  • ETM/SWO trace
  • Functional profiling
  • Real-time code coverage

That means you can move from stopping code to understanding system behavior.

 

Together, STM32Cube for VS Code provides a fast entry point into the STM32 ecosystem, and IAR adds deterministic builds, advanced trace, and deeper analysis for projects that need more visibility.
 

Install and configure

Install the extension from the VS Code Marketplace (@publisher:IAR) and set up the IAR toolchain for Arm. A free evaluation of the IAR Embedded Workbench for Arm is available.

 

A minimal launch.json configuration for the C-SPY Simulator sets "driver": "Simulator" with --cpu=Cortex®-M4 and --semihosting. Switching to real STM32 hardware is a second configuration with "driver": "ST-LINK", your device (for example --device=STM32F407VG), the matching .ddf file, and --drv_interface=SWD. driverOptions supports the full C-SPY command line with autocomplete inside VS Code.

 

Real-world debugging examples

  • Peripheral issues: create a custom register group (for example SPI), run the application, and see which register or bit changed, and when.
  • Memory corruption: monitor variables in Symbolic Memory to catch pointer issues, buffer overruns, stack problems, and RTOS anomalies
  • Fast bugs: enable trace, view the timeline, and step backwards using Browse Mode (requires IAR I-jet Trace).
  • Coverage and profiling: use instruction-level coverage and functional profiling to measure real runtime behavior.
     

Get started

Watch the full hands-on walkthrough video and download the example project on IAR’s GitHub repository.

For more information about the IAR VS Code extensions, visit iar.com/vscode.


First published on Jun 09, 2026

4 replies

Associate
June 11, 2026

How they differ from Cortex-Debug extension, it does the job and more feature better than STM32 debug and it free. Not sure why STM32 avoid this? 

Associate
June 11, 2026

It appears this IAR C-SPY debug only work with IAR workbench extension variants not with STM32 extension, so this requires license and cost $$$. I'm confused about this article? 

mattias norlander
ST Employee
June 11, 2026

Hi ​@Riscy24,

 

The VS Code extension ecosystem is open and rich. Which debug extension you would like to use is up to you!

Cortex-debug and the extensions from ST has slightly different feature-set. There is no comparison guide describing the feature delta. 

 

The offering from IAR is not free. I hope that this is not implied by this article? The article mentions a “free evaluation” and I think most embedded developers knows that most tools from IAR and Keil and are not free.

Nobody is forcing you in any direction, choose the debug solution that solves your problems. This article simply highlights that there are possibilities for users with IAR licenses to have a more feature-rich debug experience for in VS Code for their STM32 projects thanks to the IAR extensions.

 

Most customers are not exclusively using STM32Cube tools. Most customers use a mix of ST and partner tools to satisfy individual developer preferences.

RArch
Associate II
June 11, 2026

Is there a method of viewing an SWO output from an M3/M4 in VSCode using free ST tools?  This has been my main sticking point in transitioning from Eclipse to VSCode.