0
\$\begingroup\$

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 see refreshing values 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"

            ]
        }
    ]
}
```
\$\endgroup\$

2 Answers 2

2
\$\begingroup\$

Change the IDE to something with better debugger - for example eclipse with set of plugins or use preconfigured IDE like atollic studio.

The you can use tracing - to see live changes of the variable or set the stimuling triggers like variable read or write.

\$\endgroup\$
1
\$\begingroup\$

I've tried using STM32CubeIDE and figured out that you can have Live Watch when using ST-link GDB server instead of OCD. Will test it on VScode and update.

\$\endgroup\$
1
  • \$\begingroup\$ Note that STM32CubeIDE appears to have grown on top of Atollic TrueStudio, which has been bought by STM. \$\endgroup\$ Commented Apr 16, 2020 at 16:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.