diff --git a/src/bare-metal/microcontrollers/debugging.md b/src/bare-metal/microcontrollers/debugging.md new file mode 100644 index 00000000..e7d4993d --- /dev/null +++ b/src/bare-metal/microcontrollers/debugging.md @@ -0,0 +1,38 @@ +# Debugging + +Embed.toml: + +```toml +[default.general] +chip = "nrf52833_xxAA" + +[debug.gdb] +enabled = true +``` + +In one terminal: + +```sh +cargo embed --bin board_support debug +``` + +In another terminal: + +```sh +gdb-multiarch target/thumbv7em-none-eabihf/debug/board_support --eval-command="target remote :1337" +``` + +<details> + +In GDB, try running: + +```gdb +b src/bin/board_support.rs:28 +b src/bin/board_support.rs:29 +b src/bin/board_support.rs:31 +c +c +c +``` + +</details> diff --git a/src/bare-metal/microcontrollers/examples/Embed.toml b/src/bare-metal/microcontrollers/examples/Embed.toml index c883050d..0f270ac8 100644 --- a/src/bare-metal/microcontrollers/examples/Embed.toml +++ b/src/bare-metal/microcontrollers/examples/Embed.toml @@ -1,2 +1,8 @@ [default.general] chip = "nrf52833_xxAA" + +[debug.gdb] +enabled = true + +[debug.reset] +halt_afterwards = true