Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

additional explanations #133

Merged
merged 2 commits into from
Dec 21, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/installation/riscv.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ To build Rust applications for the Espressif chips based on `RISC-V` architectur
```shell
rustup toolchain install nightly --component rust-src
```

The above command downloads the rust source code. `rust-src` contains things like the std-lib, core-lib and build-config files.
Downloading the `rust-src` is important because of two reasons :
- **Determinism** - You get the chance to inspect the internals of the core and std library. If you are building software that needs to be determinate, you may need to inspect the libraries that you are using.
- **Building custom targets** - The `rustc` uses the `rust-src` to create the components of a new custom-target. If you are targeting a triple-target that is not yet supported by rust, it becomes essential to download the `rust-src`.

For more info on custom targets, read this [Chapter][embedonomicon-creating-a-custom-target] from the [Embedonomicon][embedonomicon-official-book].

2. Set the target:
- For `no_std` (bare-metal) applications, run:

Expand All @@ -15,7 +23,7 @@ To build Rust applications for the Espressif chips based on `RISC-V` architectur
rustup target add riscv32imac-unknown-none-elf # For ESP32-C6 and ESP32-H2
```

This target is currently [Tier 2][rust-lang-book--platform-support-tier2]. Note the different flavors of `riscv32` target in Rust covering different [`RISC-V` extensions][wiki-riscv-standard-extensions].
This target is currently [Tier 2][rust-lang-book--platform-support-tier2]. Note the different flavors of `riscv32` target in Rust covering different [`RISC-V` extensions][wiki-riscv-standard-extensions].
kiarie404 marked this conversation as resolved.
Show resolved Hide resolved

- For `std` applications:

Expand All @@ -40,3 +48,5 @@ Now you should be able to build and run projects on Espressif's `RISC-V` chips.
[cargo-book-unstable-features]: https://doc.rust-lang.org/cargo/reference/unstable.html
[rust-esp-book-write-app-generate-project]: ../writing-your-own-application/generate-project/index.md
[rust-esp-book-std-requirements]: ./std-requirements.md
[embedonomicon-creating-a-custom-target]: https://docs.rust-embedded.org/embedonomicon/custom-target.html
[embedonomicon-official-book]: https://docs.rust-embedded.org/embedonomicon/