Skip to content

Commit

Permalink
Grammarly suggestions (esp-rs#112)
Browse files Browse the repository at this point in the history
* docs: Grammarly fixes/suggestions

* docs: Apply review suggestions
  • Loading branch information
SergioGasquez authored Aug 2, 2023
1 parent 838ed9a commit f3dbe1a
Show file tree
Hide file tree
Showing 16 changed files with 37 additions and 37 deletions.
8 changes: 4 additions & 4 deletions src/installation/riscv-and-xtensa.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You can also directly download pre-compiled [release binaries] or use [cargo-bin
[release binaries]: https://github.com/esp-rs/espup/releases
[cargo-binstall]: https://github.com/cargo-bins/cargo-binstall

### 2. Install neccesary toolchains
### 2. Install necessary toolchains

Install all the necessary tools to develop Rust applications for all supported Espressif targets by running:
```shell
Expand All @@ -32,7 +32,7 @@ espup install
On Windows (`%USERPROFILE%\export-esp.ps1`)
- There is **no need** to execute the file for Windows users. It is only created to show the modified environment variables.

On Unix based systems (`$HOME/export-esp.sh`). There are different ways of sourcing the file:
On Unix-based systems (`$HOME/export-esp.sh`). There are different ways of sourcing the file:
- Source this file in every terminal:
1. Source the export file: `. $HOME/export-esp.sh`

Expand All @@ -42,8 +42,8 @@ On Unix based systems (`$HOME/export-esp.sh`). There are different ways of sourc
2. Refresh the configuration by restarting the terminal session or by running `source [path to profile]`, for example, `source ~/.bashrc`.

This approach requires running the alias in every new shell.
- Add the environment variables to your shell's profile directly:
1. Add the content of `$HOME/export-esp.sh` to your shell ’s profile: `cat $HOME/export-esp.sh >> [path to profile]`, for example, `cat $HOME/export-esp.sh >> ~/.bashrc`.
- Add the environment variables to your shell profile directly:
1. Add the content of `$HOME/export-esp.sh` to your shell’s profile: `cat $HOME/export-esp.sh >> [path to profile]`, for example, `cat $HOME/export-esp.sh >> ~/.bashrc`.
2. Refresh the configuration by restarting the terminal session or by running `source [path to profile]`, for example, `source ~/.bashrc`.

This approach **does not** require any sourcing. The `export-esp.sh` script will be sourced automatically in every shell.
Expand Down
2 changes: 1 addition & 1 deletion src/installation/riscv.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ To build Rust applications for the Espressif chips based on `RISC-V` architectur
- Other [`std` development requirements][rust-esp-book-std-requirements]
- In your project's file `.cargo/config.toml`, add the unstable Cargo [feature][cargo-book-unstable-features] `-Z build-std`. Our [template projects][rust-esp-book-write-app-generate-project] that are discussed later in this book already include this.
Now you should be able to build and run projects on the Espressif's `RISC-V` chips.
Now you should be able to build and run projects on Espressif's `RISC-V` chips.

[rustup-book-channel-nightly]: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
[rustup-book-components]: https://rust-lang.github.io/rustup/concepts/components.html
Expand Down
2 changes: 1 addition & 1 deletion src/installation/rust.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Rust instalaltion
# Rust installation

Make sure you have [Rust][rust-lang-org] installed. If not, see the instructions on the [rustup][rustup.rs-website] website.

Expand Down
4 changes: 2 additions & 2 deletions src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ For tools and libraries relating to Rust on ESP, please see the [esp-rs organiza

## Who This Book is For

This book is intended for people with some experience with Rust, and also assumes rudimentary knowledge of embedded development and electronics. For those without prior experience, we recommend first reading the [Assumptions and Prerequisites][prerequisites] and [Resources][resources] sections to get up to speed.
This book is intended for people with some experience in Rust and also assumes rudimentary knowledge of embedded development and electronics. For those without prior experience, we recommend first reading the [Assumptions and Prerequisites][prerequisites] and [Resources][resources] sections to get up to speed.

[prerequisites]: #assumptions-and-prerequisites
[resources]: #resources

### Assumptions and Prerequisites

- You are comfortable using the Rust Programming Language, and have written and run applications in a desktop environment.
- You are comfortable using the Rust programming language and have written and run applications in a desktop environment.
- You should be familiar with the idioms of the [2021 edition][rust-2021], as this book targets Rust 2021.
- You are comfortable developing embedded systems in another language such as C or C++, and are familiar with concepts such as:
- Cross-compilation
Expand Down
4 changes: 2 additions & 2 deletions src/overview/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Both approaches have their advantages and disadvantages, so you should make a de

See also the comparison of the different runtimes in [The Embedded Rust Book][embedded-rust-book-intro-std].

The [esp-rs organization] on GitHub is home to a number of repositories related to running Rust on Espressif chips. Most of the required crates have their source code hosted here.
The [esp-rs organization] on GitHub is home to several repositories related to running Rust on Espressif chips. Most of the required crates have their source code hosted here.

[rust-esp-book-std]: ./using-the-standard-library.md
[rust-esp-book-no-std]: ./using-the-core-library.md
Expand All @@ -21,7 +21,7 @@ The [esp-rs organization] on GitHub is home to a number of repositories related

## Repository naming convention

In the [esp-rs organization] we use the following wording:
In the [esp-rs organization], we use the following wording:
- Repositories starting with `esp-` are focused on `no_std` approach. For example, `esp-hal`
- `no_std` works on top of bare metal, so `esp-` is an Espressif chip
- Repositories starting with `esp-idf-` are focused on `std` approach. For example, `esp-idf-hal`
Expand Down
2 changes: 1 addition & 1 deletion src/overview/using-the-standard-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ graph TD;

### When you might want to use the Standard Library (`std`)

- Rich functionality: If your embedded system requires lots of functionality like support for networking protocols, file I/O, or complex data structures, you will likely want to use hosted-environment approach because std libraries provide a wide range of functionality that can be used to build complex applications relatively quickly and efficiently
- Rich functionality: If your embedded system requires lots of functionality like support for networking protocols, file I/O, or complex data structures, you will likely want to use hosted-environment approach because `std` libraries provide a wide range of functionality that can be used to build complex applications relatively quickly and efficiently
- Portability: The `std` crate provides a standardized set of APIs that can be used across different platforms and architectures, making it easier to write code that is portable and reusable.
- Rapid development: The `std` crate provides a rich set of functionality that can be used to build applications quickly and efficiently, without worrying, too much, about low-level details.

Expand Down
6 changes: 3 additions & 3 deletions src/tooling/debugging/vscode.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ There is also a possibility to debug with graphical output directly in Visual St
2. Set up VSCode
1. Install [Cortex-Debug][cortex-debug] extension for VScode.
2. Create the `.vscode/launch.json` file in the project tree you want to debug.
3. Update `executable`, `svdFile`, `serverpath` paths, and `toolchainPrefix` field.
3. Update `executable`, `svdFile`, `serverpath` paths, and `toolchainPrefix` fields.

```json
{
Expand Down Expand Up @@ -64,7 +64,7 @@ There is also a possibility to debug with graphical output directly in Visual St
The availability of built-in JTAG interface depends on the ESP32-C3 revision:

- Revisions older than 3 **don't** a have built-in JTAG interface.
- Revitions 3 (and newer) **do** have a built-in JTAG interface, and you don't have to connect an external device to be able to debug.
- Revisions 3 (and newer) **do** have a built-in JTAG interface, and you don't have to connect an external device to be able to debug.

To find your ESP32-C3 revision, run:

Expand Down Expand Up @@ -92,7 +92,7 @@ espflash board-info
2. Set up VSCode
1. Install [Cortex-Debug][cortex-debug] extension for VScode.
2. Create the `.vscode/launch.json` file in the project tree you want to debug.
3. Update `executable`, `svdFile`, `serverpath` paths, and `toolchainPrefix` field.
3. Update `executable`, `svdFile`, `serverpath` paths, and `toolchainPrefix` fields.
```json
{
// Use IntelliSense to learn about possible attributes.
Expand Down
4 changes: 2 additions & 2 deletions src/tooling/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Now that we have our required dependencies installed, and we know how to generat
template project, we will cover, in more detail, some of the tools that will make
developing Rust applications for ESP targets a lot easier.

In this chapter, we will present `espflash`/`cargo-espflash`, suggest Visual Studio Code as IDE and dig into the
current available simulation and debbuging methods.
In this chapter, we will present `espflash`/`cargo-espflash`, suggest Visual Studio Code as IDE and, dig into the
currently available simulation and debugging methods.
2 changes: 1 addition & 1 deletion src/tooling/simulating/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Simulating projects can be very handy. It allows users to test projects using CI

At the moment, there are a few ways of simulating Rust projects on Espressif chips, all of them have some limitations, but it's quickly evolving and getting better every day.

In this chapter, we will discuss the different simulation tools that are available.
In this chapter, we will discuss currently available simulation tools.

Refer to the table below to see which chip is supported in every simulating method:

Expand Down
2 changes: 1 addition & 1 deletion src/tooling/simulating/wokwi.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ to build a project on your machine, or in a container, and simulate the resultin
## Custom chips
Wokwi allows generating custom chips that let you program the behavior of a component not supported in Wokwi. For more details, see the official [Wokwi documentation][wokwi-custom-chip].

Custom chips can also be written in Rust! See [Wokwi Custom Chip API][rust-chip-api] for more information. E.g: custom [inverter chip][custom-chip-example] written in Rust.
Custom chips can also be written in Rust! See [Wokwi Custom Chip API][rust-chip-api] for more information. For example, custom [inverter chip][custom-chip-example] in Rust.

[wokwi-custom-chip]: https://docs.wokwi.com/chips-api/getting-started
[rust-chip-api]: https://github.com/wokwi/wokwi_chip_ll
Expand Down
4 changes: 2 additions & 2 deletions src/tooling/visual-studio-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ One of the more common development environments is Microsoft's [Visual Studio Co

Visual Studio Code is an open-source and cross-platform graphical text editor with a rich ecosystem of extensions. The [Rust Analyzer extension][rust-analyzer-extension] provides an implementation of the [Language Server Protocol][language-server-protocol] for Rust and additionally includes features like autocompletion, go-to definition, and more.

Visual Studio Code can be installed via most popular package managers, and installers are available on the official website. The [Rust Analyzer extension][rust-analyzer-extension] can be installed in Visual Studio Code via the built-in extension manager.
Visual Studio Code can be installed via the most popular package managers, and installers are available on the official website. The [Rust Analyzer extension][rust-analyzer-extension] can be installed in Visual Studio Code via the built-in extension manager.

Alongside Rust Analyzer there are other extensions that might be very helpful:

Expand Down Expand Up @@ -43,7 +43,7 @@ targets = ["xtensa-esp32-none-elf"]

## Other IDEs

Eventhough we have only covered VS Code because it has good support for Rust and is very popular, there are other IDEs like [CLion][clion] or [vim][vim] that also have pretty good support for Rust, but we won't be covering them here.
Even though we have only covered VS Code because it has good support for Rust and is very popular, there are other IDEs like [CLion][clion] or [vim][vim] that also have pretty good support for Rust, but we won't be covering them here.

[cLion]: https://www.jetbrains.com/clion/
[vim]: https://www.vim.org/
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ When creating a project from [esp-idf-template][esp-idf-template] with the follo
- Which MCU to target? · `esp32c3`
- Configure advanced template options? · `false`

For this explanation we will use the default values, if you want further modifications, see the [additional prompts][prompts] when not using default values.
For this explanation, we will use the default values, if you want further modifications, see the [additional prompts][prompts] when not using default values.

It should generate a file structure like this:

Expand Down Expand Up @@ -75,7 +75,7 @@ Before going further, let's see what these files are for.
8 }
```

The first line is an import that defines the esp-idf entry-point when the root crate is a binary crate that defines a main function.
The first line is an import that defines the esp-idf entry point when the root crate is a binary crate that defines a main function.

Then, we have a usual main function with a few lines on it:
- A call to `esp_idf_sys::link_patches` function that makes sure that a few patches to the ESP-IDF which are implemented in Rust are linked to the final executable.
Expand All @@ -91,7 +91,7 @@ cargo run

This builds the code according to the configuration and executes [`espflash`][espflash] to flash the code to the board.

Since our [`runner` configuration][runner-config] also passes the `--monitor` argument to [`espflash`][espflash] we can see what the code is printing.
Since our [`runner` configuration][runner-config] also passes the `--monitor` argument to [`espflash`][espflash], we can see what the code is printing.

> Make sure that you have [`espflash`][espflash] installed, otherwise this step will fail. To install [`espflash`][espflash] :
> `cargo install espflash`
Expand Down Expand Up @@ -121,11 +121,11 @@ I (344) cpu_start: Starting scheduler.
Hello, world!
```

As you can see, there are messages from the first and second stage bootloader and then, our "Hello, world!" is printed.
As you can see, there are messages from the first and second-stage bootloader and then, our "Hello, world!" is printed.

You can reboot with `CTRL+R` or exit with `CTRL+C`.

If you encoutner any issues while building the project, please, see the [Troubleshooting][troubleshooting] chapter.
If you encounter any issues while building the project, please, see the [Troubleshooting][troubleshooting] chapter.

[espflash]: https://github.com/esp-rs/espflash/tree/main/espflash
[runner-config]: https://doc.rust-lang.org/cargo/reference/config.html#targettriplerunner
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Understanding esp-template

Now that we know how to [generate a no_std project][generate-no-std], let's inspect what the generated
project contains, try to understand every part and run it.
project contains, try to understand every part of it, and run it.

[generate-no-std]: ./index.md

Expand All @@ -11,7 +11,7 @@ When creating a project from [esp-template][esp-template] with the following ans
- Which MCU to target? · `esp32c3`
- Configure advanced template options? · `false`

For this explanation we will use the default values, if you want further modifications, see the [additional prompts][prompts] when not using default values.
For this explanation, we will use the default values, if you want further modifications, see the [additional prompts][prompts] when not using default values.

It should generate a file structure like this:

Expand Down Expand Up @@ -42,7 +42,7 @@ Before going further, let's see what these files are for.
- The usual Cargo manifest declaring some meta-data and dependencies of the project
- LICENSE-APACHE, LICENSE_MIT
- Those are the most common licenses used in the Rust ecosystem
- If you want to apply a different license, you can delete these files and change the license in `Cargo.toml`
- If you want to use a different license, you can delete these files and change the license in `Cargo.toml`
- [rust-toolchain.toml][rust-toolchain-toml]
- Defines which Rust toolchain to use
- The toolchain will be `nightly` or `esp` depending on your target.
Expand Down Expand Up @@ -73,7 +73,7 @@ Before going further, let's see what these files are for.
6 use hal::{clock::ClockControl, peripherals::Peripherals, prelude::*, timer::TimerGroup, Rtc};
```
- `use esp_backtrace as _;`
- Since we are in a bare-metal environment, we need a panic-handler that runs if a panic occurs in code
- Since we are in a bare-metal environment, we need a panic handler that runs if a panic occurs in code
- There are a few different crates you can use (e.g `panic-halt`) but `esp-backtrace` provides an implementation that prints the address of a backtrace - together with `espflash`/`espmonitor` these addresses can get decoded into source code locations
- `use esp_println::println;`
- Provides `println!` implementation
Expand Down Expand Up @@ -142,7 +142,7 @@ cargo run

This builds the code according to the configuration and executes [`espflash`][espflash] to flash the code to the board.

Since our [`runner` configuration][runner-config] also passes the `--monitor` argument to [`espflash`][espflash] we can see what the code is printing.
Since our [`runner` configuration][runner-config] also passes the `--monitor` argument to [`espflash`][espflash], we can see what the code is printing.

> Make sure that you have [`espflash`][espflash] installed, otherwise this step will fail. To install [`espflash`][espflash]:
> `cargo install espflash`
Expand Down Expand Up @@ -178,7 +178,7 @@ And that is exactly what the code is doing.

You can reboot with `CTRL+R` or exit with `CTRL+C`.

If you encoutner any issues while building the project, please, see the [Troubleshooting][troubleshooting] chapter.
If you encounter any issues while building the project, please, see the [Troubleshooting][troubleshooting] chapter.

[espflash]: https://github.com/esp-rs/espflash/tree/main/espflash
[runner-config]: https://doc.rust-lang.org/cargo/reference/config.html#targettriplerunner
Expand Down
Loading

0 comments on commit f3dbe1a

Please sign in to comment.