Search code examples
cembeddedopenocd

Live variable view using OpenOCD and VSCode


I really like using VScode + cortex debug extension + openOCD over Keil or Eclipse in embedded projects. Although i wasn't able to figure out how to set up live variable view, which you can set up with eclipse + openOCD.

1. Is it possible to have real time view of global variables over SWD using openOCD and cortex debug on VScode?

I can only see variable values when i pause the program, when the program is debugged i see:

When running:

counter: not available

When paused:

counter: 550

Cortex debug config:

{

    "version": "0.2.0",
    "configurations": [
        {
            "name": "Cortex Debug",
            "cwd": "${workspaceRoot}",
            "executable": "D:\\Code\\embedded\\STM32F1\\build\\STM32F1.elf",
            "device": "STM32F103C8",
            "request": "launch",
            "type": "cortex-debug",

            "servertype": "openocd",
            "svdFile": "D:\\Code\\embedded\\STM32F1\\STM32F103.svd",
            "configFiles": [
                "D:\\apps\\openOCD\\OpenOCD-20190426-0.10.0\\share\\openocd\\scripts\\board\\stm32f103c8_blue_pill.cfg"

            ]
        }
    ]
}

Solution

  • You can have live variable view with ST-Link GDB server, not OCD. Tested it on STM32CubeIDE. Will update when test on VSCODE.