#Rust on the AVR

10 messages · Page 1 of 1 (latest)

sudden folio
#

I've been trying so hard to give Rust a shot. I want to get it running on this AVR. Before this point, I've written off Rust for any real usage, just because of all my experiences being plain horrible. This time, I'm really really trying to give it a fighting chance at proving itself to me. I've spent two hours on trying to get the most simple Rust program compiling and running on an Arduino Uno. However, every guide or tutorial online just does not work. My first problem was with Cargo telling me rust-src was missing from the nightly toolchain, and with ls I confirmed it was indeed missing. However, rustup was insisting it was up to date. I tried every command and every which way I could to install it, and rustup just continued to insist that it was installed. Finally, I just purged Rust from my system and reinstalled, and that seemed to work.

Now, I'm finally stuck on the compiling to the AVR. First tutorial was outdated and was a bust (crate core not found, blah blah) - so I'm trying this next one (also the only other one I could find) out. (specifically https://book.avr-rust.com). (Also yes, I tried using the cargo generate template from https://github.com/Rahix/avr-hal, which just absolutely did not work either.) I was told to use this command: cargo build --target avr-atmega328p.json -Z build-std=core --all --release to build. I ran it, and lo and behold, while compiling core, the Rust compiler segfaults.

#

I would really appreciate a working guide on how to build Rust code for an Arduino Uno, because at this point the pain of C/C++ is a lot duller than this.

#

(I also find it incredibly ironic that the Rust compiler segfaulted)

brisk dock
#

I have a example project you can use

#

It's based on an older version of avr-hal but should work fine

brisk dock
sudden folio
#

thank you! and will do

brisk dock
#

I would get you a updated project, but I am not near my computer 😅

#

I think I last used this version of the project on nightly-2021-01-07, so not 100% sure it works on the newest nightly, but you should be able to update the avr-hal version in any case