@@ -13,9 +13,10 @@ CanMV-K230 Board Support Package 使用说明
1313 - [3.3. 下载 RT-Thread 并更新依赖的软件包](#33-下载-rt-thread-并更新依赖的软件包)
1414 - [3.4. 构建](#34-构建)
1515- [ 4. 采用 rttpkgtool 对内核打包] ( #4-采用-rttpkgtool-对内核打包 )
16- - [ 5. 制作基础 SD 卡] ( #5-制作基础-sd-卡 )
17- - [ 6. 单独更新 RT-Thread 内核] ( #6-单独更新-rt-thread-内核 )
18- - [ 7. 上电启动] ( #7-上电启动 )
16+ - [ 5. 烧写内核] ( #5-烧写内核 )
17+ - [5.1. 制作基础 SD 卡](#51-制作基础-sd-卡)
18+ - [5.2. 单独更新 RT-Thread 内核](#52-单独更新-rt-thread-内核)
19+ - [ 6. 上电启动] ( #6-上电启动 )
1920
2021<!-- /TOC -->
2122
@@ -156,7 +157,14 @@ The image file is located at /home/u/ws/canaan/rt-thread/bsp/k230/rttpkgtool/out
156157
157158如果希望重新下载 rttpkgtool 以及 opensbi,可以删除 ` rt-thread/bsp/k230 ` 下的 ` rttpkgtool ` 目录后重新执行 ` build.sh ` 脚本即可。
158159
159- # 5. 制作基础 SD 卡
160+ # 5. 烧写内核
161+
162+ 我们采用 SD 卡方式启动开发板,基于 SD 卡烧写内核的步骤可以大致分为两步:
163+
164+ - 制作基础 SD 卡。** 注意本步骤只要做一次** ,以后只要单独更新 RT-Thread 内核的镜像即可。
165+ - 单独更新 RT-Thread 内核
166+
167+ ## 5.1. 制作基础 SD 卡
160168
161169在单独更新内核镜像之前,我们需要先制作一个基础的 SD 卡。可以参考 K230 RTOS Only SDK 用户指南中的 “如何编译固件”:< https://developer.canaan-creative.com/k230_rtos/zh/dev/userguide/how_to_build.html > 生成一个完整的 image。
162170
@@ -187,27 +195,32 @@ The image file is located at /home/u/ws/canaan/rt-thread/bsp/k230/rttpkgtool/out
187195
188196然后参考 K230 RTOS Only SDK 用户指南中的 “如何烧录固件”:< https://developer.canaan-creative.com/k230_rtos/zh/dev/userguide/how_to_flash.html > , 通过 SD 卡烧录。熟悉 Windows 平台的可以使用 balenaEtcher。烧录后,SD 卡上会自动分区和格式化。
189197
190- ** 注意本小节的操作只要做一次 ** 。以后只要单独更新 RT-Thread 内核的镜像即可。
198+ ## 5.2. 单独更新 RT-Thread 内核
191199
192- # 6. 单独更新 RT-Thread 内核
193-
194- 我们可以利用 rttpkgtool 提供的脚本 ` sdcard.sh ` 快速更新打包后生成的内核镜像 ` opensbi_rtt_system.bin ` 。
200+ 我们可以利用 rttpkgtool 提供的脚本 ` sdcard.sh ` 快速更新 SD 卡中打包后生成的内核镜像 ` opensbi_rtt_system.bin ` 。
195201
196202先将 SD 卡通过 USB 读卡器接入 Ubuntu 机器。以下假设 USB 读卡器设备枚举为 ` /dev/sdb ` 。如果不同请阅读 ` sdcard.sh ` 脚本代码。
197203
204+ 为方便使用,在本 bsp 下提供了一份封装脚本 ` flashsd.sh ` 封装了对 rttpkgtool 的 ` sdcard.sh ` 脚本的调用。
205+
198206``` shell
199207$ cd rt-thread/bsp/k230 # 确保在本 bsp 目录下
200- $ ./rttpkgtool/script/sdcard.sh
201- SRC: /home/u/ws/canaan/rt-thread/bsp/k230/rttpkgtool/output/k230_rtos_01studio_defconfig/images/opensbi/opensbi_rtt_system.bin
202- DEST: /dev/sdb
208+ $ ./flashsd.sh
209+ BSP_PATH: /home/u/ws/canaan/rt-thread/bsp/k230
210+ rttpkgtool already exists
211+ ~ /ws/canaan/rt-thread/bsp/k230/rttpkgtool ~ /ws/canaan/rt-thread/bsp/k230
212+ Already on ' for-k230'
213+ Your branch is up to date with ' origin/for-k230' .
214+ Already up to date.
215+ ~ /ws/canaan/rt-thread/bsp/k230
203216[sudo] password for u:
204- 766 +1 records in
205- 766 +1 records out
206- 392569 bytes (393 kB, 383 KiB) copied, 0.0886941 s, 4.4 MB/s
207- Done !
217+ 767 +1 records in
218+ 767 +1 records out
219+ 393140 bytes (393 kB, 384 KiB) copied, 0.121172 s, 3.2 MB/s
220+ INFO: The kernel file has been flashed to the USB/SDcard successfully !
208221```
209222
210- # 7 . 上电启动
223+ # 6 . 上电启动
211224
212225将 SD 卡插入 01Studio 开发板的 SD 卡槽。
213226
0 commit comments