【问题标题】:Rust discovery, config file not working as expectedRust 发现,配置文件未按预期工作
【发布时间】:2019-09-16 23:13:24
【问题描述】:

我试图避免在每个 GDB 会话中输入相同的命令。为此,我已按照rust discovery book 中的说明进行操作,但是当我通过 cargo run 运行程序时,程序无法按照书中所述运行,它给出以下错误:

ts/project/discovery/src/06-hello-world$ cargo run
   error: could not load Cargo configuration  
cargo run --target thumbv7em-none-eabihf
    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `arm-none-eabi-gdb -q -x openocd.gdb /home/jawwad-turabi/Documents/project/discovery/target/thumbv7em-none-eabihf/debug/led-roulette`
error: could not execute process `arm-none-eabi-gdb -q -x openocd.gdb /home/jawwad-turabi/Documents/project/discovery/target/thumbv7em-none-eabihf/debug/led-roulette` (never executed)

Caused by:
  No such file or directory (os error 2)

我的 openocd.gdb 文件包含以下内容:

   target remote: 3333
    load
    break main
    continue

我的配置文件包含以下内容:

 [target.thumbv7em-none-eabihf]
   runner = "arm-none-eabi-gdb -q -x openocd.gdb"
   rustflags = [
   "-C", "link-arg=-Tlink.x",
   ]
   +[build]
   +target = "thumbv7em-none-eabihf"

【问题讨论】:

    标签: rust gdb openocd stm32ldiscovery rustdoc


    【解决方案1】:

    请将 runner = "arm-none-eabi-gdb -q -x openocd.gdb" 改成这个 亚军 = “gdb-multiarch -q -x openocd.gdb”。 因为,如果您使用的是 Ubuntu 18.04 LTS 版本,那么此命令将用作本书提及。

    Ubuntu 18.04 或更新版本 / Debian stretch 或更新版本

    注意 gdb-multiarch 是您将用于调试 ARM 的 GDB 命令 Cortex-M 程序

    Ubuntu 14.04 和 16.04

    注意 arm-none-eabi-gdb 是您将用于调试 ARM 的 GDB 命令 Cortex-M 程序

    【讨论】:

      【解决方案2】:

      在刷入 STM32F3 时,我们必须连接到相应的 GDB 服务器。它可能是 arm-none-eabi-gdbgdb-multiarchgdb。您可能必须尝试所有这三个。

      现在,就您的问题而言,您必须在 openocd.gdb 中使用相同的参数。就我而言,我已经成功地尝试了 arm-none-eabi-gdb。请记住,我在 Windows 10 上使用 rust。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-04-25
        • 2017-10-17
        • 1970-01-01
        • 1970-01-01
        • 2019-01-08
        • 1970-01-01
        • 2018-09-23
        相关资源
        最近更新 更多