-
I'm on windows I'm getting this error when I follow online tutorials. My cargo.toml: [package]
name = "rust-arduino-blink"
version = "0.1.0"
authors = [""]
edition = "2018"
[dependencies]
panic-halt = "0.2.0"
[dependencies.arduino-uno]
git = "https://github.com/Rahix/avr-hal"
[build]
target = "avr-atmega328p.json"
[unstable]
build-std = ["core"] And my #![no_std]
#![no_main]
extern crate panic_halt;
use arduino_uno::prelude::*;
#[arduino_uno::entry]
fn main() -> ! {
let dp = arduino_uno::Peripherals::take().unwrap();
unimplemented!()
} Any help would be much appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
You need to read the instructions more carefully ;) This part: [build]
target = "avr-atmega328p.json"
[unstable]
build-std = ["core"] does not belong into Also, you need more directives in your |
Beta Was this translation helpful? Give feedback.
-
@Rahix Thanks for your help! I've now created the
Any suggestions? |
Beta Was this translation helpful? Give feedback.
-
Please try using rustup toolchain install nightly-2021-01-07
rustup override set nightly-2021-01-07 Also, you should probably pin the version of avr-hal in your dependencies like this: [dependencies.arduino-uno]
git = "https://github.com/rahix/avr-hal"
rev = "b1aedf824fcb59078f8022d4464b2835ae4bd83a" |
Beta Was this translation helpful? Give feedback.
-
Thanks, this now worked! Only issue is that my IDE is showing errors as rust language server is not available on that nightly date, and it's hard to find the most recent nightly build before the 8th jan that includes rls. Thanks again for your help! |
Beta Was this translation helpful? Give feedback.
-
I am also facing this problem in my Clion 2023.2.2 with Rust plugin. It works well (it can be built and flashed), the only problem is the IDE compile error [build]
target = "avr-specs/avr-atmega2560.json"
[target.'cfg(target_arch = "avr")']
runner = "ravedude mega2560 -cb 57600"
[unstable]
build-std = ["core"] |
Beta Was this translation helpful? Give feedback.
You need to read the instructions more carefully ;)
This part:
does not belong into
Cargo.toml
, but into a separate file named.cargo/config.toml
.Also, you need more directives in your
Cargo.toml
to configure the build profile. Take another look at the Starting your own project guide to see the details.