瑞芯微RK3588安卓使用fastboot分区烧录
一、前言
开发板为香橙派 5Plus,安卓版本为 12。
官方手册介绍了整个镜像一起烧录的方法,但是没有介绍如何只更新部分分区,例如只更新uboot。可以使用官方工具 RKDevTool 进行分区烧录,但是每次需要导入配置文件,并且需要手动进入maskrom模式,相对麻烦。
二、环境配置
香橙派安卓系统下连接 USB 即可使用 ADB 进行通信,主机端需要安装 ADB。如果是Ubuntu,直接 apt 安装即可,Windows可以使用谷歌的下载链接:
https://dl.google.com/android/repository/platform-tools-latest-windows.ziphttps://dl.google.com/android/repository/platform-tools-latest-windows.zip测试指令:
adb devices
如果显示设备 ID,那么连接正常。
如果没有设备 ID,那么需要尝试更换 ADB 的版本,或者检查连接,更换 USB 线等。
三、进入 Bootloader 或 fastboot 进行烧录
分区烧录需要进入 Bootloader 或者 fastboot 模式。fastboot 模式是 Bootloader 的一种子模式,可以直接跳转到 fastboot 功能,是 Bootloader 的一种特殊情况,在 RK 芯片中主要用于烧录动态分区。
1、使用 fastboot 烧录动态分区
RK 的 fastboot 主要用于烧录动态分区 super.img,主要包括system,vendor,odm等。system是 Android 系统分区,包含操作系统和预装应用;Vendor是厂商提供的驱动和二进制文件。
官方文档:
(1)进入 fastboot 模式:
adb reboot fastboot
(2)如果开发板有接显示器,会看到标题为 fastbootd:
(3)使用 fastboot 指令读取设备:
fastboot devices
连接正常。如果没有反应,尝试更换 fastboot 的版本。
(4)烧录 vendor:
fastboot flash vendor vendor.img
这里的第三个参数是分区的名字,第四是镜像文件,分区名字在文章后面会讲解。
2、使用 bootloader 烧录分区
对于其他的分区,则需要进入 bootloader 模式,来自官方的提示:
(1)进入 bootloader:
adb reboot bootloader
(2)烧录对应的分区:
fastboot flash uboot uboot.img
fastboot flash misc misc.img
(3)常用的烧录镜像:
四、分区表
分区名字我这里提供一个 SD 卡烧录后的分区表,烧录时可以进行对应填写,是在Uboot下使用 mmc part 查询出来的。其他存储设备还未尝试,不知道会不会有区别。
该表没有显示 U-Boot SPL(Miniloader) 的分区名字和地址,在 RKDevTool 中的烧录起始地址为 0x00000000,但是分区名字还未查到,可能无法通过 ADB 进行烧录。
Partition Map for MMC device 1 -- Partition Type: EFI
Part Start LBA End LBA Name
Attributes
Type GUID
Partition GUID
1 0x00002000 0x00003fff "security"
attrs: 0x0000000000000000
type: a60b0000-0000-4c7e-8000-015e00004db7
guid: 12390000-0000-4b64-8000-700300004538
2 0x00004000 0x00006fff "uboot"
attrs: 0x0000000000000000
type: d46e0000-0000-457f-8000-220d000030db
guid: 9a010000-0000-484b-8000-3e4900003a7d
3 0x00007000 0x00008fff "trust"
attrs: 0x0000000000000000
type: 4f4c0000-0000-4049-8000-36c40000603b
guid: 223e0000-0000-4b12-8000-58ca00007b72
4 0x00009000 0x0000afff "misc"
attrs: 0x0000000000000000
type: 80690000-0000-4568-8000-5dea000057bf
guid: 140f0000-0000-4c42-8000-79ef00003cff
5 0x0000b000 0x0000cfff "dtbo"
attrs: 0x0000000000000000
type: cd3a0000-0000-4c5e-8000-6be60000034f
guid: d7440000-0000-4354-8000-0e1e0000240c
6 0x0000d000 0x0000d7ff "vbmeta"
attrs: 0x0000000000000000
type: 9f6a0000-0000-4e20-8000-6722000046d3
guid: d3600000-0000-4937-8000-37c000005081
7 0x0000d800 0x0003f7ff "boot"
attrs: 0x0000000000000000
type: 5f590000-0000-4116-8000-0c0500007733
guid: 701d0000-0000-4450-8000-4c3e00004f46
8 0x0003f800 0x000757ff "recovery"
attrs: 0x0000000000000000
type: 73170000-0000-4f1f-8000-4af700005e57
guid: 16660000-0000-4e74-8000-55fe00002743
9 0x00075800 0x0012f7ff "backup"
attrs: 0x0000000000000000
type: 456c0000-0000-4e0a-8000-456000003b27
guid: 2d5e0000-0000-4d6f-8000-106a00004e61
10 0x0012f800 0x001ef7ff "cache"
attrs: 0x0000000000000000
type: 3b530000-0000-481d-8000-54a900003f8c
guid: 1d580000-0000-4b00-8000-6ee900003086
11 0x001ef800 0x001f77ff "metadata"
attrs: 0x0000000000000000
type: bf7a0000-0000-4310-8000-03380000106c
guid: 4e5c0000-0000-4e5a-8000-15e200002f9b
12 0x001f7800 0x001f7fff "baseparameter"
attrs: 0x0000000000000000
type: 38430000-0000-4912-8000-1176000049b1
guid: 29270000-0000-4024-8000-5fbf00001d89
13 0x001f8000 0x0080bfff "super"
attrs: 0x0000000000000000
type: 0e450000-0000-4143-8000-72cb00007741
guid: 142b0000-0000-4879-8000-58e700004336
14 0x0080c000 0x03b77fbf "userdata"
attrs: 0x0000000000000000
type: a84a0000-0000-4237-8000-4ca000001c06
guid: 780a0000-0000-4e67-8000-43c200005d8c
建议在烧录对应镜像前,了解镜像的作用以及风险。
可以使用测试用的 SD 卡,熟悉烧写流程。