You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-06-27 19:18:59 +02:00
Add page about debugging with cargo-embed.
This commit is contained in:
38
src/bare-metal/microcontrollers/debugging.md
Normal file
38
src/bare-metal/microcontrollers/debugging.md
Normal file
@ -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>
|
@ -1,2 +1,8 @@
|
|||||||
[default.general]
|
[default.general]
|
||||||
chip = "nrf52833_xxAA"
|
chip = "nrf52833_xxAA"
|
||||||
|
|
||||||
|
[debug.gdb]
|
||||||
|
enabled = true
|
||||||
|
|
||||||
|
[debug.reset]
|
||||||
|
halt_afterwards = true
|
||||||
|
Reference in New Issue
Block a user