Author Topic: Visual Studio versus VSCODE - Debugging  (Read 1691 times)

0 Members and 1 Guest are viewing this topic.

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 2193
  • Country: scotland
  • Full time EE & Youtuber/Creator
    • IanJohnston.com
Visual Studio versus VSCODE - Debugging
« on: August 05, 2026, 07:40:19 pm »
For my STM32 BluePill projects I have been using Visual Studio 2022 and with the VisualGDB plugin.

Works great, especially live debugging:
Variables update continuously while the program is running.
You can watch counters, state machines and timers changing in real time.

However, I have been dipping into VSCODE for the first time and with the same projects......and have them building and uploading to the BluePill just fine.
But, I'm not sure what options are available to me in regard to debugging, I installed the Cortex-Debug extension, but from what I can see you can only set breakpoints and therefore monitor variables at that break.

Any suggestions for a better extension or if it is indeed possible to get it functionally like VS2022/VisualGDB........i.e. Variables update continuously while the program is running.

Using the ST-LinkV3SET.

Ian.
Ian Johnston - Original designer of the PDVS2mini || Author of WinGPIB
Website: www.ianjohnston.com
YouTube: www.youtube.com/user/IanScottJohnston, Odysee: https://odysee.com/@IanScottJohnston, Twitter(X): https://twitter.com/IanSJohnston, Github: https://github.com/Ian-Johnston?tab=repositories
 

Online voltsandjolts

  • Supporter
  • ****
  • Posts: 3751
  • Country: gb
Re: Visual Studio versus VSCODE - Debugging
« Reply #1 on: August 05, 2026, 07:46:59 pm »
Segger Ozone license is free for non-commercial use with J-Link and 3rd party probes.
https://www.segger.com/news/pr-250909-ozone-simulators/

Then you have complete freedom to choose which editor and build environment.
 
The following users thanked this post: IanJ

Offline tellurium

  • Frequent Contributor
  • **
  • Posts: 322
  • Country: ua
Re: Visual Studio versus VSCODE - Debugging
« Reply #2 on: August 06, 2026, 10:28:44 am »
I second Ozone, it is awesome, IDE independent.
And you can flash Segger firmware to your ST-Link, I believe, so you might not even need a different hardware piece
Open source embedded network library https://mongoose.ws
TCP/IP stack + TLS1.3 + HTTP/WebSocket/MQTT in a single file
 

Online voltsandjolts

  • Supporter
  • ****
  • Posts: 3751
  • Country: gb
Re: Visual Studio versus VSCODE - Debugging
« Reply #3 on: August 06, 2026, 10:56:55 am »
And you can flash Segger firmware to your ST-Link, I believe, so you might not even need a different hardware piece

I think flashing segger firmware is only for nucleo boards (J-Link On-Board).
But Ozone supports GDB, so you can use the ST-LINK_gdb_server.

IIUC but never used it that way myself.

Note for Ozone newbie:
https://www.eevblog.com/forum/microcontrollers/getting-mplab-xc32-to-grasp-that-this-is-c-not-c/msg6161533/#msg6161533
« Last Edit: August 06, 2026, 11:09:43 am by voltsandjolts »
 

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 2193
  • Country: scotland
  • Full time EE & Youtuber/Creator
    • IanJohnston.com
Re: Visual Studio versus VSCODE - Debugging
« Reply #4 on: August 06, 2026, 02:35:54 pm »
After a bit of experimentation, I managed to get Cortex-Debug Live Watch extension working in VS Code. I can monitor live changing variables in VS Code.

My setup is:

VS Code
Cortex-Debug v1.12.1
STM32CubeCLT 1.22.0
ST-LINK V3SET
STM32F103 Blue Pill
CMake/Ninja project

Added to launch.json
Code: [Select]
"liveWatch": {
    "enabled": true,
    "samplesPerSecond": 10
}

Workflow is now:

- Build
- Flash Blue Pill
- Press F5 to start debugging
- Press F5 again to continue from main
- The Open & Run Debug windows will appear
- Add global variables to the Live Watch window.

I can now see continuously updating variables in VSCODE as my device runs. No breakpoints used.
Live Watch updates continuously while the MCU continues running, giving functionality very similar to VisualGDB's Live Watch.

The full debug suite appears to be:
Variables
Watch
Call Stack
Breakpoints
Cortex Live Watch
Peripherals
Registers
Memory
Disassembly

Attached the 3 .json files I have in the project for info (renamed.txt for the forum).
Also arm-toolchain.cmake & CMakeLists.txt

Ian.
« Last Edit: August 07, 2026, 08:46:10 am by IanJ »
Ian Johnston - Original designer of the PDVS2mini || Author of WinGPIB
Website: www.ianjohnston.com
YouTube: www.youtube.com/user/IanScottJohnston, Odysee: https://odysee.com/@IanScottJohnston, Twitter(X): https://twitter.com/IanSJohnston, Github: https://github.com/Ian-Johnston?tab=repositories
 
The following users thanked this post: thm_w, Fire Doger, eugene

Offline Fire Doger

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: gr
  • Stefanos
Re: Visual Studio versus VSCODE - Debugging
« Reply #5 on: August 08, 2026, 05:19:30 pm »
A couple years ago, when ST asked for feedback about debug in VSCode, I asked for support complex breakpoints.
i.e to stop when a variable is accessed by "whatever" code, when becomes equal with a value, higher than a value, etc...

Are they supporting this yet or only breakpoints on lines?
 

Online IanJTopic starter

  • Supporter
  • ****
  • Posts: 2193
  • Country: scotland
  • Full time EE & Youtuber/Creator
    • IanJohnston.com
Re: Visual Studio versus VSCODE - Debugging
« Reply #6 on: August 08, 2026, 06:09:13 pm »
This is the extension I am using. I haven’t explored much of it yet.

Ian

https://marketplace.visualstudio.com/items?itemName=marus25.cortex-debug
Ian Johnston - Original designer of the PDVS2mini || Author of WinGPIB
Website: www.ianjohnston.com
YouTube: www.youtube.com/user/IanScottJohnston, Odysee: https://odysee.com/@IanScottJohnston, Twitter(X): https://twitter.com/IanSJohnston, Github: https://github.com/Ian-Johnston?tab=repositories
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf