Skip to content

Commit

Permalink
Merge pull request #125 from aisuneko/stash
Browse files Browse the repository at this point in the history
m0sense: Add RT-Thread
  • Loading branch information
KevinMX authored Dec 27, 2024
2 parents 8846313 + 7286b76 commit 2d82fa7
Show file tree
Hide file tree
Showing 7 changed files with 240 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Duo256m/ArchLinux/README_zh.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Arch Linux Milk-V Duo S 测试报告
# Arch Linux Milk-V Duo 256M 测试报告

## 测试环境

Expand Down
2 changes: 1 addition & 1 deletion Duo256m/openEuler/README_zh.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# openEuler Milk-V Duo S 测试报告
# openEuler Milk-V Duo 256M 测试报告

## 测试环境

Expand Down
7 changes: 6 additions & 1 deletion M0sense/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ cpu_core: SiFive E24
- FreeRTOS Demo
- Source Link: [https://gitee.com/Sipeed/M0sense_BL702_example](https://gitee.com/Sipeed/M0sense_BL702_example)
- Reference Installation Document: [https://wiki.sipeed.com/hardware/zh/maixzero/sense/start.html](https://wiki.sipeed.com/hardware/zh/maixzero/sense/start.html)
- RT-Thread / RT-Thread Smart
- Source Code Link: https://github.com/RT-Thread/rt-thread
- Reference Installation Document: https://github.com/RT-Thread/rt-thread/blob/master/bsp/bouffalo_lab/README.md

### Hardware Information

Expand All @@ -22,6 +25,8 @@ cpu_core: SiFive E24

| Software Category | Package Name | Test Result (Test Report) |
| ----------------- | --------------------- | ------------------------- |
| FreeRTOS Demo | single_button_control | [Successful][FreeRTOS] |
| FreeRTOS Demo | single_button_control | [Successful][FreeRTOS] |
| RT-Thread | N/A | [Successful][RT-Thread] |

[FreeRTOS]: ./FreeRTOS/README.md
[RT-Thread]: ./RT-Thread/README.md
14 changes: 10 additions & 4 deletions M0sense/README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@
### 操作系统信息

- FreeRTOS Demo
- 源码链接:https://gitee.com/Sipeed/M0sense_BL702_example
- 源码链接:https://gitee.com/Sipeed/M0sense_BL702_example
- 参考安装文档:https://wiki.sipeed.com/hardware/zh/maixzero/sense/start.html
- RT-Thread
- 源码链接:https://github.com/RT-Thread/rt-thread
- 参考安装文档:https://github.com/RT-Thread/rt-thread/blob/master/bsp/bouffalo_lab/README.md

### 硬件开发板信息

- Sipeed Maix M0sense

## 测试结果

| 软件分类 | 软件包名 | 测试结果(测试报告) |
|-------------|-------------|------------------|
| FreeRTOS Demo | single_button_control | [成功][FreeRTOS] |
| 软件分类 | 软件包名 | 测试结果(测试报告) |
| ------------- | --------------------- | -------------------- |
| FreeRTOS Demo | single_button_control | [成功][FreeRTOS] |
| RT-Thread | N/A | [成功][RT-Thread] |

[FreeRTOS]: ./FreeRTOS/README_zh.md
[RT-Thread]: ./RT-Thread/README.md
114 changes: 114 additions & 0 deletions M0sense/RT-Thread/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
sys: rtthread
sys_ver: null
sys_var: standard

status: basic
last_update: 2024-12-05
---

# RT-Thread M0sense Test Report

## Test Environment

### Operating System Information
- Source Code Link: https://github.com/RT-Thread/rt-thread
- Reference Installation Document: https://github.com/RT-Thread/rt-thread/blob/master/bsp/bouffalo_lab/README.md
- Toolchain: https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1705395512373/Xuantie-900-gcc-elf-newlib-x86_64-V2.8.1-20240115.tar.gz

### Hardware Information

- Sipeed M0sense (BL702)
- A USB A to C or C to C cable
- One Dupont Line

## Installation Steps

The following steps are tested on Arch Linux, but should be applicable to all major Linux distributions.

### Preparing the System Environment

Install the required packages:

```shell
sudo apt install -y scons libncurses5-dev device-tree-compiler
# or on Arch Linux: sudo pacman -S scons dtc ncurses
```

Get the toolchain:

```shell
wget https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1705395512373/Xuantie-900-gcc-elf-newlib-x86_64-V2.8.1-20240115.tar.gz

tar -xzvf Xuantie-900-gcc-elf-newlib-x86_64-V2.8.1-20240115.tar.gz
```

Update the following paths as needed:
```bash
export RTT_CC_PREFIX=riscv64-unknown-elf-
export RTT_EXEC_PATH=/opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.8.1/bin
```

### Fetching the Source Code and Compiling the Firmware

```shell
git clone --depth=1 https://github.com/RT-Thread/rt-thread
cd rt-thread/bsp/bouffalo_lab/bl70x
scons --menuconfig
source ~/.env/env.sh
pkgs --update
scons -j$(nproc) --verbose
```
The generated firmware file is at `./rtthread.bin`

### Flash firmware

Short the `BOOT` pin and the `3V` pin on the board with a Dupont cable, then power it on to enter flashing mode.

Flash the firmware to board (the board has built-in serial device):
```shell
cd ../
sudo ./bouffalo_flash_cube.sh bl702 /dev/ttyACM0
```
(The script will automatically detect and download `bouffalo_flash_cube` to the compilation directory.)

### Logging into the System

Logging into the system via the serial port.

## Expected Results

The system should boot normally and allow login through the serial port.

## Actual Results

The system booted successfully, and login through the serial port was successful.

### Boot Log

Note that user inputs may not be able to echo immediately in `msh`.
```log
Now can [init] goio set o[rgbled_task] start loop
Now: command not found.
bouffalolab />
bouffalolab />help
shell commands list:
memtrace
help
bouffalolab />memtrace
write memory: 0x42000000 0xabcd 10
read memory: 0x42000000 10
bouffalolab />hello
```

## Test Criteria

Successful: The actual result matches the expected result.

Failed: The actual result does not match the expected result.

## Test Conclusion

Test successful.
104 changes: 104 additions & 0 deletions M0sense/RT-Thread/README_zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# RT-Thread M0sense 测试报告

## 测试环境

### 操作系统信息
- 源码链接:https://github.com/RT-Thread/rt-thread
- 参考安装文档:https://github.com/RT-Thread/rt-thread/blob/master/bsp/bouffalo_lab/README.md
- 工具链:https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1705395512373/Xuantie-900-gcc-elf-newlib-x86_64-V2.8.1-20240115.tar.gz

### 硬件信息

- Sipeed M0sense (BL702)
- USB A to C 或 C to C 线缆一根
- 杜邦线一根

## 构建步骤

以下步骤在 Arch Linux 上测试通过,但应适用各大主流 Linux 发行版。

### 准备系统环境

获取工具链并配置:
```bash
wget https://occ-oss-prod.oss-cn-hangzhou.aliyuncs.com/resource//1705395512373/Xuantie-900-gcc-elf-newlib-x86_64-V2.8.1-20240115.tar.gz

tar -xzvf Xuantie-900-gcc-elf-newlib-x86_64-V2.8.1-20240115.tar.gz
```

自行更改以下路径:
```bash
export RTT_CC_PREFIX=riscv64-unknown-elf-
export RTT_EXEC_PATH=/opt/Xuantie-900-gcc-elf-newlib-x86_64-V2.8.1/bin
```

获取依赖:
```bash
sudo apt install -y scons libncurses5-dev device-tree-compiler
# 在 Arch Linux 上为:sudo pacman -S scons dtc ncurses
```

### 拉取源码并编译固件

```shell
git clone --depth=1 https://github.com/RT-Thread/rt-thread
cd rt-thread/bsp/bouffalo_lab/bl70x
scons --menuconfig
source ~/.env/env.sh
pkgs --update
scons -j$(nproc) --verbose
```
生成的固件文件位于 `./rtthread.bin`


### 烧写固件

将 M0sense 上的 BOOT 引脚与 3V 引脚用杜邦线短接,上电即进入烧写模式。同时连接串口以便观察输出。
烧写固件至开发板(板载有串口设备):
```shell
cd ../
sudo ./bouffalo_flash_cube.sh bl702 /dev/ttyACM0
```

(该脚本会自动检测并下载 `bouffalo_flash_cube` 工具至编译目录)

### 登录系统

通过串口登录系统。

## 预期结果

系统正常启动,能够通过串口登录。

## 实际结果

系统正常启动,成功通过串口登录。

### 启动信息

注意 `msh` 输出可能不立即回显,属正常现象。
```log
Now can [init] goio set o[rgbled_task] start loop
Now: command not found.
bouffalolab />
bouffalolab />help
shell commands list:
memtrace
help
bouffalolab />memtrace
write memory: 0x42000000 0xabcd 10
read memory: 0x42000000 10
bouffalolab />hello
```

## 测试判定标准

测试成功:实际结果与预期结果相符。

测试失败:实际结果与预期结果不符。

## 测试结论

测试成功。
8 changes: 4 additions & 4 deletions M1s/README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
## 测试结果

| 软件分类 | 软件包名 | 测试结果(测试报告) |
|------------------|-------------|------------------|
| BuildRoot 镜像启动 | N/A | [成功][BuildRoot] |
| FreeRTOS 启动 | hello_world | [成功][BuildRoot]|

| ------------------ | ----------- | -------------------- |
| BuildRoot 镜像启动 | N/A | [成功][BuildRoot] |
| FreeRTOS 启动 | hello_world | [成功][BuildRoot] |
[BuildRoot]: ./BuildRoot/README_zh.md
[FreeRTOS]: ./FreeRTOS/README_zh.md

0 comments on commit 2d82fa7

Please sign in to comment.