README: update build instructions

This commit is contained in:
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). 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 Clone this repository and [nix-scripts](https://git.m-labs.hk/M-Labs/nix-scripts).
- install [rustup](https://rustup.rs/)
```shell ```shell
rustup toolchain install nightly nix-shell -I nix-scripts=[path to nix-scripts checkout]
rustup update
rustup target add thumbv7em-none-eabihf --toolchain nightly
rustup default nightly
cargo build --release cargo build --release
``` ```
The resulting ELF file will be located under `target/thumbv7em-none-eabihf/release/thermostat` 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 ## Debugging
Connect SWDIO/SWCLK/RST/GND to a programmer such as ST-Link v2.1. Run OpenOCD: Connect SWDIO/SWCLK/RST/GND to a programmer such as ST-Link v2.1. Run OpenOCD: