Skip to content

Commit

Permalink
docs: update doc
Browse files Browse the repository at this point in the history
Signed-off-by: Haobo Gu <[email protected]>
  • Loading branch information
HaoboGu committed Feb 7, 2024
1 parent efc0b11 commit aa48176
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions docs/src/setup_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <target>
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.

0 comments on commit aa48176

Please sign in to comment.