免责声明
⚠️ 警告:刷机有风险,操作需谨慎
刷写 Bootloader(BL2/FIP)、分区表(GPT)和固件系统涉及对硬件底层存储的直接操作。操作不当可能导致:
- 设备无法启动(变砖)
- 网络功能失效
- 分区表损坏导致数据全部丢失
- 硬件永久性损坏
本教程及配套固件仅供参考学习用途。 作者不对因遵循本教程进行操作所导致的任何直接或间接损失承担责任,包括但不限于:
- 设备变砖、无法恢复
- 数据丢失或损坏
- 硬件故障或损坏
- 保修失效
在操作前,请确保你:
- 已充分理解刷机原理和风险
- 已备份所有重要数据
- 具备基本的 Linux 命令行操作能力
- 阅读并理解了完整的教程内容
如无法接受以上条款,请勿进行任何刷机操作。 进行刷机即代表你已理解并承担全部风险。
本教程发布于 CSDN,仅为技术分享,并非官方指南。
概述
给 Banana Pi BPI-R3 Mini 刷写 Yuzhii 第三方 U-Boot(带 Web UI、DHCPD、文件管理等特性)。
Yuzhii U-Boot 特点
| 功能 | 说明 |
|---|---|
| Web UI | 图形化网页界面,多主题(bootstrap/gl/mtk) |
| DHCPD | 内置 DHCP 服务器,插网线自动分配 IP |
| 文件管理 | Flash 编辑器、环境变量管理器 |
| UBI 管理 | 网页管理 UBI 卷 |
| Web 终端 | 浏览器中执行 U-Boot 命令 |
| 超频 | BL2 支持超频到 2.3/2.5GHz |
| i18n 中文 | 支持中文界面 |
前置条件
- BPI-R3 Mini 主板
- USB-C 电源线
- 网线
- 电脑(用于 SSH 和下载文件)
- NAND 上可启动的原厂系统(作为救砖保险)
文件说明
需要三个文件:
| 文件 | 说明 | 大小 |
|---|---|---|
gpt-*.bin |
GPT 分区表 | 17 KB |
bl2-*.img |
BL2 (preloader) | 152 KB |
fip-*.bin |
FIP (U-Boot 本体) | 939 KB |
下载地址:https://github.com/Yuzhii0718/bl-mt798x-dhcpd/releases
选最新的
allRelease,里面包含 BPI-R3 Mini 的预编译文件。
刷机步骤
#mermaid-svg-TIiyJhnf05F77Efv{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-TIiyJhnf05F77Efv .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-TIiyJhnf05F77Efv .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-TIiyJhnf05F77Efv .error-icon{fill:#552222;}#mermaid-svg-TIiyJhnf05F77Efv .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-TIiyJhnf05F77Efv .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-TIiyJhnf05F77Efv .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-TIiyJhnf05F77Efv .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-TIiyJhnf05F77Efv .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-TIiyJhnf05F77Efv .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-TIiyJhnf05F77Efv .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-TIiyJhnf05F77Efv .marker{fill:#333333;stroke:#333333;}#mermaid-svg-TIiyJhnf05F77Efv .marker.cross{stroke:#333333;}#mermaid-svg-TIiyJhnf05F77Efv svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-TIiyJhnf05F77Efv p{margin:0;}#mermaid-svg-TIiyJhnf05F77Efv .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-TIiyJhnf05F77Efv .cluster-label text{fill:#333;}#mermaid-svg-TIiyJhnf05F77Efv .cluster-label span{color:#333;}#mermaid-svg-TIiyJhnf05F77Efv .cluster-label span p{background-color:transparent;}#mermaid-svg-TIiyJhnf05F77Efv .label text,#mermaid-svg-TIiyJhnf05F77Efv span{fill:#333;color:#333;}#mermaid-svg-TIiyJhnf05F77Efv .node rect,#mermaid-svg-TIiyJhnf05F77Efv .node circle,#mermaid-svg-TIiyJhnf05F77Efv .node ellipse,#mermaid-svg-TIiyJhnf05F77Efv .node polygon,#mermaid-svg-TIiyJhnf05F77Efv .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-TIiyJhnf05F77Efv .rough-node .label text,#mermaid-svg-TIiyJhnf05F77Efv .node .label text,#mermaid-svg-TIiyJhnf05F77Efv .image-shape .label,#mermaid-svg-TIiyJhnf05F77Efv .icon-shape .label{text-anchor:middle;}#mermaid-svg-TIiyJhnf05F77Efv .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-TIiyJhnf05F77Efv .rough-node .label,#mermaid-svg-TIiyJhnf05F77Efv .node .label,#mermaid-svg-TIiyJhnf05F77Efv .image-shape .label,#mermaid-svg-TIiyJhnf05F77Efv .icon-shape .label{text-align:center;}#mermaid-svg-TIiyJhnf05F77Efv .node.clickable{cursor:pointer;}#mermaid-svg-TIiyJhnf05F77Efv .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-TIiyJhnf05F77Efv .arrowheadPath{fill:#333333;}#mermaid-svg-TIiyJhnf05F77Efv .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-TIiyJhnf05F77Efv .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-TIiyJhnf05F77Efv .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-TIiyJhnf05F77Efv .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-TIiyJhnf05F77Efv .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-TIiyJhnf05F77Efv .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-TIiyJhnf05F77Efv .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-TIiyJhnf05F77Efv .cluster text{fill:#333;}#mermaid-svg-TIiyJhnf05F77Efv .cluster span{color:#333;}#mermaid-svg-TIiyJhnf05F77Efv div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-TIiyJhnf05F77Efv .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-TIiyJhnf05F77Efv rect.text{fill:none;stroke-width:0;}#mermaid-svg-TIiyJhnf05F77Efv .icon-shape,#mermaid-svg-TIiyJhnf05F77Efv .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-TIiyJhnf05F77Efv .icon-shape p,#mermaid-svg-TIiyJhnf05F77Efv .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-TIiyJhnf05F77Efv .icon-shape .label rect,#mermaid-svg-TIiyJhnf05F77Efv .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-TIiyJhnf05F77Efv .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-TIiyJhnf05F77Efv .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-TIiyJhnf05F77Efv :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 下载 GPT + BL2 + FIP 文件
切 boot switch 到 NAND
从 NAND 系统 SSH 登录
SCP 上传三个文件到 /tmp
刷写 GPT 分区表
dd if=gpt.bin of=/dev/mmcblk0
刷写 BL2 到 boot0 分区
刷写 FIP 到 LBA 13312
断电,切回 eMMC 启动
上电,浏览器打开 192.168.1.1
进入 Yuzhii U-Boot Web UI
第一步:下载文件
将以下三个文件放到电脑上:
bash
# GPT 分区表
wget https://github.com/Yuzhii0718/bl-mt798x-dhcpd/releases/download/2026.04.05-1443-gpt-partition-table/gpt-mt7986-bpi_r3mini-emmc_rfb-Yuzhii_md5-9e2e624b3424cd921e461dff47c24be3_20260405-144309.bin
# BL2 (preloader)
wget https://github.com/Yuzhii0718/bl-mt798x-dhcpd/releases/download/2026.06.05-0921-all/bl2-mt7986_bpi_r3mini-emmc_SP2_md5-d47da400de9ef55950307f8d87d7c385_20260605-092126.img
# FIP (U-Boot)
wget https://github.com/Yuzhii0718/bl-mt798x-dhcpd/releases/download/2026.06.05-0921-all/fip-mt7986_bpi_r3mini-emmc_SP2-Yuzhii-dhcpd_md5-9a5708cfe57cf1600a503179c4aab10d_20260605-092126.bin
第二步:从 NAND 系统操作(推荐,最安全)
为什么从 NAND 刷? Yuzhii 的 U-Boot 需要特定的 GPT 分区表,直接刷会改写整个 eMMC 的分区布局,从正在运行的 eMMC 系统操作会有风险。NAND 系统是独立的,随便折腾 eMMC。
- 将 boot switch 切到 NAND
- 上电启动,记下 NAND 系统的 IP(通常是
192.168.1.1) - SSH 连接:
bash
ssh root@192.168.1.1
第三步:上传文件到开发板
从电脑上传三个文件到开发板的 /tmp 目录:
bash
scp -O gpt-*.bin root@192.168.1.1:/tmp/
scp -O bl2-*.img root@192.168.1.1:/tmp/
scp -O fip-*.bin root@192.168.1.1:/tmp/
如果
scp报错sftp-server: not found,加上-O参数强制使用老版 SCP 协议。
第四步:刷写 eMMC
SSH 到开发板后,依次执行以下命令:
bash
# 1. 刷写 GPT 分区表(写入 eMMC 头部)
dd if=/tmp/gpt-mt7986-bpi_r3mini-emmc_rfb-Yuzhii.bin of=/dev/mmcblk0 bs=512 conv=fsync
echo "GPT done"
# 2. 刷写 BL2 到 eMMC boot 分区
echo 0 > /sys/block/mmcblk0boot0/force_ro
dd if=/tmp/bl2-mt7986_bpi_r3mini-emmc_SP2.img of=/dev/mmcblk0boot0 bs=512 conv=fsync
echo "BL2 done"
# 3. 刷写 FIP 到 LBA 13312(Yuzhii BL2 要求的位置)
dd if=/tmp/fip-mt7986_bpi_r3mini-emmc_SP2-Yuzhii-dhcpd.bin of=/dev/mmcblk0 bs=512 seek=13312 conv=fsync
echo "FIP done"
sync
echo "All done"
第五步:重启测试
- 断电
- 将 boot switch 切回 eMMC
- 上电
- 将电脑用网线连接到开发板(建议先插路由器 LAN 口,或直连电脑并设静态 IP)
- 等待几秒,浏览器打开
http://192.168.1.1
如果一切正常,你会看到 Yuzhii U-Boot 的 Web 界面。
第六步(可选):通过 Web UI 安装 OpenWrt
进入 Yuzhii U-Boot 的 Web UI 后,可以在网页中直接刷写 OpenWrt 系统固件到 eMMC。
关键说明
为什么要先刷 GPT?
Yuzhii 的 U-Boot 使用自己定义的 GPT 分区布局,和 OpenWrt 主线或 frank-w 的布局不同。如果只刷 BL2+FIP 而不刷 GPT,BL2 会在错误的 LBA 位置找 FIP,导致 U-Boot 加载失败,网口不亮。
GPT 分区布局对比:
| 项目 | Yuzhii 布局 | OpenWrt/frank-w 布局 |
|---|---|---|
| FIP 位置 | LBA 13312 | p3 (~LBA 1000) |
| 分区名 | u-boot-env, factory, fip, kernel, rootfs | 不同命名 |
| rootfs 大小 | ~7.4 GB(占满剩余空间) | 通常更小 |
救砖说明
NAND 系统始终保持不动,它就是你的救砖保险。任何时候 eMMC 刷坏了,只需:
#mermaid-svg-n68GfjFwXs2H8xML{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-n68GfjFwXs2H8xML .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-n68GfjFwXs2H8xML .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-n68GfjFwXs2H8xML .error-icon{fill:#552222;}#mermaid-svg-n68GfjFwXs2H8xML .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-n68GfjFwXs2H8xML .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-n68GfjFwXs2H8xML .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-n68GfjFwXs2H8xML .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-n68GfjFwXs2H8xML .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-n68GfjFwXs2H8xML .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-n68GfjFwXs2H8xML .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-n68GfjFwXs2H8xML .marker{fill:#333333;stroke:#333333;}#mermaid-svg-n68GfjFwXs2H8xML .marker.cross{stroke:#333333;}#mermaid-svg-n68GfjFwXs2H8xML svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-n68GfjFwXs2H8xML p{margin:0;}#mermaid-svg-n68GfjFwXs2H8xML .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-n68GfjFwXs2H8xML .cluster-label text{fill:#333;}#mermaid-svg-n68GfjFwXs2H8xML .cluster-label span{color:#333;}#mermaid-svg-n68GfjFwXs2H8xML .cluster-label span p{background-color:transparent;}#mermaid-svg-n68GfjFwXs2H8xML .label text,#mermaid-svg-n68GfjFwXs2H8xML span{fill:#333;color:#333;}#mermaid-svg-n68GfjFwXs2H8xML .node rect,#mermaid-svg-n68GfjFwXs2H8xML .node circle,#mermaid-svg-n68GfjFwXs2H8xML .node ellipse,#mermaid-svg-n68GfjFwXs2H8xML .node polygon,#mermaid-svg-n68GfjFwXs2H8xML .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-n68GfjFwXs2H8xML .rough-node .label text,#mermaid-svg-n68GfjFwXs2H8xML .node .label text,#mermaid-svg-n68GfjFwXs2H8xML .image-shape .label,#mermaid-svg-n68GfjFwXs2H8xML .icon-shape .label{text-anchor:middle;}#mermaid-svg-n68GfjFwXs2H8xML .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-n68GfjFwXs2H8xML .rough-node .label,#mermaid-svg-n68GfjFwXs2H8xML .node .label,#mermaid-svg-n68GfjFwXs2H8xML .image-shape .label,#mermaid-svg-n68GfjFwXs2H8xML .icon-shape .label{text-align:center;}#mermaid-svg-n68GfjFwXs2H8xML .node.clickable{cursor:pointer;}#mermaid-svg-n68GfjFwXs2H8xML .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-n68GfjFwXs2H8xML .arrowheadPath{fill:#333333;}#mermaid-svg-n68GfjFwXs2H8xML .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-n68GfjFwXs2H8xML .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-n68GfjFwXs2H8xML .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-n68GfjFwXs2H8xML .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-n68GfjFwXs2H8xML .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-n68GfjFwXs2H8xML .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-n68GfjFwXs2H8xML .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-n68GfjFwXs2H8xML .cluster text{fill:#333;}#mermaid-svg-n68GfjFwXs2H8xML .cluster span{color:#333;}#mermaid-svg-n68GfjFwXs2H8xML div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-n68GfjFwXs2H8xML .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-n68GfjFwXs2H8xML rect.text{fill:none;stroke-width:0;}#mermaid-svg-n68GfjFwXs2H8xML .icon-shape,#mermaid-svg-n68GfjFwXs2H8xML .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-n68GfjFwXs2H8xML .icon-shape p,#mermaid-svg-n68GfjFwXs2H8xML .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-n68GfjFwXs2H8xML .icon-shape .label rect,#mermaid-svg-n68GfjFwXs2H8xML .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-n68GfjFwXs2H8xML .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-n68GfjFwXs2H8xML .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-n68GfjFwXs2H8xML :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} eMMC 刷坏了
切 boot switch 到 NAND
从 NAND 系统启动
重新刷写 eMMC
切回 eMMC 测试
完全没有变砖风险。
如果刷完网口不亮
- 尝试两个网口都插一下(一个靠近 USB-C 供电口,一个靠外侧)
- 电脑设静态 IP:
192.168.1.2/24,网关192.168.1.1 - 如果还不行,换回 OpenWrt 主线或 BSP 版 U-Boot
其他 U-Boot 来源
| 来源 | 特点 | 链接 |
|---|---|---|
| frank-w | 最活跃,支持完善 | https://github.com/frank-w/u-boot |
| OpenWrt 主线 | 官方维护,稳定 | OpenWrt firmware selector |
| BSP 版 | Banana Pi 官方 SDK,PHY 驱动完整 | 官方 BSP 发布包 |
| Yuzhii DHCPD ⭐ | 有 Web UI、DHCPD、中文界面 | https://github.com/Yuzhii0718/bl-mt798x-dhcpd |
参考链接
- Yuzhii U-Boot 仓库:https://github.com/Yuzhii0718/bl-mt798x-dhcpd
- fw-web.de 维基(最全面):https://wiki.fw-web.de/doku.php?id=en:bpi-r3mini:start
- Banana Pi 官方文档:https://docs.banana-pi.org/en/BPI-R3_Mini/GettingStarted_BPI-R3_Mini
- OpenWrt 官方页面:https://openwrt.org/toh/sinovoip/bananapi_bpi_r3_mini
- kisy 中文救砖教程:https://kisy.dev/posts/bpi-r3mini-uartboot/