riscv-rust / riscv-rust-quickstart

A template for building Rust applications for HiFive1 boards
205 stars 24 forks source link

Cargo run produces an error #19

Closed avantgardnerio closed 3 years ago

avantgardnerio commented 3 years ago

I'm sorry for what seems like a daft question, but I'm trying this on my rev b, and when I get to step 5 I see:

    Finished dev [unoptimized + debuginfo] target(s) in 0.04s
     Running `riscv64-unknown-elf-gdb -q -x gdb_init target/riscv32imac-unknown-none-elf/debug/examples/leds_blink`
error: could not execute process `riscv64-unknown-elf-gdb -q -x gdb_init target/riscv32imac-unknown-none-elf/debug/examples/leds_blink` (never executed)
bgardner@bgardner-Blade:~/workspace/hifive$ 

It seems like cargo run is trying to run it on my host computer, and it is failing (which makes sense). How do I cause it to upload to the board and run?

Disasm commented 3 years ago

You need to install gdb for RISC-V and put it in PATH. cargo looks for the riscv64-unknown-elf-gdb executable name, but if you have a different one (like riscv32-elf-gdb), you can change it in .cargo/config.

avantgardnerio commented 3 years ago

Okay, thanks for the clarification! I'll give it a try and PR the readme if I think I can help the next person.