-
Notifications
You must be signed in to change notification settings - Fork 562
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
[BUG] User led Rust example doesn't compile #2836
Comments
I've asked on the Discord server and as always @lupyuen was very useful and giving me ideas to test :), here's the transcript of his response:
|
Here's the https://gist.github.com/lvanasse/f62e9fa59f8382dd9881178fc1904211 |
When trying for the nuttx_ws/nuttx [master●] » make -j
error[E0463]: can't find crate for `core`
|
= note: the `armv7a-none-eabihf` target may not be installed
= help: consider downloading the target with `rustup target add armv7a-none-eabihf`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0463`.
make[2]: *** [/home/ludovic/Code/nuttx_ws/apps/Application.mk:330: leds_rust_main.rs.home.ludovic.Code.nuttx_ws.apps.examples.leds_rust.o] Error 1
make[1]: *** [Makefile:52: /home/ludovic/Code/nuttx_ws/apps/examples/leds_rust_all] Error 2
make: *** [tools/LibTargets.mk:248: /home/ludovic/Code/nuttx_ws/apps/libapps.a] Error 2
make: *** Waiting for unfinished jobs....
nuttx_ws/nuttx [master●] » And when I try to download the target here's the message I get: nuttx_ws/nuttx [master●] » rustup target add armv7a-none-eabihf
error: toolchain 'stable-x86_64-unknown-linux-gnu' does not support target 'armv7a-none-eabihf'; did you mean 'armv7r-none-eabihf'?
note: you can see a list of supported targets with `rustc --print=target-list`
note: if you are adding support for a new target to rustc itself, see https://rustc-dev-guide.rust-lang.org/building/new-target.html I also did try with nightly but same result. |
@lvanasse I was able to reproduce the problem with Docker: https://gist.github.com/nuttxpr/a881eea7923c9471d026ac2bfcbdac82 It seems the problem is caused by the incompatibility between Rust Compiler and GCC Linker used by NuttX:
So it seems we have to wait for NuttX support to become official in Rust: |
You're awesome @lupyuen ! I'm a bit ashamed I was not to be able to figure this out on my own, thank you very much for helping and teaching me :). Is there a way I could be useful in the process of making this possible to use on ARM? Could @no1wudi use some help? Maybe we could do our own call in the Rust code for the |
@lvanasse No worries :-) Yep we could code it ourselves. Actually it could have been simpler if we used Rust Libraries (Crates), but NuttX doesn't support them sigh: https://lupyuen.github.io/articles/rust6#no-crates-in-nuttx The best we can do right now: Put the code into a Rust Source File (like nuttx.rs) and share it across our Rust Projects. Like this: https://github.com/apache/nuttx-apps/blob/master/examples/leds_rust/nuttx.rs |
Awesome! Thank you for the guidance, I'll try to give it a go when I have the energy/time for it :). |
Description / Steps to reproduce the issue
To reproduce the issue:
nucleo-l452re
config: ./tools/configure.sh -E -l nucleo-l452re:nshmake menuconfig
enable theUSERLED
option forLED Driver
make menuconfig
enable theEXAMPLES_LEDS_RUST
option, and leave everything as defaultmake -j
And you should have this error message:
On which OS does this issue occur?
[OS: Linux]
What is the version of your OS?
Ubuntu 22.04 LTS
NuttX Version
master - e2a2133 and stable 12.7
Issue Architecture
[Arch: arm]
Issue Area
[Area: Examples]
Verification
The text was updated successfully, but these errors were encountered: