1- # Taishanpi-RK3566 Board Support Package (BSP) Usage Guide
1+ # Taishanpi-RK3566 板级支持包使用说明
22
3- [ 中文页] ( ./Taishanpi-RK3566_CN .md ) | English
3+ 中文页 | [ English ] ( ./Taishanpi-RK3566_ZH .md )
44
5- ## 0. Code Source Statement
5+ ## 0. 说明
66
7- The commit used in this document :
7+ 此文档使用的Commit :
88- ` a1c642aa3a2848b47f2a1b52679dc4ee5156f2f4 `
99
10- Based on the [ original documentation ] ( ./README.md ) , this guide supplements and elaborates on the content with additional documentation and detailed step-by-step instructions.
10+ 在 [ 原有文档 ] ( ./README.md ) 基础上面进行了文档补充和步骤说明,丰富了一下原有内容。
1111
12- ## 1. Introduction
12+ ## 1. 介绍
1313
14- This support package usage guide is written based on the [ TaishanPi 1 ] ( https://wiki.lckfb.com/zh-hans/tspi-rk3566/ ) development board.
14+ 这份支持包使用说明是根据 [ 泰山派1 ] ( https://wiki.lckfb.com/zh-hans/tspi-rk3566/ ) 所写的一份使用指南。
1515
16- [ All schematic diagrams, PCB files, and software resources for TaishanPi 1 are open-source ] ( https://wiki.lckfb.com/zh-hans/tspi-rk3566/open-source-hardware/ )
16+ [ 泰山派1中原理图、PCB文件和软件资料全部开源 ] ( https://wiki.lckfb.com/zh-hans/tspi-rk3566/open-source-hardware/ )
1717
18- This guide provides detailed instructions and relevant precautions.
18+ 在本指南中会尽可能的详细介绍使用步骤和相关注意事项。
1919
20- ### 1.1. Chip Introduction
20+ ### 1.1. 芯片介绍
2121
22- ` Rockchip RK3566 ` is a mid-to-high-end ` AIOT ` chip :
22+ ` Rockchip RK3566 ` 是中高端 ` AIOT ` 芯片 :
2323
24- - Manufactured using ` 22nm ` process technology
25- - Quad-core ` Cortex-A55 ` 64-bit CPU
26- - Clock speed up to ` 1.8GHz `
27- - Integrated ` ARM Mali-G52 GPU `
28- - Integrated ` 1Tops ` AI accelerator ` NPU `
29- - Supports ` 4K 60FPS ` decoding
30- - Supports ` 1080P 60FPS ` encoding
31- - Supports ` 5M ISP ` and ` HDR `
24+ - 采用 ` 22nm ` 制程工艺。
25+ - ` 4 ` 核 ` Cortex-A55 ` 的 ` 64 ` 位CPU。
26+ - 主频高达 ` 1.8GHz ` 。
27+ - 集成 ` ARM Mali-G52 GPU `
28+ - 集成 ` 1Tops ` 算力的 ` AI ` 加速器 ` NPU ` ;
29+ - 支持 ` 4K 60FPS ` 解码。
30+ - 支持 ` 1080P 60FPS ` 解码。
31+ - 支持 ` 5M ISP ` 和 ` HDR ` 。
3232
33- ### 1.2. Host Machine Environment
33+ ### 1.2. 宿主机环境介绍
3434
35- This guide uses ` Ubuntu22.04.5 LTS Desktop ` running on ` VMware ` .
35+ 本次使用的是 ` Ubuntu22.04.5 LTS Desktop ` 运行在 ` VMware ` 中。
3636
37- System information:
37+ 系统信息如下:
3838
3939``` bash
4040$ cat /etc/os-release
@@ -62,48 +62,50 @@ Release: 22.04
6262Codename: jammy
6363```
6464
65- ` Python ` version:
65+ ` Python ` 版本如下:
6666``` bash
6767$ python --version
6868Python 3.10.12
6969```
7070
7171
72- ## 2. Environment Setup
72+ ## 2. 环境搭建
7373
74- Run the following commands to install required packages:
74+ 运行下面的命令安装相关的软件包:
7575
76- 1 . Essential tools:
76+ 1 . 必要工具:
7777``` bash
7878sudo apt update && \
7979sudo apt install -y python3 python3-pip u-boot-tools device-tree-compiler
8080```
8181
82- 2 . Install tools using ` pip ` :
82+ 2 . 使用 ` pip ` 安装工具:
8383``` bash
8484pip3 install --user tqdm
8585```
8686
8787
88- 3 . Set ` Python version ` :
88+ 3 . 设定 ` python ` 版本:
8989``` bash
9090sudo rm -rf /usr/bin/python && \
9191sudo ln -s /usr/bin/python3 /usr/bin/python
9292```
9393
9494
95- 4 . Download ` RT-Thread Smart ` toolchain:
95+ 4 . 下载 ` RT-Thread Smart ` 工具链:
9696``` bash
9797wget https://download.rt-thread.org/download/rt-smart/toolchains/aarch64-linux-musleabi_for_x86_64-pc-linux-gnu_latest.tar.bz2
9898
9999```
100100
101- 5 . Extract the toolchain:
101+ 5 . 解压:
102102``` bash
103103sudo tar -xf aarch64-linux-musleabi_for_x86_64-pc-linux-gnu_latest.tar.bz2 -C /opt
104104```
105105
106- 6 . Set environment variables after extraction:
106+ 5 . 将工具链下载后,解压至` /opt ` 目录。并设置环境变量
107+
108+ > 直接复制全部,然后粘贴到命令行回车即可。
107109
108110``` bash
109111export RTT_CC=" gcc"
@@ -114,106 +116,107 @@ export PATH="$RTT_EXEC_PATH:$PATH"
114116
115117## 3. 编译
116118
117- Navigate to the ` rt-thread/bsp/rockchip/rk3566 ` directory and run :
119+ 进入 ` rt-thread/bsp/rockchip/rk3566 ` 目录下输入下面的命令 :
118120
119- > This command pulls the ` zlib ` package required for compilation.
121+ > 这个用于拉取 ` zlib ` 软件包,我们编译的时候需要用到。
120122
121123``` bash
122124source ~ /.env/tools/scripts/pkgs --update
123125```
124126
125- Start compilation:
127+ 开始编译:
126128
127- > Alternatively, use ` scons --exec-path="GCC toolchain path " ` to specify the toolchain location directly.
129+ > 或者通过 ` scons --exec-path="GCC工具链路径 " ` 命令,在指定工具链位置的同时直接编译。
128130
129131``` bash
130132scons -j$( nproc)
131133```
132134
133- The ` rtthread.elf ` and ` rtthread.bin ` files will be generated in the current ` rk3566 ` directory.
135+ 可以看到在当前 ` rk3566 ` 文件夹中正常生成 ` rtthread.elf ` 与 ` rtthread.bin ` 文件。
134136
135- ## 3. Running
137+ ## 3. 运行
136138
137- ### 3.1. Flashing the Board
139+ ### 3.1. 为板子烧录镜像
138140
139- To boot the ` rtthread ` system using U-Boot commands, flash the following files using the Rockchip development tool.
141+ 因为我需要在 ` Uboot ` 环境中使用命令进行引导 ` rtthread ` 系统,所以需要烧录相关的文件。
140142
141- This guide uses the [ TaishanPi 1 ] ( https://wiki.lckfb.com/zh-hans/tspi-rk3566/ ) ` Rockchip Linux5.10 SDK ` :
143+ 这里我是用的内核是 [ 泰山派1 ] ( https://wiki.lckfb.com/zh-hans/tspi-rk3566/ ) 的 ` Rockchip Linux5.10 SDK ` :
142144
143145- ` Github ` :https://github.com/TaishanPi
144146
145- - Tutorial [ Host Machine Build Method ] ( https://wiki.lckfb.com/zh-hans/tspi-rk3566/sdk-compilation/openkylin-sdk-compilation.html )
147+ - 教程看 [ 宿主机构建方式 ] ( https://wiki.lckfb.com/zh-hans/tspi-rk3566/sdk-compilation/openkylin-sdk-compilation.html )
146148
147- After compilation, required files will be in the ` rockdev/ ` directory.
149+ 编译完成之后会在 ` rockdev/ ` 目录下生成我们所需要的文件
148150
149- Erase all existing firmware from the board:
151+ 将板子的所有镜像全部擦除:
150152
151153![ rockchip-clean] ( ./figures/rockchip-clean.jpg )
152154
153- Flash these 4 files using the Rockchip Development Tool:
155+ 然后使用 ` 瑞芯微开发工具 ` 烧录下面的 ` 4 ` 个文件:
154156
155- > > Note: The TaishanPi 1 SDK uses a custom partition layout. Other boards may require different files.
157+ > > 注意: 因为我们的SDK是重新进行分区的,所以使用 [ 泰山派1 ] ( https://wiki.lckfb.com/zh-hans/tspi-rk3566/ ) 需要下面的 ` 4 ` 个文件,其他板子没有测试,可以自行尝试。
156158
157159- ` MiniLoaderAll.bin `
158160- ` parameter.txt `
159161- ` uboot.img `
160162- ` boot.img `
161163
162- ### 3.2. Formatting the TF Card
164+ ### 3.2. 格式化TF卡
163165
164- Prepare a TF card to store files.
166+ 我们需要准备一张 ` TF ` 卡,用来存放 ` rtthread.bin ` 文件。
165167
166- Download ` Rufus ` :https://rufus.org.cn/
168+ 下载 ` Rufus ` :https://rufus.org.cn/
167169
168- Configure with these settings and click "Start":
170+ 设定为下列的模式,然后点击 ` 开始 ` :
169171
170172![ rockchip-clean] ( ./figures/rufus.jpg )
171173
172174
173- ### 3.3. Creating boot.scr
175+ ### 3.3. 制作boot.scr
176+
177+ > 这里可以直接使用当前目录下的 ` boot.scr ` ,同样也是用下面的方式制作出来的,如果有需求可以根据下面的方法自己制作。
174178
175- > You can use the existing ` boot.scr ` in this directory, or create your own using the method below.
179+ 前面我们已经安装过 ` u- boot-tools ` 所以直接使用即可。
176180
177- Create ` boot.cmd ` with the following content:
181+ 创建 ` boot.cmd ` ,并写入下面的内容:
178182
179183``` bash
180184fatload mmc 1:1 0x480000 rtthread.bin;
181185fatload mmc 1:1 0x8300000 tspi-rk3566-user-v10-linux.dtb;
182186booti 0x480000 - 0x8300000;
183187```
184- > The Device Tree Blob (DTB) file is required for system startup. For TaishanPi 1, the DTB file is located at ` kernel/arch/arm64/boot/dts/rockchip/tspi-rk3566-user-v10-linux.dtb ` . Other boards may use different DTB files. Without the correct DTB, rtthread will fail to boot (see "Common Issues and Solutions").
188+ > 系统启动需要 ` 设备树文件DTB ` ,这里我们 [ 泰山派1 ] ( https://wiki.lckfb.com/zh-hans/tspi-rk3566/ ) 的 ` dtb ` 文件是 ` kernel/arch/arm64/boot/dts/rockchip/tspi-rk3566-user-v10-linux.dtb ` ,其他的文件有不同的名字,可以根据不同的开发板选择。不然 ` rtthread ` 就会无法启动,详情请看文档最后面的 ` 常见问题与解决办法 `
185189
186190
187- Generate ` boot.scr `
191+ 运行生成 ` boot.scr `
188192
189193``` bash
190194mkimage -C none -A arm -T script -d boot.cmd boot.scr
191195```
192196
193- ### 3.4. Copying Files to TF Card
197+ ### 3.4. 复制文件到TF卡
194198
195- Copy these three files to the TF card:
199+ 将下面三个文件复制到TF中:
196200
197201- ` boot.scr `
198202- ` tspi-rk3566-user-v10-linux.dtb `
199203- ` rtthread.bin `
200204
201205![ tf] ( ./figures/tf.jpg )
202206
203- ### 3.5. Running
207+ ### 3.5. 运行
204208
205- Connect to the board's serial port using a tool like [ MoBaXterm] ( https://wiki.lckfb.com/zh-hans/tspi-rk3566/tool-use/debug-tools-use.html ) :
209+ 连接 [ 开发板串口-> MoBaXterm] ( https://wiki.lckfb.com/zh-hans/tspi-rk3566/tool-use/debug-tools-use.html ) :
206210
207- - Select the correct serial port
208- - Set baud rate to ` 1500000 `
211+ 打开串口工具,选择对应串口,设置波特率为 ` 1500000 `
209212
210- With ` boot.scr ` present, the system will boot automatically :
213+ 因为有 ` boot.scr ` 会自动引导启动 ` rtthread ` :
211214
212- > Note 1: If stuck at ` [I/rtdm.ofw] Console: uart0 (fiq-debugger) ` , see "Common Issues and Solutions".
215+ > 注意1:如果卡死在了 ` [I/rtdm.ofw] Console: uart0 (fiq-debugger) ` 那么看 ` 常见问题与解决办法 ` 。
213216
214- > Note 2: After failed boot attempts, completely power cycle the board to clear memory.
217+ > 注意2:记得每次 ` rtthread ` 启动失败(在 ` uboot ` 中引导失败后),都应该将开发板完全断电然后在上电,清空内存。
215218
216- > Note 3: If automatic boot fails, manually execute the ` boot.cmd ` content in U-Boot.
219+ > 注意3:如果多次自动引导失败可以手动在 ` uboot ` 界面运行 ` boot.cmd ` 的内容,手动引导,如果还不行,那就要考虑其他的因素了,例如TF质量问题,传输到TF卡中的文件有损坏等等等。
217220
218221``` bash
219222Hit key to stop autoboot(' CTRL+C' ): 0
@@ -309,11 +312,11 @@ msh />
309312msh />
310313` ` `
311314
312- # # Common Issues and Solutions
315+ # # 常见问题与解决办法
313316
314317# ## Could not find a valid device tree
315318
316- This error occurs when booting without loading the ` .dtb` device tree file:
319+ 我们没有加载 ` .dtb` 设备树文件直接启动就会出现这样的情况:
317320
318321` ` ` bash
319322Hit key to stop autoboot(' CTRL+C' ): 0
@@ -333,35 +336,34 @@ Could not find a valid device tree
333336=>
334337` ` `
335338
336- Solution:
339+ > 注意:记得每次` rtthread` 启动失败(在` uboot` 中引导失败后),都应该将开发板完全断电然后在上电,清空内存。
340+
341+ 然后将 ` kernel/arch/arm64/boot/dts/rockchip/` 文件夹中编译之后的` .dtb` 文件转移到TF卡中,然后使用 ` fatload` 从TF卡中加载到` 0x8300000` 地址然后再次跳转即可。
337342
338- 1. Power cycle the board completely after failed boot attempts
339- 2. Copy the compiled ` .dtb` file from ` kernel/arch/arm64/boot/dts/rockchip/` to the TF card
340- 3. Load the ` DTB` to address ` 0x8300000` using ` fatload`
341- 4. Execute the boot command again
342343
344+ # ## 卡在 `[I/rtdm.ofw] Console: uart0 (fiq-debugger)` 无法启动
343345
344- # ## System Stuck at `[I/rtdm.ofw] Console: uart0 (fiq-debugger)`
346+ 大概率和你的设备树有关系,在设备树中有一个参数很重要,需要被读取:
345347
346- This is typically caused by incorrect device tree configuration. The ` chosen ` node parameters are critical.
348+ > 这里我贴出我的参数,我的 ` Debug ` 串口硬件是 ` uart2m0 `
347349
348- Example configuration for TaishanPi 1 (Debug UART: ` uart2m0 ` ):
350+ > 这个 ` chosen ` 是重要的,如果不清楚,可以参照我这么写。
349351
350352` ` ` ini
351- chosen: chosen {
352- bootargs = " earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0" ;
353- };
354-
355- fiq-debugger {
356- compatible = " rockchip,fiq-debugger" ;
357- rockchip,serial-id = < 2> ;
358- rockchip,wake-irq = < 0> ;
359- /* If enable uart uses irq instead of fiq * /
360- rockchip,irq-mode-enable = < 1> ;
361- rockchip,baudrate = < 1500000> ; /* Only 115200 and 1500000 * /
362- interrupts = < GIC_SPI 252 IRQ_TYPE_LEVEL_LOW> ;
363- pinctrl-names = " default" ;
364- pinctrl-0 = < & uart2m0_xfer> ;
365- status = " okay" ;
366- };
353+ chosen: chosen {
354+ bootargs = " earlycon=uart8250,mmio32,0xfe660000 console=ttyFIQ0" ;
355+ };
356+
357+ fiq-debugger {
358+ compatible = " rockchip,fiq-debugger" ;
359+ rockchip,serial-id = < 2> ;
360+ rockchip,wake-irq = < 0> ;
361+ /* If enable uart uses irq instead of fiq * /
362+ rockchip,irq-mode-enable = < 1> ;
363+ rockchip,baudrate = < 1500000> ; /* Only 115200 and 1500000 * /
364+ interrupts = < GIC_SPI 252 IRQ_TYPE_LEVEL_LOW> ;
365+ pinctrl-names = " default" ;
366+ pinctrl-0 = < & uart2m0_xfer> ;
367+ status = " okay" ;
368+ };
367369` ` `
0 commit comments