Vscode debug configuration

Hi,

I've just started to follow the discovery book with microbit-v2. I'm on the LED roulette section where we are thought how to flash and debug the target. Although I highly appreciate the pure gdb debugging explanation, I'd also like to try out the integrated debugging in vscode for a more developer friendly experience. Could you folks point me a documentation about that if there is any or could anyone help me how to figure this out?

Thanks

Have you tried the CodeLLDB extension for Visual Studio Code?

Oops, meant GDB. Gonna have to find it...

1 Like

Not directly related to Rust, but should help

https://ardupilot.org/dev/docs/debugging-with-gdb-using-vscode.html

1 Like

I am able to sort it out using probe-rs-debugger.

.vscode/launch.json:

{
  "version": "0.2.0",
  "configurations": [
    {
      "type": "probe-rs-debug",
      "request": "launch",
      "name": "Debug application",
      "cwd": "${workspaceFolder}",
      "runtimeExecutable": "probe-rs",
      "runtimeArgs": [
        "dap-server"
      ],
      "chip": "nRF52833_xxAA",
      "flashingConfig": {
        "flashingEnabled": true,
        "haltAfterReset": false,
        "formatOptions": {}
      },
      "coreConfigs": [
        {
          "coreIndex": 0,
          "programBinary": "target/thumbv7em-none-eabihf/debug/led-blink",
        }
      ],
      "env": {
        "RUST_LOG": "info"
      },
      "consoleLogLevel": "Console"
    }
  ]
}

.cargo/config.toml:

[target.thumbv7em-none-eabihf]
runner = 'probe-run --chip nRF52833_xxAA'
rustflags = [
  "-C", "link-arg=-Tlink.x",
]

References:

3 Likes

I second probe-rs, really intuitive to flash and debug (in my experience on the stm32f4 nucleo board that is)

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.