diff --git a/docs/src/setup_environment.md b/docs/src/setup_environment.md index cf7977e7..0ca151af 100644 --- a/docs/src/setup_environment.md +++ b/docs/src/setup_environment.md @@ -10,14 +10,30 @@ First you have to install Rust. Installing Rust is easy: checkout [https://rustu ## 3. Choose your hardware -RMK firmware runs on your microcontroller, which is quite different from a normal Rust development environment. So you need to know, which microcontroller you want to use. By using [Embassy](https://github.com/embassy-rs/embassy) as the runtime, RMK supports many microcontrollers, like stm32, nrf52 and rp2040. Choose one of the supported microcontroller makes your journal of RMK much easier. Note that different microcontrollers have different architechtures, you have to know the target of your microcontroller, making sure that you're compiling correct firmware for your hardware. +RMK firmware runs on microcontrollers, by using [Embassy](https://github.com/embassy-rs/embassy) as the runtime, RMK supports many series of microcontrollers, such as stm32, nrf52 and rp2040. Choose one of the supported microcontroller makes your journey of RMK much easier. ## 4. Install your target -The Rust target of your microcontroller should be installed. Use `rustup target add` command to intall it: +The next step is to add Rust's compilation target of your microcontroller. Rust's default installation doesn't include all compilation targets, you have to install them manually. For example, rp2040 is a Cortex-M0+ microcontroller, it's compilation target is `thumbv6m-none-eabi`. Use `rustup target add` command to intall it: ```bash -rustup target add +rustup target add thumbv6m-none-eabi +``` + +For Cortex-M microcontrollers, you can get the compilation target of your microcontroller [here](https://docs.rust-embedded.org/book/intro/install.html). The full list of targets can be found [here](https://doc.rust-lang.org/nightly/rustc/platform-support.html) + +## 5. Add other tools + +There are several other tools are highly recommended: + +- `cargo generate`: needed for creating a RMK firmware project from offcial [project template](https://github.com/HaoboGu/rmk-template) + +- `probe-rs`: used to flash and debug your firmware + +You can use the following commands to install them: + +```bash +cargo install cargo-generate +cargo install probe-rs --features cli ``` -For example, rp2040's is a cortex-M0 microcontroller, so it's target is `thumbv6m-none-eabi`. You have to run `rustup target add thumbv6m-none-eabi` for compiling a firmware for rp2040. \ No newline at end of file