riscv-rust / riscv-rust-quickstart Goto Github PK
View Code? Open in Web Editor NEWA template for building Rust applications for HiFive1 boards
A template for building Rust applications for HiFive1 boards
We should probably deprecate riscv-crates in favor of this crate.
I am following the quickstart guide, and at the step to build the project I am met with this odd error.
I have included my version of rustc as well as the output from cargo build.
I am very familiar with micro-controllers but fairly new to rust so let me know if I can provide any extra info
$ rustc --version
rustc 1.65.0 (897e37553 2022-11-02)
crocy@Ciela:~/Projects/rustyrisc$ cargo build
Compiling rustyrisc v0.0.0 (/home/crocy/Projects/rustyrisc)
error: linking with `rust-lld` failed: exit status: 1
|
= note: "rust-lld" "-flavor" "gnu" "/tmp/rustcVUtNxD/symbols.o" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/rustyrisc-340a189dd2b7ebcc.191763b6qeivp0v0.rcgu.o" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/rustyrisc-340a189dd2b7ebcc.1987xlvieevj0tms.rcgu.o" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/rustyrisc-340a189dd2b7ebcc.19obqabi946y7o1r.rcgu.o" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/rustyrisc-340a189dd2b7ebcc.269xfqgnd3lgrauq.rcgu.o" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/rustyrisc-340a189dd2b7ebcc.32pg9wnu1e78caih.rcgu.o" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/rustyrisc-340a189dd2b7ebcc.37gpbvsixmx7gl5v.rcgu.o" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/rustyrisc-340a189dd2b7ebcc.4094yhgdnwx4v2us.rcgu.o" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/rustyrisc-340a189dd2b7ebcc.4tkq43s7ixlrmyxg.rcgu.o" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/rustyrisc-340a189dd2b7ebcc.56yiw9onvqcruaje.rcgu.o" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/rustyrisc-340a189dd2b7ebcc.e32mww6o103e6vx.rcgu.o" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/rustyrisc-340a189dd2b7ebcc.h69j05cbo8d93mz.rcgu.o" "--as-needed" "-L" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps" "-L" "/home/crocy/Projects/rustyrisc/target/debug/deps" "-L" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/build/hifive1-9be2463d5add7ca4/out" "-L" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/build/e310x-1c331dad9ffe38f9/out" "-L" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/build/riscv-a28e17a96cc9cd1e/out" "-L" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/build/riscv-rt-39dd4487a0b27e86/out" "-L" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/build/riscv-rt-39dd4487a0b27e86/out" "-L" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/build/riscv-a4fda5c8cc853cbe/out" "-L" "/home/crocy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib" "-Bstatic" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libriscv_rt-cd2952c4a01cb5bd.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libriscv-643a869016150aa2.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libbare_metal-749f7232feff9e0b.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libr0-3236fafac8f81336.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libhifive1-4ddc5b45a321809a.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libe310x_hal-7dfc806e8fd36895.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libembedded_hal-4e1ed0a75d0ba899.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libvoid-d8b8e8aefa40767b.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libnb-289bc072f9c7d8f4.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libnb-597abaa48ca4f88f.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libe310x-a290ffc01dd5e789.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libvcell-91bdd832aedc2a21.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libriscv-d327b2c75471c245.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libbit_field-4067a321429c94bf.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libbare_metal-e6906f1496eb0c91.rlib" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/libpanic_halt-529e715bac21ad51.rlib" "/home/crocy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/librustc_std_workspace_core-fe9e070fcdbe7977.rlib" "/home/crocy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcore-f240d2ef23c59200.rlib" "/home/crocy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-15a8c7a5252dc399.rlib" "-Bdynamic" "-znoexecstack" "-L" "/home/crocy/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib" "-o" "/home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/deps/rustyrisc-340a189dd2b7ebcc" "--gc-sections" "-Thifive1-link.x"
= note: rust-lld: error: /home/crocy/Projects/rustyrisc/target/riscv32imac-unknown-none-elf/debug/build/riscv-rt-39dd4487a0b27e86/out/link.x:58: expected filename pattern
>>> (*(.trap));
>>> ^
error: could not compile `rustyrisc` due to previous error
After compiling, and flashing the spi_wifi.rs example to a hifive1 revb board, the example does not work.
Expected to see this over the terminal:
WiFi Test
resp: OK\r\n
Instead, I get this over the terminal:
WiFi Test
resp: Err(ProtocolError)
Looking at the actual response packet, this is the actual response from the esp chip (4 byte array):
[67, 0, 0, 0]
Which doesn't match the expectation in the code that the 4th byte == 0x42.
In addition, there seems to be absolutely no documentation about this spi protocol anywhere from SiFive or Espressif. The only links I can find simply lead back to this example code xD seems the only way this was figured out was reverse engineering from the bootloader... which is something I'd rather not have to do...
Also, in case it is relevant somehow, for flashing, I've been using this script, modified from the sifive freedom sdk makefiles,:
cargo build if [ $? -ne 0 ] then exit 1 fi HEX_FILE=flashed.hex $RISCV_PATH/bin/riscv64-unknown-elf-objcopy -O ihex $1 $HEX_FILE echo -e "loadfile $HEX_FILE\n\rnh\nexit" | JLinkExe -device FE310 -if JTAG -speed 4000 -jtagconf -1,-1 -autoconnect 1
Hopefully I'm just being dumb about something here :D
cargo run
Updating crates.io index
Downloaded hifive1 v0.5.0
Downloaded e310x-hal v0.5.0
Downloaded embedded-hal v0.2.3
Downloaded e310x v0.5.0
Compiling e310x v0.5.0
Compiling hifive1 v0.5.0
Compiling embedded-hal v0.2.3
Compiling e310x-hal v0.5.0
Compiling riscv-rust-quickstart v0.1.0 (/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a)
error: linking with rust-lld
failed: exit code: 1
|
= note: "rust-lld" "-flavor" "gnu" "-L" "/home/jishnuch/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/riscv_rust_quickstart-ede915971db5d865.2v5z92f4kufubo09.rcgu.o" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/riscv_rust_quickstart-ede915971db5d865.3ln32byj86n95k05.rcgu.o" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/riscv_rust_quickstart-ede915971db5d865.41miiojsp6tg8por.rcgu.o" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/riscv_rust_quickstart-ede915971db5d865.4446yfjab6jrhtqv.rcgu.o" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/riscv_rust_quickstart-ede915971db5d865.4axbgzb8w95afh6i.rcgu.o" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/riscv_rust_quickstart-ede915971db5d865.4re4bjs18swaqg72.rcgu.o" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/riscv_rust_quickstart-ede915971db5d865.5eufnp5235g0hcsn.rcgu.o" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/riscv_rust_quickstart-ede915971db5d865.goo8u5bj72ecqor.rcgu.o" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/riscv_rust_quickstart-ede915971db5d865.t0iq9y37bx2k34n.rcgu.o" "-o" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/riscv_rust_quickstart-ede915971db5d865" "--gc-sections" "-L" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps" "-L" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/debug/deps" "-L" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/build/hifive1-cf7a1820d69cc652/out" "-L" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/build/e310x-c6cd8513175931dc/out" "-L" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/build/riscv-bedb254b1eeebebd/out" "-L" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/build/riscv-rt-4bd8095cf7e29401/out" "-L" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/build/riscv-rt-4bd8095cf7e29401/out" "-L" "/home/jishnuch/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib" "-Bstatic" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libhifive1-9006b674e3762805.rlib" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libe310x_hal-cfff54b8f9f70f1e.rlib" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libembedded_hal-4857c1dde0521056.rlib" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libvoid-e072b13301e95d1e.rlib" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libnb-1d1f9be4dee3f9c1.rlib" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libe310x-3d228c153f767fa2.rlib" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libvcell-4252ae51db5d104c.rlib" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libriscv_rt-6fd54f4ef8d053e0.rlib" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libr0-271bcea9b42cf7e5.rlib" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libriscv-17562adacbbf9cbd.rlib" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libbit_field-72f8f17484dfd851.rlib" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libbare_metal-c58804a343b9a3e1.rlib" "--start-group" "/home/jishnuch/Downloads/riscv-rust-quickstart-dcc46ed07a2282cca131a680a8f8bf60ce234a8a/target/riscv32imac-unknown-none-elf/debug/deps/libpanic_halt-13b0dfd9fe0f4e96.rlib" "/home/jishnuch/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/librustc_std_workspace_core-5a60e280b382f06e.rlib" "/home/jishnuch/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcore-8010f7064010be9c.rlib" "--end-group" "/home/jishnuch/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/riscv32imac-unknown-none-elf/lib/libcompiler_builtins-26b11cd3df3b5c44.rlib" "-Tmemory-hifive1-revb.x" "-Tlink.x" "-Bdynamic"
= note: rust-lld: error: cannot find linker script memory-hifive1-revb.x
error: aborting due to previous error
error: Could not compile riscv-rust-quickstart
.
CAN U PLEASE HELP IN RESOLVING THE ABOVE PROBLEM.
Regards
Jishnu
Following the steps from README.md I get many linker errors, starting with
>>> referenced by riscv-rt.o:(.init+0x52) in archive /home/newby/projects/hifive/hifive-test/target/riscv32imac-unknown-none-elf/debug/deps/libriscv_rt-3aa7df5894fafdbf.rlib
>>> referenced by riscv-rt.o:(.init+0x56) in archive /home/newby/projects/hifive/hifive-test/target/riscv32imac-unknown-none-elf/debug/deps/libriscv_rt-3aa7df5894fafdbf.rlib
rust-lld: error: undefined symbol: _stack_start
>>> referenced by riscv-rt.o:(.init+0x5E) in archive /home/newby/projects/hifive/hifive-test/target/riscv32imac-unknown-none-elf/debug/deps/libriscv_rt-3aa7df5894fafdbf.rlib
Full transcript:
commands.txt
Many thanks in advance for any help
Hello,
after a successful compilation with cargo build --example leds_blink
and having JLinkGDBServer running, I am unable to flash any program to a hifive1 rev b (sparkfun red-v) board.
As shown in the screenshot above, the process seems to halt after "Starting target CPU...", with no response from the board at all, except after a "Reset" button press which indicates "ERROR: Cannot read register 4096 (X0) while CPU is running".
I have ran the hifive1-recover script before, which seemed to run without errors, but to no avail.
The board does not show any green led when resetting, as indicated by this repo, which signals any kind of failure of the board if this is intended behavior.
The JLink, as well as the riscv SiFive toolchains have been correctly installed and added to my user's PATH.
Another beginnger question. Working my way through examples, and sprintln macro very useful to make sure working. Problem is not exactly sure how to view output.
As example, hello_world, upon running, output:
0x00001004 in ?? ()
JTAG tap: riscv.cpu tap/device found: 0x20000913 (mfg: 0x489 (SiFive Inc), part: 0x0000, ver: 0x2)
keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (2135). Workaround: increase "set remotetimeout" in GDB
Loading section .text, size 0x5c4a lma 0x20010000
Loading section .rodata, size 0xa94 lma 0x20015c50
Start address 0x20010000, load size 26334
Transfer rate: 4 KB/sec, 8778 bytes/write.
In openocd
Info : accepting 'gdb' connection on tcp/3333
Info : JTAG tap: riscv.cpu tap/device found: 0x20000913 (mfg: 0x489 (SiFive Inc), part: 0x0000, ver: 0x2)
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1993). Workaround: increase "set remotetimeout" in GDB
Info : JTAG tap: riscv.cpu tap/device found: 0x20000913 (mfg: 0x489 (SiFive Inc), part: 0x0000, ver: 0x2)
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (2043). Workaround: increase "set remotetimeout" in GDB
Info : Padding image section 0 at 0x20015c4a with 6 bytes
Info : JTAG tap: riscv.cpu tap/device found: 0x20000913 (mfg: 0x489 (SiFive Inc), part: 0x0000, ver: 0x2)
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet
not sent! (2134). Workaround: increase "set remotetimeout" in GDB
Depends on #2
Crate cortex-m-quickstart
provided a way to debug program, on QEMU with debug support on VSCode: https://github.com/rust-embedded/cortex-m-quickstart/tree/1a60c1d94489cec3008166a803bdcf8ac306b98f/.vscode . Maybe after a proper VSCode (probable somehow RISC-V Debug) plugin comes out we can fire a support on it.
Im trying to use HiFive rev b board with DHT22 sensor. It needs "open-drain" output option to work. I asked on Matrix - Rust Embedded channel and what i get from there its not supported by this chip or library. As solution for this they gave me as example this link:
https://github.com/rp-rs/rp-hal/blob/main/rp2040-hal/examples/dht11.rs#L55-L88
"At a lower level, you could set input_en=1, output_val=0, pue=1 and then set output_en=1 to actively pull the line down, output_en=0 to pull it up using the weak pull-up resistor, and read input_val to read back the DHT response. But it seems like that mode is not implemented by the HAL. (Same situation as with the RP2040 and its HAL)"
Please could you update your library with such feature? To make it more useful for others.
Hi,
I built riscv-rust-toolchain on Ubuntu 17.10 and tried to build riscv-rust-quickstart:
I modified RISCV_RUST_TOOLCHAIN
in evn.sh and hit make build
but I got following error:
$ make build
xargo build --target riscv32-unknown-none
Compiling core v0.0.0 (file:///home/msyksphinz/work/riscv-rust-toolchain/rust/src/libcore)
LLVM ERROR: Cannot select: t107: i32,ch = AtomicLoad<Volatile LD1[%15]> t46, t2
t2: i32,ch = CopyFromReg t0, Register:i32 %vreg9
t1: i32 = Register %vreg9
In function: _ZN67_$LT$core..sync..atomic..AtomicBool$u20$as$u20$core..fmt..Debug$GT$3fmt17hc6a29f4acb3c894eE
error: Could not compile `core`.
To learn more, run the command again with --verbose.
error: `"cargo" "build" "--release" "--manifest-path" "/tmp/xargo.WZzehUAByIZ6/Cargo.toml" "--target" "riscv32-unknown-none" "-p" "alloc"` failed with exit code: Some(101)
note: run with `RUST_BACKTRACE=1` for a backtrace
Makefile:5: recipe for target 'build' failed
make: *** [build] Error 1
with --verbose
$ xargo build --verbose --target riscv32-unknown-none
+ "rustc" "--print" "sysroot"
+ "rustc" "--print" "target-list"
+ "cargo" "build" "--release" "--manifest-path" "/tmp/xargo.84aDJjh1M7p1/Cargo.toml" "--target" "riscv32-unknown-none" "-v" "-p" "alloc"
Compiling core v0.0.0 (file:///home/msyksphinz/work/riscv-rust-toolchain/rust/src/libcore)
Running `rustc --crate-name core /home/msyksphinz/work/riscv-rust-toolchain/rust/src/libcore/lib.rs --crate-type lib --emit=dep-info,link -C opt-level=3 -C metadata=4fff07133b7934d6 -C extra-filename=-4fff07133b7934d6 --out-dir /tmp/xargo.84aDJjh1M7p1/target/riscv32-unknown-none/release/deps --target riscv32-unknown-none -L dependency=/tmp/xargo.84aDJjh1M7p1/target/riscv32-unknown-none/release/deps -L dependency=/tmp/xargo.84aDJjh1M7p1/target/release/deps -C link-arg=-Tlink.x -C linker=riscv32-unknown-elf-ld --sysroot /home/msyksphinz/work/riscv-rust-toolchain/build/xargo -Z force-unstable-if-unmarked`
LLVM ERROR: Cannot select: t107: i32,ch = AtomicLoad<Volatile LD1[%15]> t46, t2
t2: i32,ch = CopyFromReg t0, Register:i32 %vreg9
t1: i32 = Register %vreg9
In function: _ZN67_$LT$core..sync..atomic..AtomicBool$u20$as$u20$core..fmt..Debug$GT$3fmt17hc6a29f4acb3c894eE
error: Could not compile `core`.
Could you give me some advice to solve this?
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?
Ran into similar issue to @engineerJishnu where JLinkGDBServer -device FE310 -if JTAG -speed 4000 -port 3333 -nogui
stays on Waiting for GDB connection...
. Tried solution to cargo run --example led_gpio
, but then receive new error:
Python Exception <type 'exceptions.ImportError'> No module named gdb:
riscv64-unknown-elf-gdb: warning:
Limited Python support is available from the _gdb module.
Suggest passing --data-directory=/path/to/gdb/data-directory.
Reading symbols from target/riscv32imac-unknown-none-elf/debug/examples/led_gpio...
db_init:4: Error in sourced command file:
:3333: Interrupted system call.
(gdb)
Any ideas?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.