-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
riscv rt linker issue with cargo build #260
Comments
Related: #153 |
I was able to reproduce your issue on my machine. I then changed |
we removed references to This may be the reason why it now works. We should release a new version of |
If you look into cargo.toml we have already updated riscv_rt to 13.0, cargo build -r --example gptimer works for us which is a release build. But cargo build --example gptimer is giving above linker issue. It is not just in this project but this is reflected in other projects as well, for example you can check out this as well.
|
Try pointing to GitHub's master branch instead of crates.io's version. It should work. I'll publish a 0.13.1 if it does. |
Thank you @romancardenas It works. We have tested it with two different projects using the GitHub master branch. You can proceed to publish it |
Hi @romancardenas , new issue encountered when i try to use semihosting with riscv_rt, please check out this. git : https://github.com/imrank03/riscv_semi.git its just a basic hprintln!, giving a linker issue is it something to do with riscvrt?
|
That sounds more like you have not activated any feature flag to enable a valid implementation of |
The patch is here: https://github.com/rust-embedded/riscv/tree/rvrt-patch @yashwanthsinghm can you please run your apps using this branch and confirm it works? |
Hi @romancardenas, I made changes and enabled the Could you please check with [dependencies]
riscv = { git = "https://github.com/rust-embedded/riscv", branch = "rvrt-patch", features = ["critical-section-single-hart"] }
riscv-rt = { git = "https://github.com/rust-embedded/riscv", branch = "rvrt-patch" }
riscv-semihosting = { version = "0.1.2" }
panic-halt = "1.0.0" Here is the working Git repository: (https://github.com/imrank03/riscv_semi). Note: Tested on board, and it is working with these changes. Let me know your thoughts. |
You are experiencing an interesting issue regarding how Cargo deals with dependencies. Let's leave your The In your dependencies, you are mixing the
Then, in your example, you don't use Modify your example. You can add something like Working examples: #![no_std]
#![no_main]
use panic_halt as _;
use riscv as _; // We tell Cargo that we want to use our riscv dependency
use riscv_rt::entry;
use riscv_semihosting::{debug, hprintln};
// use semihosting::println;
#[entry]
fn main() -> ! {
hprintln!("Hello, world!");
debug::exit(debug::EXIT_FAILURE);
loop {}
} I prefer this other, though: #![no_std]
#![no_main]
use panic_halt as _;
use riscv_rt::entry;
use riscv_semihosting::{debug, hprintln};
// use semihosting::println;
#[entry]
fn main() -> ! {
hprintln!("Hello, world!");
debug::exit(debug::EXIT_FAILURE);
loop {
riscv::asm::wfi(); // explicitly use riscv, so Cargo does not drop it
}
} Once the patch is on |
Thank you for the detailed explanation! I truly appreciate your insights and guidance. I'll make the changes as you suggested. Thanks again for your help! 😊 |
Thank you @romancardenas for clearing out confusion, the patch branch works. I hope it reflects on crates.io in latest release. |
This should be fixed in the new release. @yashwanthsinghm can you check it? |
Closing as complete |
We have used riscv_rt in our current projects and encountered a couple of issues:
Cargo release builds are happening but when we compile for debug its giving following error.
github : Strange21/RISCV: software for RISCV
In-order to reproduce the error
Issue
The text was updated successfully, but these errors were encountered: