Skip to content

Commit d8b90f5

Browse files
authored
Merge pull request #47 from jhg/master
Simplify instructions using current Cargo features and reduce size of compiled result
2 parents a79cd6c + c44163d commit d8b90f5

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ edition = '2018'
88
ruduino = { git = "https://github.com/avr-rust/ruduino", branch = "master" }
99

1010
[profile.release]
11+
opt-level = 'z'
1112
lto = true
13+
strip = true

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Designed for the ATmega328p.
1212

1313
* A recent version of the nightly Rust compiler. Anything including or
1414
greater than `rustc 1.63.0-nightly (fee3a459d 2022-06-05)` can be used.
15+
* A recent version of Cargo. At least 1.52.0 or greater.
1516
* The rust-src rustup component - `$ rustup component add rust-src`
1617
* AVR-GCC on the system for linking
1718
* AVR-Libc on the system for support libraries
@@ -22,18 +23,11 @@ Designed for the ATmega328p.
2223
Now to build, run:
2324

2425
```bash
25-
rustup override set nightly
26-
2726
# Ensure time delays are consistent with a 16MHz microcontroller.
2827
export AVR_CPU_FREQUENCY_HZ=16000000
2928

3029
# Compile the crate to an ELF executable.
31-
cargo build -Z build-std=core --target avr-atmega328p.json --release
32-
33-
# Note: there is work in progress to make that easier
34-
# peeking in .cargo/config.tom will show that
35-
# cargo build --release
36-
# is the short version
30+
cargo build --release
3731
```
3832
There should now be an ELF file at `target/avr-atmega328p/release/blink.elf`. It
3933
can be flashed directly to an AVR microcontroller or ran inside a simulator.

rust-toolchain.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "nightly"

0 commit comments

Comments
 (0)