I'm trying to debug a program on a NordicSemi nRF52840
controller.
So far I followed the instructions at hackmd.io and from the probe-rs debugging docu.
I've adapted the configuration according to my environment (mostly paths). In the VS code file .vscode/launch.json
I've additionally set "haltAfterReset": true
.
When I invoke the debugging via VS code's probe-rs
extension, the program is built, flashed to and executed on the uC. But if I want to add breakpoints in VS Code, the IDE shows the message:
Cannot set breakpoint here. [...] No valid breakpoint information found for file: [...]
Despite the haltAfterReset
setting, the program is not halted but immediately executed after it is flashed. The probe-rs docu reads:
Supports halt-after-reset. This will allow you to set breakpoints in your main() function.
Also adding
use cortex_m::asm;
// ...
asm::bkpt();
doesn't do anything.
- I'm working with Linux
gdb
is installed- I didn't set the
miDebuggerPath
which should be correct - VS code:
Allow Breakpoints Everywhere
is set
The concerned Rust source file is in ./examples/demo_nrf52.rs
, and the relevant VS code
settings are
tasks.json
:
{
"label": "cargo build",
"type": "shell",
"command": "cargo",
"args": [
"build",
"--target=thumbv7em-none-eabihf",
"--example",
"demo_nrf52"
],
launch.json
:
"programBinary": "${workspaceFolder}/target/thumbv7em-none-eabihf/debug/examples/demo_nrf52"
Any ideas what's wrong with my setup?