Skip to content

Commit

Permalink
update to 4df41a5
Browse files Browse the repository at this point in the history
  • Loading branch information
Narukara committed Jan 29, 2024
1 parent a079bbd commit 65bd879
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
这里是 https://github.com/esp-rs/book 的简体中文翻译。[直接在网页中阅读](https://narukara.github.io/rust-on-esp-book-zh-cn/)

目前进度:已经翻译完成(部分更新的内容需要重新翻译),跟踪到 bcc4559
目前进度:已经翻译完成(部分更新的内容需要重新翻译),跟踪到 4df41a5

---

Expand Down
11 changes: 11 additions & 0 deletions src/installation/riscv.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
```shell
rustup toolchain install nightly --component rust-src
```

上面的命令下载了 rust 源码。`rust-src` 包含了 std 库、core 库和构建配置文件等。
下载 `rust-src` 的原因在于:
- **确定性** - 你可以查看 core 和 std 库的内部结构。如果你正在编写需要较高确定性的软件,你可能需要检查正在使用的库。
- **构建自定义目标** - `rustc` 使用 `rust-src` 创建新的自定义目标的组件。如果你的目标是 rust 尚不支持的 triple-target,则必须下载 `rust-src`

关于自定义目标的更多信息,参见 [Embedonomicon][embedonomicon-official-book] 的[此章节][embedonomicon-creating-a-custom-target]。

2. 设置目标:
- 对于 `no_std`(裸机)应用,运行:

Expand Down Expand Up @@ -40,3 +48,6 @@
[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/

16 changes: 9 additions & 7 deletions src/installation/std-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@

不论是哪种目标架构,对于 [`std`][rust-esp-book-overview-std] 应用开发,还需要安装以下工具:

- [`python`][python-website-download]:ESP-IDF 的要求
- [`git`][git-website-download]:ESP-IDF 的要求
- ESP-IDF 依赖项:
- Windows:[`python`][python-website-download][`git`][git-website-download]
- Linux:查看 [Linux ESP-IDF prerequisites][esp-idf-linux]
- macOS:查看 [macOS ESP-IDF prerequisites][esp-idf-macos]
- [`ldproxy`][embuild-github-ldproxy] 二进制项 crate:一个将链接参数转发给实际链接器的工具,实际链接器本身也是通过参数指定的。执行以下命令来安装:
```shell
cargo install ldproxy
```

`std` 运行时将 [ESP-IDF][esp-idf-github](Espressif IoT Development Framework)作为宿主环境,不过用户不需要安装它。[esp-idf-sys][esp-idf-sys-github] 会自动下载安装 ESP-IDF,这是一个所有 `std` 项目都需要使用的 crate。

对于 Linux/MacOS 用户,需要安装 [ESP-IDF 依赖项][esp-idf-install-guide]。
> ⚠️ **注意**`std` 运行时将 [ESP-IDF][esp-idf-github](Espressif IoT Development Framework)作为宿主环境,不过用户不需要安装它。[esp-idf-sys][esp-idf-sys-github] 会自动下载安装 ESP-IDF,这是一个所有 `std` 项目都需要使用的 crate。

[rust-esp-book-overview-std]: ../overview/using-the-standard-library.md
[python-website-download]: https://www.python.org/downloads/
[python-website-download]: https://www.python.org/downloads/windows/
[git-website-download]: https://git-scm.com/downloads
[embuild-github-ldproxy]: https://github.com/esp-rs/embuild/tree/master/ldproxy
[esp-idf-sys-github]: https://github.com/esp-rs/esp-idf-sys
[esp-idf-github]: https://github.com/espressif/esp-idf
[esp-idf-install-guide]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html#step-1-install-prerequisites
[esp-idf-linux]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html#for-linux-users
[esp-idf-macos]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/linux-macos-setup.html#for-macos-users

5 changes: 3 additions & 2 deletions src/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,14 @@ Rust 对这些设备的支持仍在不断改进中,并且进展迅速。因此
| [The Rust Programming Language][rust-book] | 如果你不熟悉 Rust,我们建议你先阅读这本书。 |
| [The Embedded Rust Book][embedded-rust-book] | 这里包含由 Rust 嵌入式工作组提供的其他资源。 |
| [The Embedonomicon][embedonomicon] | 在使用 Rust 进行嵌入式编程时的细节。 |
| [Embedded Rust on Espressif][std-training] |[Ferrous Systems][ferrous-systems] 合作编写的培训材料。 |
| [Embedded Rust (std) on Espressif][std-training] | 在乐鑫 SoC 上使用 `std` 的入门指南 |
| [Embedded Rust (no_std) on Espressif][no_std-training] | 在乐鑫 SoC 上使用 `no_std` 的入门指南 |

[rust-book]: https://doc.rust-lang.org/book/
[embedded-rust-book]: https://docs.rust-embedded.org/book/index.html
[embedonomicon]: https://docs.rust-embedded.org/embedonomicon/
[std-training]: https://esp-rs.github.io/std-training/
[ferrous-systems]: https://ferrous-systems.com/
[no_std-training]: https://esp-rs.github.io/no_std-training/

## 翻译

Expand Down
2 changes: 1 addition & 1 deletion src/overview/using-the-core-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
| ESP32-C2 |||||
| ESP32-C3 |||||
| ESP32-C6 |||||
| ESP32-H2 |||||
| ESP32-S2 |||||
| ESP32-S3 |||||
| ESP32-H2 |||||

> ⚠️ **注意**:
>
Expand Down
8 changes: 4 additions & 4 deletions src/tooling/debugging/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
| **ESP32-C3** |||
| **ESP32-C6** |||
| **ESP32-H2** |||
| **ESP32-S2** | ||
| **ESP32-S3** | ||
| **ESP32-S2** | ||
| **ESP32-S3** | ||

## `USB-JTAG-SERIAL` Peripheral

Some of our recent products contain the `USB-JTAG-SERIAL` peripheral that allows for debugging without any external hardware debugger. More info on configuring the interface can be found in the official documentation for the chips that support this peripheral:
- [ESP32-C3][esp32c3-docs]
- 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.
- 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.
- Revisions older than 0.3 **don't** have a built-in JTAG interface.
- Revisions 0.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:
```shell
Expand Down
14 changes: 7 additions & 7 deletions src/tooling/debugging/probe-rs.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ Espressif products containing the [`USB-JTAG-SERIAL` peripheral][usb-jtag-serial

## Flashing with `probe-rs`

`probe-rs` can be used to flash applications to your target since it supports the [ESP-IDF image format][idf-image] via the `--format idf` argument.
- Example command for flashing an ESP32-C3: `probe-rs run --chip esp32c3 --format idf`
`probe-rs` can be used to flash applications to your target since it supports the [ESP-IDF image format][idf-image].
- Example command for flashing an ESP32-C3: `probe-rs run --chip esp32c3`

The flashing command can be set as a custom Cargo runner by adding the following to your project's `.cargo/config.toml` file:

```toml
[target.'cfg(any(target_arch = "riscv32", target_arch = "xtensa"))']
runner = "probe-rs run --chip esp32c3 --format idf"
runner = "probe-rs run --chip esp32c3"
```

With this configuration, you can flash and monitor your application using `cargo run`.
Expand Down Expand Up @@ -67,11 +67,11 @@ There is a `probe-rs` extension in VS Code, see `probe-rs` [VS Code documentatio
"coreConfigs": [
{
"coreIndex": 0,
"programBinary": "./target/riscv32imc-unknown-none-elf/debug/${workspaceFolderBasename}", //!MODIFY
"programBinary": "target/riscv32imc-unknown-none-elf/debug/${workspaceFolderBasename}", //!MODIFY
"rttEnabled": true,
"rttChannelFormats": [
{
"channelNumber": "0",
"channelNumber": 0,
"dataFormat": "String",
"showTimestamp": true,
}
Expand All @@ -88,11 +88,11 @@ There is a `probe-rs` extension in VS Code, see `probe-rs` [VS Code documentatio
"coreConfigs": [
{
"coreIndex": 0,
"programBinary": "./target/riscv32imc-unknown-none-elf/debug/${workspaceFolderBasename}", //!MODIFY
"programBinary": "target/riscv32imc-unknown-none-elf/debug/${workspaceFolderBasename}", //!MODIFY
"rttEnabled": true,
"rttChannelFormats": [
{
"channelNumber": "0",
"channelNumber": 0,
"dataFormat": "String",
"showTimestamp": true,
}
Expand Down

0 comments on commit 65bd879

Please sign in to comment.