Skip to content

Commit 81dbdac

Browse files
committed
Update.
1 parent 9d30b10 commit 81dbdac

File tree

9 files changed

+156
-7
lines changed

9 files changed

+156
-7
lines changed

docs/env_setup/ch32.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
id: env-setup-ch32
3+
title: CH32环境配置
4+
sidebar_position: 2
5+
---
6+
7+
# CH32 环境配置
8+
9+
CH32的RISC-V工具链极其混乱,推荐使用的有如下两种:
10+
11+
* [官方MRS自带的riscv-wch-elf](http://www.mounriver.com/download): 支持WCH的rv32imafcxw拓展指令集,但是对C++标准实现有残缺,无法使用Eigen等C++库
12+
* [上游riscv32-unknown-elf](https://github.com/riscv-collab/riscv-gnu-toolchain):不支持WCH的拓展指令集,但是对C++标准实现完整,需要自行编译,且目前不支持Windows
13+
14+
快速编译可以使用本项目提供的Docker镜像。
15+
16+
## CMake配置
17+
18+
需要多配置一个选项:`LIBXR_CH32_CONFIG_FILE`,指定CH32外设库的配置文件路径,例如:`ch32v30x_conf.h`
19+
20+
```cmake
21+
set(LIBXR_SYSTEM FreeRTOS)
22+
set(LIBXR_DRIVER ch)
23+
24+
set(LIBXR_CH32_CONFIG_FILE "ch32v30x_conf.h")
25+
26+
add_subdirectory(libxr)
27+
28+
...
29+
```
30+
31+
## 示例工程
32+
33+
[CH32V307+FreeRTOS+TinyUSB](https://github.com/Jiu-xiao/CH32V307_LibXR_Template)

docs/env_setup/docker.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
---
22
id: env-setup-docker
33
title: Docker 环境配置
4-
sidebar_position: 2
4+
sidebar_position: 5
55
---
66

77
此界面介绍了如何使用[此仓库](https://github.com/xrobot-org/Docker-Image)中发布的Docker镜像。
88

99
提供的Docker镜像总共有五种:
1010

11-
* docker-image: 包含对所有已经支持平台的环境配置
1211
* docker-image-stm32: 针对STM32的docker镜像
1312
* docker-image-esp32: 针对ESP32的docker镜像
13+
* docker-image-ch32-riscv: 针对CH32 RISC-V系列的docker镜像
1414
* docker-image-linux: 针对Linux的docker镜像
1515
* docker-image-webots: 针对Webots仿真的docker镜像
1616

1717
## ghcr.io
1818

1919
github的容器仓库,推荐在github actions中使用
2020

21-
* docker-image: `docker pull ghcr.io/xrobot-org/docker-image:main`
2221
* docker-image-stm32: `docker pull ghcr.io/xrobot-org/docker-image-stm32:main`
2322
* docker-image-esp32: `docker pull ghcr.io/xrobot-org/docker-image-esp32:main`
23+
* docker-image-ch32-riscv: `docker pull ghcr.io/xrobot-org/docker-image-ch32-riscv:main`
2424
* docker-image-linux: `docker pull ghcr.io/xrobot-org/docker-image-linux:main`
2525
* docker-image-webots: `docker pull ghcr.io/xrobot-org/docker-image-webots:main`
2626

2727
## Docker Hub
2828

2929
docker hub的镜像,推荐在本地使用
3030

31-
* docker-image: `docker pull xrimage/xrimage`
3231
* docker-image-stm32: `docker pull xrimage/xrimage-stm32`
3332
* docker-image-esp32: `docker pull xrimage/xrimage-esp32`
33+
* docker-image-ch32-riscv: `docker pull xrimage/xrimage-ch32-riscv`
3434
* docker-image-linux: `docker pull xrimage/xrimage-linux`
3535
* docker-image-webots: `docker pull xrimage/xrimage-webots`
3636

docs/env_setup/esp32.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
id: env-setup-esp32
3+
title: ESP32环境配置
4+
sidebar_position: 3
5+
---
6+
7+
# ESP32 环境配置
8+
9+
ESP的官方教程已经足够完善:[ESP-IDF Getting Started](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32c3/get-started/index.html),根据教程安装即可。
10+
11+
## 工程CMake配置
12+
13+
libxr提供了[esp32-cmake](https://github.com/Jiu-xiao/libxr/blob/master/CMake/esp32.cmake)的CMake配置,可以直接使用libxr的CMake配置。
14+
对于ESP官方的Hello World工程,请在main/CMakeLists.txt最后添加:
15+
16+
```cmake
17+
include(path_to_libxr/CMake/esp32.cmake)
18+
```
19+
20+
即可完成CMake配置,注意将path_to_libxr的路径替换为你的libxr路径。

docs/env_setup/linux.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
id: env-setup-linux
3+
title: Linux环境配置
4+
sidebar_position: 4
5+
---
6+
7+
# Linux 环境配置
8+
9+
Linux下只需按照相关依赖包即可。
10+
11+
## 安装依赖
12+
13+
```bash
14+
sudo apt update
15+
sudo apt install -y git python3 python3-pip cmake tar xz-utils wget pipx ninja-build libwpa-client-dev libnm-dev libudev-dev gcc g++ gdb
16+
```
17+
18+
## 使用Clang
19+
20+
直接用cmake指定C/C++编译器即可,无需特殊配置。

docs/env_setup/stm32.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: env-setup-stm32
3-
title: STM32 环境配置
3+
title: STM32环境配置
44
sidebar_position: 1
55
---
66

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
id: env-setup-ch32
3+
title: CH32 Environment Setup
4+
sidebar_position: 2
5+
---
6+
7+
# CH32 Environment Setup
8+
9+
The RISC-V toolchain situation for the CH32 series is quite chaotic. The following two options are recommended:
10+
11+
* [The official riscv-wch-elf bundled with MRS](http://www.mounriver.com/download): Supports WCH's rv32imafcxw extended instruction set, but has incomplete C++ standard library support, making it incompatible with libraries like Eigen.
12+
* [Upstream riscv32-unknown-elf](https://github.com/riscv-collab/riscv-gnu-toolchain): Does **not** support WCH's extended instruction set, but provides complete C++ standard library support. Needs to be built manually and is currently not supported on Windows.
13+
14+
For quick compilation, you can use the Docker image provided by this project.
15+
16+
## CMake Configuration
17+
18+
An additional option needs to be configured: `LIBXR_CH32_CONFIG_FILE`, which specifies the path to the CH32 peripheral library configuration file, such as: `ch32v30x_conf.h`.
19+
20+
```cmake
21+
set(LIBXR_SYSTEM FreeRTOS)
22+
set(LIBXR_DRIVER ch)
23+
24+
set(LIBXR_CH32_CONFIG_FILE "ch32v30x_conf.h")
25+
26+
add_subdirectory(libxr)
27+
28+
...
29+
```
30+
31+
## Example Project
32+
33+
[CH32V307+FreeRTOS+TinyUSB](https://github.com/Jiu-xiao/CH32V307_LibXR_Template)

i18n/en/docusaurus-plugin-content-docs/current/env_setup/docker.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
id: env-setup-docker
33
title: Docker Environment Setup
4-
sidebar_position: 2
4+
sidebar_position: 5
55
---
66

77
This page introduces how to use the Docker images provided in [this repository](https://github.com/xrobot-org/Docker-Image).
88

99
There are five available Docker images:
1010

11-
* `docker-image`: Contains environment setups for all supported platforms
1211
* `docker-image-stm32`: Docker image tailored for STM32 development
1312
* `docker-image-esp32`: Docker image tailored for ESP32 development
13+
* `docker-image-ch32-riscv`: Docker image tailored for CH32 RISC-V Series
1414
* `docker-image-linux`: Docker image tailored for Linux development
1515
* `docker-image-webots`: Docker image tailored for Webots simulation
1616

@@ -21,6 +21,7 @@ GitHub Container Registry – recommended for use in GitHub Actions
2121
* docker-image: `docker pull ghcr.io/xrobot-org/docker-image:main`
2222
* docker-image-stm32: `docker pull ghcr.io/xrobot-org/docker-image-stm32:main`
2323
* docker-image-esp32: `docker pull ghcr.io/xrobot-org/docker-image-esp32:main`
24+
* docker-image-ch32-riscv: `docker pull ghcr.io/xrobot-org/docker-image-ch32-riscv:main`
2425
* docker-image-linux: `docker pull ghcr.io/xrobot-org/docker-image-linux:main`
2526
* docker-image-webots: `docker pull ghcr.io/xrobot-org/docker-image-webots:main`
2627

@@ -31,6 +32,7 @@ Docker Hub images – recommended for local development
3132
* docker-image: `docker pull xrimage/xrimage`
3233
* docker-image-stm32: `docker pull xrimage/xrimage-stm32`
3334
* docker-image-esp32: `docker pull xrimage/xrimage-esp32`
35+
* docker-image-ch32-riscv: `docker pull xrimage/xrimage-ch32-riscv`
3436
* docker-image-linux: `docker pull xrimage/xrimage-linux`
3537
* docker-image-webots: `docker pull xrimage/xrimage-webots`
3638

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
id: env-setup-esp32
3+
title: ESP32 Environment Setup
4+
sidebar_position: 3
5+
---
6+
7+
# ESP32 Environment Setup
8+
9+
The official ESP tutorial is already quite comprehensive: [ESP-IDF Getting Started](https://docs.espressif.com/projects/esp-idf/zh_CN/latest/esp32c3/get-started/index.html). Just follow the instructions to install the environment.
10+
11+
## Project CMake Configuration
12+
13+
`libxr` provides a CMake configuration for ESP32: [esp32-cmake](https://github.com/Jiu-xiao/libxr/blob/master/CMake/esp32.cmake), which can be directly used.
14+
15+
For the official ESP Hello World project, add the following line at the end of `main/CMakeLists.txt`:
16+
17+
```cmake
18+
include(path_to_libxr/CMake/esp32.cmake)
19+
```
20+
21+
This completes the CMake setup. Be sure to replace `path_to_libxr` with the actual path to your `libxr` directory.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
id: env-setup-linux
3+
title: Linux Environment Setup
4+
sidebar_position: 4
5+
---
6+
7+
# Linux Environment Setup
8+
9+
On Linux, you just need to install the necessary dependencies.
10+
11+
## Installing Dependencies
12+
13+
```bash
14+
sudo apt update
15+
sudo apt install -y git python3 python3-pip cmake tar xz-utils wget pipx ninja-build libwpa-client-dev libnm-dev libudev-dev gcc g++ gdb
16+
```
17+
18+
## Using Clang
19+
20+
You can specify the C/C++ compiler directly with CMake—no special configuration is required.

0 commit comments

Comments
 (0)