[英]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-gdb , gdb-multiarch或gdb 。 您可能必須嘗試所有這三個。
現在,就您的問題而言,您必須在openocd.gdb中使用相同的參數。 就我而言,我已經成功嘗試了arm-none-eabi-gdb 。 請記住,我在Windows 10上使用rust。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.