繁体   English   中英

Rust发现,配置文件未按预期工作

[英]Rust discovery, config file not working as expected

我试图避免在每个GDB会话中输入相同的命令。 为此,我遵循了锈发现书中的说明,但是当我通过货运运行程序时,程序无法按书中所述运行,它给出以下错误:

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"

请将runner =“ arm-none-eabi-gdb -q -x openocd.gdb”更改为runner =“ gdb-multiarch -q -x openocd.gdb”。 因为,如果您使用的是Ubuntu 18.04 LTS版本,那么此命令将用作书中提到的内容。

Ubuntu 18.04或更高版本/ Debian Stretch或更高版本

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

Ubuntu 14.04和16.04

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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM