I’m not planing to discuss details about those json files here since I know you lazy guys just want to know how to use it(Or maybe I’m too lazy to write those details down, who knows).
- Copy this .vscode folder into your project root folder.
- Modify the environment variables at the end of task.json and launch.json base on your own settings:
- Press Ctrl+Shit+B to trigger build task(You also can run task “zephyr build ninja“ alternatively if you want to use ninja to build).
- Press the holy F5 button(which is on the right side of the F4 button) to start debugging.
- An selecting list will jump out when terminated debug process, don’t forget to select it.
An exception will occur when stop at main(). Not sure where the root cause is, but debug process still can proceed, just ignore it.
Breakpoints can’t be added into some lines but you can run code step by step to those lines. Disable zephyr build optimization doesn’t help on this, it might related to zephyr toolchain.