README: update build instructions

pull/64/head
Sebastien Bourdeauducq 2022-01-05 08:04:25 +08:00
parent 85e8273d51
commit 09082b24a5
1 changed files with 5 additions and 7 deletions

View File

@ -10,21 +10,19 @@
See the `mcu` folder of the [nix-scripts repository](https://git.m-labs.hk/M-Labs/nix-scripts).
### Debian-based systems (tested on Ubuntu 19.10)
### Development environment
- install git, clone this repository
- install [rustup](https://rustup.rs/)
Clone this repository and [nix-scripts](https://git.m-labs.hk/M-Labs/nix-scripts).
```shell
rustup toolchain install nightly
rustup update
rustup target add thumbv7em-none-eabihf --toolchain nightly
rustup default nightly
nix-shell -I nix-scripts=[path to nix-scripts checkout]
cargo build --release
```
The resulting ELF file will be located under `target/thumbv7em-none-eabihf/release/thermostat`
Alternatively, you can install the Rust toolchain without Nix using rustup; see the channel manifest file in nix-scripts (`channel-rust-nightly.toml`) to determine which Rust version to use.
## Debugging
Connect SWDIO/SWCLK/RST/GND to a programmer such as ST-Link v2.1. Run OpenOCD: