layout | title | parent |
---|---|---|
post |
7.4 Exercise |
7. Debugging |
Using the code from the previous section (time-slicing), we'll try to see how debugging works in VSCode.
- in
multi-thread-debug
create folder.vscode
- in
.vscode
create filelaunch.json
- setup your debug config as follows inside
launch.json
(change as applicable)
{
"version": "0.2.0",
"configurations": [
{
"type": "cortex-debug",
"request": "launch",
"servertype": "openocd",
"cwd": "${workspaceRoot}",
"executable": "build/zephyr/zephyr.elf",
"name": "zephyr STM32F756ZG",
"configFiles": [
"/Users/maksim/zephyrproject/zephyr/boards/arm/nucleo_f756zg/support/openocd.cfg"
],
"svdFile": "STM32F756.svd"
}
]
}
The svd file can be found on the STM website. Add this file to your folder and mention it in launch.json
, this way you'll be able to easily read out the different registers/peripherals/memory once you're in debug mode.
-
the svd file is necessary to be able to read registers from that specific stm processor
-
Now go to Run->Start debugging
The first screen should look like this:
If you put an interrupt in the first interrupt, the execution will again be stopped at this point
Notice the "Cortex Peripherals" and "Cortex Registers" on the left-hand side.
-
Go to
exercises/debugging/runtime-statistics
-
Build & Flash
west build -b nucleo_f756zg
west flash
- Observe the output in the serial monitor:
Come back to this when I understand GDB better
{% include incomplete.md %}