lancaster-university / microbit-v2-samples

CODAL build tools and sample programs for the micro:bit v2.x
MIT License
64 stars 83 forks source link

Preconfigured debugging environment for VS Code #27

Closed rneacy closed 2 years ago

rneacy commented 3 years ago

This PR provides a working setup for debugging the micro:bit using VS Code. With this setup, once the extension and a debugger has been installed, a user can simply debug their micro:bit straight from VS Code, with breakpoints and memory inspection (inc. stack and peripherals).

The changes summarised:

JohnVidler commented 2 years ago

Is the boardId required? I don't seem to be able to launch pyocd gdbserver with a --board parameter at all. However, removing the boardId parameter in the configuration here: https://github.com/lancaster-university/microbit-v2-samples/pull/27/files#diff-bd5430ee7c51dc892a67b3f2829d1f5b6d223f0fd48b82322cfd45baf9f5e945R13 lets it launch normally and debugging continues to work.

JohnVidler commented 2 years ago

Further to my previous comment - just asked some other folks to test this without the boardId parameter and pyOCD, and it seems to work just fine without it, and not work at all with it. I guess pyOCD's parameters must have changed while this PR has been open.

I'll submit a patch here shortly.

finneyj commented 2 years ago

Thanks @JohnVidler and @rneacy!

Looks good - let's merge in @JohnVidler