Skip to content

Commit 84666fc

Browse files
committed
Pin to Rust 1.76.0
Newer versions bloat the firmware. Signed-off-by: Petr Horacek <petr@zlosynth.com>
1 parent 254f6ff commit 84666fc

File tree

2 files changed

+24
-22
lines changed

2 files changed

+24
-22
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ jobs:
1919
uses: actions-rs/toolchain@v1
2020
with:
2121
target: x86_64-unknown-linux-gnu
22-
toolchain: stable
22+
toolchain: 1.76.0
2323
default: true
2424
override: true
2525
components: rustfmt, clippy
2626
- name: Install ARM Rust toolchain
2727
uses: actions-rs/toolchain@v1
2828
with:
2929
target: thumbv7em-none-eabihf
30-
toolchain: stable
30+
toolchain: 1.76.0
3131
override: true
3232
components: rustfmt, clippy
3333
- name: Install cargo-make

DEVELOPMENT.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,33 @@
44

55
Follow [Rust's installation guide](https://www.rust-lang.org/tools/install).
66

7-
Install tooling of the embedded Rust target for Cortex-M7F:
7+
Install tooling of the embedded Rust target for Cortex-M7F. It is necessary to
8+
use an older version of Rust, since newer version bloat the firmware:
89

910
```sh
10-
rustup target add thumbv7em-none-eabihf
11+
rustup install 1.76.0
12+
rustup +1.76.0 target add thumbv7em-none-eabihf
1113
```
1214

1315
This project utilizes [cargo make](https://github.com/sagiegurari/cargo-make):
1416

1517
```sh
16-
cargo install cargo-make
18+
cargo +1.76.0 install cargo-make
1719
```
1820

1921
Furthermore, the embedded part of the project uses [flip
2022
link](https://github.com/knurling-rs/flip-link):
2123

2224
```sh
23-
cargo install flip-link
25+
cargo +1.76.0 install flip-link
2426
```
2527

2628
## Formatting, linting, unit tests
2729

2830
Run formatting, linter and unit tests:
2931

3032
```sh
31-
makers
33+
cargo +1.76.0 make
3234
```
3335

3436
## DSP benchmark
@@ -37,7 +39,7 @@ Run the benchmark:
3739

3840
``` sh
3941
cd dsp
40-
cargo bench --bench bench
42+
cargo +1.76.0 bench --bench bench
4143
```
4244

4345
Use a profiler to analyze the results:
@@ -46,7 +48,7 @@ Use a profiler to analyze the results:
4648
cd dsp
4749
rm -f target/release/deps/bench-*
4850
rm -f callgrind.out.*
49-
RUSTFLAGS="-g" cargo bench --bench bench --no-run
51+
RUSTFLAGS="-g" cargo +1.76.0 bench --bench bench --no-run
5052
BENCH=$(find target/release/deps -type f -executable -name 'bench-*')
5153
valgrind \
5254
--tool=callgrind \
@@ -78,20 +80,20 @@ started](https://probe.rs/docs/getting-started/probe-setup/) to learn how.
7880
Then install Rust dependencies of probe-rs:
7981

8082
```sh
81-
cargo install probe-run
82-
cargo install flip-link
83+
cargo +1.76.0 install probe-run
84+
cargo +1.76.0 install flip-link
8385
```
8486

8587
To flash the project, call this make target:
8688

8789
```sh
88-
makers flash
90+
cargo +1.76.0 make flash
8991
```
9092

9193
Logging level can be set using an environment variable:
9294

9395
```sh
94-
DEFMT_LOG=info makers flash
96+
DEFMT_LOG=info cargo +1.76.0 make flash
9597
```
9698

9799
## Flash via DFU
@@ -105,15 +107,15 @@ On Fedora, this can be done by calling:
105107

106108
```sh
107109
sudo dnf install dfu-util
108-
cargo install cargo-binutils
110+
cargo +1.76.0 install cargo-binutils
109111
rustup component add llvm-tools-preview
110112
```
111113

112114
Click the RESET button while holding the BOOT button of the Daisy Patch SM to
113115
enter the bootloader. Then call this make target:
114116

115117
```sh
116-
makers flash-dfu
118+
cargo +1.76.0 make flash-dfu
117119
```
118120

119121
## Embedded tests
@@ -126,7 +128,7 @@ given in [Flash via ST-Link](#flash-via-st-link).
126128
To run one of the integration tests kept under `firmware/tests`:
127129

128130
```sh
129-
makers test-embedded button
131+
cargo +1.76.0 make test-embedded button
130132
```
131133

132134
## Embedded benchmark
@@ -140,7 +142,7 @@ Before running a benchmark, first make sure to go through the guidance given in
140142
To run one of the benchmarks kept under `benches/src/bin`:
141143

142144
```sh
143-
makers bench oversampling
145+
cargo +1.76.0 make bench oversampling
144146
```
145147

146148
## Firmware size
@@ -151,16 +153,16 @@ the firmware size stays slim and no bloat gets in.
151153
Install needed tooling:
152154

153155
```sh
154-
cargo install cargo-bloat
155-
cargo install cargo-binutils
156-
rustup component add llvm-tools-preview
156+
cargo +1.76.0 install cargo-bloat
157+
cargo +1.76.0 install cargo-binutils
158+
rustup +1.76.0 component add llvm-tools-preview
157159
```
158160

159161
Run the following command often to make sure no unnecessary heavy dependencies
160162
are brought in:
161163

162164
```sh
163-
makers bloat
165+
cargo +1.76.0 make bloat
164166
```
165167

166168
## Manual
@@ -176,7 +178,7 @@ sudo dnf install inkscape texlive-latex texlive-ec texlive-microtype texlive-pag
176178
To build the manual:
177179

178180
```sh
179-
makers manual
181+
cargo +1.76.0 make manual
180182
```
181183

182184
The built PDF is then available in `manual/user/manual.pdf`.

0 commit comments

Comments
 (0)