-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from Song-aff/feature/translate_tooling
feat: 翻译工具部分
- Loading branch information
Showing
10 changed files
with
154 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Debugging | ||
# 调试 | ||
|
||
Debugging Rust applications is also possible using different tools that will be covered in this chapter. | ||
在本章中,我们将介绍使用不同工具进行调试 Rust 应用程序的方法。 | ||
|
||
Refer to the table below to see which chip is supported in every debugging method: | ||
请参考下表,了解每种调试方法支持的芯片: | ||
|
||
| | **probe-rs** | **OpenOCD** | **VS Code** | | ||
| :----------: | :----------: | :---------: | :---------: | | ||
| **ESP32** | ❌ | ✅ | ✅ | | ||
| **ESP32-C2** | ✅ | ✅ | ✅ | | ||
| **ESP32-C3** | ✅ | ✅ | ✅ | | ||
| **ESP32-C6** | ✅ | ✅ | ✅ | | ||
| **ESP32-H2** | ✅ | ✅ | ✅ | | ||
| **ESP32-S2** | ❌ | ✅ | ✅ | | ||
| **ESP32-S3** | ❌ | ✅ | ✅ | | ||
| **ESP32** | ❌ | ✅ | ✅ | | ||
| **ESP32-C2** | ✅ | ✅ | ✅ | | ||
| **ESP32-C3** | ✅ | ✅ | ✅ | | ||
| **ESP32-C6** | ✅ | ✅ | ✅ | | ||
| **ESP32-H2** | ✅ | ✅ | ✅ | | ||
| **ESP32-S2** | ❌ | ✅ | ✅ | | ||
| **ESP32-S3** | ❌ | ✅ | ✅ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,58 @@ | ||
# `espflash` | ||
|
||
`espflash` is a serial flasher utility, based on [esptool.py][esptool], for Espressif SoCs and modules. | ||
`espflash`是一个基于[esptool.py][esptool]的 Espressif SoC 和模块的串口下载工具。 | ||
|
||
The [`espflash`][espflash] repository contains two crates, `cargo-espflash` and `espflash`. For more information on these crates, see the respective sections below. | ||
[`espflash`][espflash]仓库包含两个 crate,`cargo-espflash`和`espflash`。有关这些 crate 的更多信息,请参见下面的各自部分。 | ||
|
||
[esptool]: https://github.com/espressif/esptool | ||
[espflash]: https://github.com/esp-rs/espflash | ||
|
||
> ⚠️ **Note**: The `espflash` and `cargo-espflash` commands shown below, assume that version `2.0` or greater is used. | ||
> ⚠️ **注意**: 下面显示的`espflash`和`cargo-espflash`命令,假定使用版本`2.0`或更高版本。 | ||
## `cargo-espflash` | ||
|
||
Provides a subcommand for `cargo` that handles cross-compilation and flashing. | ||
为`cargo`提供一个子命令,处理交叉编译和下载。 | ||
|
||
To install, run: | ||
要安装,请运行: | ||
|
||
```shell | ||
cargo install cargo-espflash | ||
``` | ||
|
||
This command must be run within a Cargo project, ie. a directory containing a `Cargo.toml` file. For example, to build an example named 'blinky', flash the resulting binary to a device, and then subsequently start a serial monitor: | ||
此命令必须在 Cargo 项目中运行,即包含`Cargo.toml`文件的目录。例如,要构建名为“blinky”的示例,将生成的二进制文件下载到设备中,然后随后启动串行监视器: | ||
|
||
```shell | ||
cargo espflash flash --example=blinky --monitor | ||
``` | ||
|
||
For more information, please see the [`cargo-espflash`][cargo-espflash] README. | ||
有关更多信息,请参见[`cargo-espflash`][cargo-espflash] README。 | ||
|
||
[cargo-espflash]: https://github.com/esp-rs/espflash/blob/master/cargo-espflash/README.md | ||
|
||
## `espflash` | ||
|
||
Provides a standalone command-line application that flashes an ELF file to a device. | ||
提供一个独立的命令行应用程序,将 ELF 文件下载到设备中。 | ||
|
||
To install, run: | ||
要安装,请运行: | ||
|
||
```shell | ||
cargo install espflash | ||
``` | ||
|
||
Assuming you have built an ELF binary by other means already, `espflash` can be used to download it to your device and monitor the serial port. For example, if you have built the `getting-started/blinky` example from [ESP-IDF][esp-idf] using `idf.py`, you might run something like: | ||
假设你已经通过其他方式构建了 ELF 二进制文件,`espflash`可以用于将其下载到设备并监视串行端口。例如,如果你已经使用`idf.py`从[ESP-IDF][esp-idf]构建了名为“getting-started/blinky”的示例,可以运行类似以下的命令: | ||
|
||
```shell | ||
espflash flash build/blinky --monitor | ||
``` | ||
|
||
For more information, please see the [`espflash` README][espflash-readme]. | ||
有关更多信息,请参见[`espflash` README][espflash-readme]。 | ||
|
||
`espflash` can be used as a Cargo runner by adding the following to your project's `.cargo/config.toml` file: | ||
`espflash`可以通过在你的项目的`.cargo/config.toml`文件中添加以下内容,作为 Cargo runner 来使用: | ||
```toml | ||
[target.'cfg(any(target_arch = "riscv32", target_arch = "xtensa"))'] | ||
runner = "espflash flash --monitor" | ||
``` | ||
With this configuration, you can flash and monitor your application using `cargo run`. | ||
使用此配置,可以通过`cargo run`下载和监控应用程序。 | ||
|
||
[esp-idf]: https://github.com/espressif/esp-idf | ||
[espflash-readme]: https://github.com/esp-rs/espflash/blob/master/espflash/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
# Tooling | ||
# 工具 | ||
|
||
Now that we have our required dependencies installed, and we know how to generate a | ||
template project, we will cover, in more detail, some tools. These tools will make | ||
developing Rust applications for Espressif chips a lot easier. | ||
现在我们已经安装了所需的依赖项,并知道如何生成模板项目,我们将更详细地介绍一些工具。这些工具将使为 Espressif 芯片开发 Rust 应用程序变得更加容易。 | ||
|
||
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. | ||
在本章中,我们将介绍`espflash`/`cargo-espflash`,建议使用 Visual Studio Code 作为 IDE,并深入探讨当前可用的仿真和调试方法。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
# Simulating | ||
# 仿真 | ||
|
||
Simulating projects can be handy. It allows users to test projects using CI, try projects without having hardware available, and many other scenarios. | ||
仿真可能很方便。它允许用户使用 CI(持续集成)来测试项目、在没有可用硬件的情况下尝试项目,还有许多其他使用场景。 | ||
|
||
At the moment, there are a few ways of simulating Rust projects on Espressif chips. Every way has some limitations, but it's quickly evolving and getting better every day. | ||
目前,有多种方法可以在 Espressif 芯片上仿真 Rust 项目。每种方法都有一些限制,但它们正在迅速发展,并且每天都在变得更好。 | ||
|
||
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: | ||
请参考下表,以了解每种仿真方法支持哪种芯片: | ||
|
||
| | **[Wokwi][wokwi]** | **QEMU** | | ||
| :----------: | :----------------: | :------: | | ||
| **ESP32** | ✅ | ✅ | | ||
| **ESP32-C2** | ❌ | ❌ | | ||
| **ESP32-C3** | ✅ | ❌ | | ||
| **ESP32-C6** | ✅ | ❌ | | ||
| **ESP32-H2** | ✅ | ❌ | | ||
| **ESP32-S2** | ✅ | ❌ | | ||
| **ESP32-S3** | ✅ | ❌ | | ||
| **ESP32** | ✅ | ✅ | | ||
| **ESP32-C2** | ❌ | ❌ | | ||
| **ESP32-C3** | ✅ | ❌ | | ||
| **ESP32-C6** | ✅ | ❌ | | ||
| **ESP32-H2** | ✅ | ❌ | | ||
| **ESP32-S2** | ✅ | ❌ | | ||
| **ESP32-S3** | ✅ | ❌ | | ||
|
||
[wokwi]: https://docs.wokwi.com/guides/esp32#simulation-features |
Oops, something went wrong.