调试

Embed.toml:

  1. [default.general]
  2. chip = "nrf52833_xxAA"
  3. [debug.gdb]
  4. enabled = true

src/bare-metal/microcontrollers/examples/ 目录下某个终端中:

  1. cargo embed --bin board_support debug

在同一目录下的另一个终端中:

在 gLinux 或 Debian 上:

  1. gdb-multiarch target/thumbv7em-none-eabihf/debug/board_support --eval-command="target remote :1337"

在 MacOS 上:

  1. arm-none-eabi-gdb target/thumbv7em-none-eabihf/debug/board_support --eval-command="target remote :1337"

在 GDB 中,请尝试运行以下命令:

  1. b src/bin/board_support.rs:29
  2. b src/bin/board_support.rs:30
  3. b src/bin/board_support.rs:32
  4. c
  5. c
  6. c