4
4
5
5
Follow [ Rust's installation guide] ( https://www.rust-lang.org/tools/install ) .
6
6
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:
8
9
9
10
``` sh
10
- rustup target add thumbv7em-none-eabihf
11
+ rustup install 1.76.0
12
+ rustup +1.76.0 target add thumbv7em-none-eabihf
11
13
```
12
14
13
15
This project utilizes [ cargo make] ( https://github.com/sagiegurari/cargo-make ) :
14
16
15
17
``` sh
16
- cargo install cargo-make
18
+ cargo +1.76.0 install cargo-make
17
19
```
18
20
19
21
Furthermore, the embedded part of the project uses [ flip
20
22
link] ( https://github.com/knurling-rs/flip-link ) :
21
23
22
24
``` sh
23
- cargo install flip-link
25
+ cargo +1.76.0 install flip-link
24
26
```
25
27
26
28
## Formatting, linting, unit tests
27
29
28
30
Run formatting, linter and unit tests:
29
31
30
32
``` sh
31
- makers
33
+ cargo +1.76.0 make
32
34
```
33
35
34
36
## DSP benchmark
@@ -37,7 +39,7 @@ Run the benchmark:
37
39
38
40
``` sh
39
41
cd dsp
40
- cargo bench --bench bench
42
+ cargo +1.76.0 bench --bench bench
41
43
```
42
44
43
45
Use a profiler to analyze the results:
@@ -46,7 +48,7 @@ Use a profiler to analyze the results:
46
48
cd dsp
47
49
rm -f target/release/deps/bench-*
48
50
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
50
52
BENCH=$( find target/release/deps -type f -executable -name ' bench-*' )
51
53
valgrind \
52
54
--tool=callgrind \
@@ -78,20 +80,20 @@ started](https://probe.rs/docs/getting-started/probe-setup/) to learn how.
78
80
Then install Rust dependencies of probe-rs:
79
81
80
82
``` 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
83
85
```
84
86
85
87
To flash the project, call this make target:
86
88
87
89
``` sh
88
- makers flash
90
+ cargo +1.76.0 make flash
89
91
```
90
92
91
93
Logging level can be set using an environment variable:
92
94
93
95
``` sh
94
- DEFMT_LOG=info makers flash
96
+ DEFMT_LOG=info cargo +1.76.0 make flash
95
97
```
96
98
97
99
## Flash via DFU
@@ -105,15 +107,15 @@ On Fedora, this can be done by calling:
105
107
106
108
``` sh
107
109
sudo dnf install dfu-util
108
- cargo install cargo-binutils
110
+ cargo +1.76.0 install cargo-binutils
109
111
rustup component add llvm-tools-preview
110
112
```
111
113
112
114
Click the RESET button while holding the BOOT button of the Daisy Patch SM to
113
115
enter the bootloader. Then call this make target:
114
116
115
117
``` sh
116
- makers flash-dfu
118
+ cargo +1.76.0 make flash-dfu
117
119
```
118
120
119
121
## Embedded tests
@@ -126,7 +128,7 @@ given in [Flash via ST-Link](#flash-via-st-link).
126
128
To run one of the integration tests kept under ` firmware/tests ` :
127
129
128
130
``` sh
129
- makers test-embedded button
131
+ cargo +1.76.0 make test-embedded button
130
132
```
131
133
132
134
## Embedded benchmark
@@ -140,7 +142,7 @@ Before running a benchmark, first make sure to go through the guidance given in
140
142
To run one of the benchmarks kept under ` benches/src/bin ` :
141
143
142
144
``` sh
143
- makers bench oversampling
145
+ cargo +1.76.0 make bench oversampling
144
146
```
145
147
146
148
## Firmware size
@@ -151,16 +153,16 @@ the firmware size stays slim and no bloat gets in.
151
153
Install needed tooling:
152
154
153
155
``` 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
157
159
```
158
160
159
161
Run the following command often to make sure no unnecessary heavy dependencies
160
162
are brought in:
161
163
162
164
``` sh
163
- makers bloat
165
+ cargo +1.76.0 make bloat
164
166
```
165
167
166
168
## Manual
@@ -176,7 +178,7 @@ sudo dnf install inkscape texlive-latex texlive-ec texlive-microtype texlive-pag
176
178
To build the manual:
177
179
178
180
``` sh
179
- makers manual
181
+ cargo +1.76.0 make manual
180
182
```
181
183
182
184
The built PDF is then available in ` manual/user/manual.pdf ` .
0 commit comments