Skip to content

Commit

Permalink
additional explanations (#133)
Browse files Browse the repository at this point in the history
* Added reasons for downloading rust-src and link to a chapter on custom-targets

* Update src/installation/riscv.md

committed the suggestion made by @SergioGasquez

Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>

---------

Co-authored-by: Sergio Gasquez Arcos <sergio.gasquez@gmail.com>
  • Loading branch information
kiarie404 and SergioGasquez authored Dec 21, 2023
1 parent bbbe5ed commit be54b05
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions 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 Down Expand Up @@ -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/

0 comments on commit be54b05

Please sign in to comment.