DEV Community

Discussion on: How to run Rust on Arduino Uno

Collapse
 
mikla profile image
Artsiom Miklushou

Thanks for the article!

I'm getting an error:

error: ran out of registers during register allocation
Enter fullscreen mode Exit fullscreen mode

macos catalina.

Collapse
 
ea2305 profile image
Elihu Cruz

Not sure if can it apply, but on windows, I got the same error and I solved it by changing the nightly version rustup override set nightly-2021-01-07
Here is the AVR reference, I hope it can be useful: github.com/Rahix/avr-hal#starting-...

Collapse
 
xphoniex profile image
Dave

you're getting this error because Cargo.toml is missing:

[profile.dev]
panic = "abort"
lto = true
opt-level = "s"
Enter fullscreen mode Exit fullscreen mode

anyway, this can't be compiled anymore:

   Compiling avr-device v0.2.3
error: cannot find macro `llvm_asm` in this scope
  --> /.cargo/registry/src/github.com-1ecc6299db9ec823/avr-device-0.2.3/src/interrupt.rs:18:22
   |
18 |             unsafe { llvm_asm!("cli" :::: "volatile") };
   | 
Enter fullscreen mode Exit fullscreen mode

and you need to switch from arduino-uno crate to arduino-hal. (example)