Difference between revisions of "APITestPage"

From FriendlyELEC WiKi
Jump to: navigation, search
(updated by API)
(updated by API)
 
(100 intermediate revisions by the same user not shown)
Line 1: Line 1:
====烧写系统到eMMC====
 
=====方法1: 在网页上烧写=====
 
使用刷写了FriendlyWrt固件的TF卡启动{{{1}}}, 登录FriendlyWrt页面, 在网页菜单上点击 "系统" -> "eMMC刷机助手" 进入eMMC刷机助手界面, 点击界面上的 "选择文件" 按钮, 选择你要刷写的文件 (官方固件以rk3399-sd开头), 亦可选择第三方固件, 文件支持 .gz 格式的压缩文件, 或者以 .img 作为扩展名的raw格式。<br/><br/>
 
选择文件后, 点击 “上传并烧写” 按钮, 开始上传并烧写, 如下图所示:<br/>
 
[[File:Friendlywrt-emmctools2-cn.png|frameless|600px]]<br/>
 
烧写完成后,请弹出SD卡,设备会自动重启, 并从eMMC引导新系统,可留意指示灯的状态, 在系统状态灯闪烁,同时网卡状态灯亮起时,表示系统启动完成, 如果eMMC安装的系统是 FriendlyWrt, 则可以通过点击“进入首页”进入FriendlyWrt管理页面。<br />
 
需要注意的是, 如果烧写的是FriendlyElec的固件, 网页烧写需要选用文件名带 "-sd-" 字样的镜像文件, 类拟如下的文件名:
 
{| class="wikitable"
 
|-
 
  | rk3399-sd-friendlywrt-21.02-YYYYMMDD.img.gz
 
|-
 
  | rk3399-sd-friendlywrt-21.02-docker-YYYYMMDD.img.gz
 
|}
 
第三方固件由于命名不规则,你需要确认的是:此固件是支持从eMMC启动的,如果文件格式是7z、zip或者rar格式, 需要先解压缩, 如果文件太大无法写入, 可以先压缩成 .gz 格式再尝试。
 
  
=====方法2: 用TF启动卡进行自动烧写=====
+
{{RockchipUnbrick|NanoPC-T4}}
======烧写系统固件到eMMC======
+
* 此方法是通过SD卡启动一个小型的Linux系统, 然后自动运行一个名为EFlasher的工具来将固件烧写到eMMC中。<br />
+
* 通过LED灯来掌握烧写进度。<br />
+
<br />
+
访问[http://download.friendlyelec.com/{{#replace:{{#replace:{{BASEPAGENAME}}| |}}|/zh|}} 此处的下载地址]下载需要的固件文件(位于"01_系统固件/02_SD卡刷机固件(SD-to-eMMC)"目录)和烧写工具(位于"05_工具软件"目录):<br />
+
{| class="wikitable"
+
|-
+
  | colspan=2 | '''固件文件'''
+
|-
+
  | rk3399-eflasher-friendlywrt-21.02-YYYYMMDD.img.gz
+
  | [[How to Build FriendlyWrt|FriendlyWrt]]系统固件,基于OpenWrt 21.02.3构建,内核版本 5.15.y
+
|-
+
  | rk3399-eflasher-friendlywrt-21.02-docker-YYYYMMDD.img.gz
+
  | 预装了Docker的[[How to Build FriendlyWrt|FriendlyWrt]]系统固件,基于OpenWrt 21.02.3构建,内核版本 5.15.y
+
|-
+
  | rk3399-eflasher-debian-buster-desktop-4.19-arm64-20220725.img.gz
+
  | Debian10系统固件,内核版本 4.19.y
+
|-
+
  | rk3399-eflasher-friendlycore-lite-focal-5.15-arm64-YYYYMMDD.img.gz
+
  | 精简版64位FriendlyCore系统固件,基于Ubuntu core 20.04构建,内核版本 5.15.y
+
|-
+
  | colspan=2 | '''Flash Utility:'''
+
|-
+
  | win32diskimager.rar
+
  | Windows utility. Under Linux users can use "dd"
+
|}
+
详细操作步骤如下:<br />
+
* 准备一张8G或以上容量的SDHC卡;
+
* 下载并解压 固件文件rk3399-eflasher-OSNAME-YYYYMMDD.img.gz 和 工具win32diskimager;
+
* 在Windows下以管理员身份运行 win32diskimager,在界面上选择你的SD卡盘符,选择解压后的[[EFlasher/zh|EFlasher]]固件,点击 Write 按钮烧写到SD卡; 或者在 Linux下使用 dd 命令将 rk3399-eflasher-OSNAME-YYYYMMDD.img 写入 SD卡;
+
* 将SD卡从电脑端弹出,插入{{{1}}}的microSD卡槽;
+
* 连接{{{1}}}的电源,系统会从SD卡启动,并自动启动 [[EFlasher/zh|EFlasher]] 烧写工具将系统安装到 eMMC, 可以通过板载 LED 灯来了解安装进度:
+
{| class="wikitable"
+
|-
+
! 进度
+
! SYS灯 (红灯)
+
! LAN灯(绿灯)
+
! WAN灯(绿灯)
+
|-
+
| 上电开机
+
| 长亮
+
| 灭
+
| 灭
+
|-
+
| 系统启动
+
| 慢闪
+
| 灭
+
| 灭
+
|-
+
| 正在烧写
+
| 快闪
+
| 灭
+
| 灭
+
|-
+
| 烧写完成
+
| 慢闪
+
| 长亮
+
| 长亮
+
|}
+
* 烧写完成后,切断电源,然后从{{{1}}}端弹出SD卡,重新上电开机,{{{1}}}会从eMMC启动你刚刚烧写的系统;
+
======烧写flash镜像文件到eMMC======
+
* 自动烧写(默认行为)
+
1) 从[http://download.friendlyelec.com/{{#replace:{{#replace:{{BASEPAGENAME}}| |}}|/zh|}} 网盘]上下载文件名带 '''eflasher''' 字样的任意固件, 解压后烧进TF卡;<br />
+
2) 重新拨插一次TF卡, PC上会出现一个名为FriendlyARM的盘符(Linux下是FriendlyARM目录), 将 .img 或者 .gz结尾的固件复制进去;<br />
+
3) 编辑TF卡上的 eflasher.conf 配置文件, 修改 autoStart= 后面的值指定为你的固件文件名, 例如:<br />
+
<syntaxhighlight lang="bash">
+
autoStart=openwrt-rockchip-armv8_nanopi-ext4-sysupgrade.img.gz
+
</syntaxhighlight>
+
支持文件名带 "-sd-" 字样的镜像文件, 如下所示:
+
{| class="wikitable"
+
|-
+
  | rk3399-sd-friendlywrt-21.02-YYYYMMDD.img.gz
+
|-
+
  | rk3399-sd-friendlywrt-21.02-docker-YYYYMMDD.img.gz
+
|-
+
  | rk3399-sd-friendlywrt-22.03-YYYYMMDD.img.gz
+
|-
+
  | rk3399-sd-friendlywrt-22.03-docker-YYYYMMDD.img.gz
+
|}
+
4) 安全弹出TF卡, 将TF卡放在{{{1}}}上上电启动, 会自动烧写你的固件, 通过板载 LED 灯来了解安装进度;<br />
+
=====方法3: 通过USB烧写=====
+
======步骤1: 安装USB驱动和工具======
+
从[http://download.friendlyelec.com/{{#replace:{{#replace:{{BASEPAGENAME}}| |}}|/zh|}} 网盘]的tools目录下载瑞芯微的USB驱动: DriverAssitant_v5.1.1.zip, 解压后安装; <br />
+
在相同目录下, 下载瑞芯微开发工具: RKDevTool_Release_v2.84.zip, 解压后备用; <br />
+
======步骤2: 将{{{1}}}与电脑连接, 并进入刷机模式======
+
1) 断开{{{1}}}上连接的USB和电源线, 弹出TF卡;<br />
+
2) 按住Mask按键不放, 插上电源, 保持按住Mask键, 状态灯亮起3秒后即可松开;<br />
+
3) 用USB A-to-A数据线 (也叫USB公对公数据线), 将{{{1}}}与电脑进行连接, 连接方法参照下图, 需要连接靠近外侧的USB端口:<br />
+
[[File:Nanopir4se-usba-to-usba.jpg|frameless|400px]]<br />
+
======步骤3: 烧写固件到eMMC======
+
固件格式一般有两种格式, 一种是单个的image文件, 通常第三方固件会使用这种打包方式, 另一种是多个分区镜像, FriendlyELEC的固件采用这种方式, 下面分别对这两种格式的固件进行说明:
+
* 选项1: 烧写打包成单个image文件的固件<br />
+
在电脑上双击 RKDevTool_Release_v2.84 目录下的 RKDevTool.exe 启动瑞芯微开发工具, 与电脑连接正常的情况下, 瑞芯微开发工具界面上会显示 "发现一个Maskrom设备";<br />
+
在瑞芯微开发工具界面上, 点击 “升级固件”, 再点击 “固件” 按钮, 选择你要烧写的image文件, 点击 “升级” 然后等待烧写完成即可, 完成后设备会自动重启, 并从eMMC启动你刚刚安装的系统;<br />
+
* 选项2: 烧写由多个分区镜像组成的固件<br />
+
根据需要到[http://download.friendlyelec.com/{{#replace:{{#replace:{{BASEPAGENAME}}| |}}|/zh|}} 网盘]上下载对应的压缩包, 在电脑上解压:
+
{| class="wikitable"
+
|-
+
  | colspan=2 | '''固件文件'''
+
|-
+
  | rk3399-usb-friendlywrt-21.02-YYYYMMDD.img.gz
+
  | 精简版[[How to Build FriendlyWrt|FriendlyWrt]]系统固件,基于OpenWrt 21.02.3构建,内核版本 5.15.y
+
|-
+
  | rk3399-usb-friendlywrt-21.02-docker-YYYYMMDD.img.gz
+
  | 预装了Docker的[[How to Build FriendlyWrt|FriendlyWrt]]系统固件,基于OpenWrt 21.02.3构建,内核版本 5.15.y
+
|-
+
  | rk3399-usb-debian-buster-desktop-arm64-YYYYMMDD.img.gz
+
  | Debian10 系统固件,内核版本 4.19.y
+
|-
+
  | rk3399-usb-friendlycore-lite-focal-5.10-arm64-YYYYMMDD.img.gz
+
  | 精简版64位FriendlyCore系统固件,基于Ubuntu core 20.04构建,内核版本 5.15.y
+
|}
+
解压后, 可以看到固件目录下已内置了瑞芯微开发工具和预设好的配置文件, 双击 RKDevTool.exe 启动瑞芯微开发工具, 界面上会显示 "发现一个Maskrom设备", 点击界面上的“执行”按钮, 稍等片刻即可完成烧写, 完成后设备会自动重启, 并从eMMC启动你安装的系统;<br />
+

Latest revision as of 09:23, 4 June 2024

1 Unbricking Method

If the ROM is not installed correctly, causing the development board to become bricked, and you might not have the opportunity to reinstall the ROM via an SD card, you need to enter Maskrom mode to unbrick it by erasing the storage device.

1.1 Windows Users

1.1.1 Download Required Files

  • Get the necessary tools: Visit here, find RKDevTool_v3.19_for_window.zip and DriverAssitant_v5.12.zip in the 05_Tools directory, and download them to your local machine.
  • Install Rockchip USB driver and RKDevTool: Extract DriverAssitant_v5.12.zip to install the Rockchip USB driver, and extract RKDevTool_v3.19_for_window.zip to obtain the Rockchip flashing tool RKDevTool.
  • Get the loader: Visit here, enter the tools directory corresponding to your CPU model, and download MiniLoaderAll.bin.

1.1.2 Enter Maskrom Mode to Erase the Storage Device

  • Connect NanoPC-T4 to your computer using a USB data cable.
  • Start RKDevTool on your computer.
  • Disconnect the power from NanoPC-T4, hold down the MASK button, connect the power, and release the button when you see Found One MASKROM Device displayed at the bottom of the interface, as shown below:

Rkdevtool found one maskrom device.png

  • Click the Advanced Function tab in the RKDevTool interface.
  • In the Boot text box, select MiniLoaderAll.bin, then click the Download button.
  • Select EMMC, click Switch Storage, then click the EraseAll button to erase the eMMC.

Rkdevtool erase emmc.png

  • At this point, NanoPC-T4 is restored to its initial state and can be normally booted via SD card or eMMC.

1.2 Linux/Mac Users

1.2.1 Download the Required Files

  • Get the necessary tools: Visit here and find upgrade_tool_v2.30_for_linux.tgz (or for Mac users, select upgrade_tool_v2.25_for_mac.tgz) in the 05_Tools directory and download it locally.
  • Get the loader: Visit here, enter the tools directory corresponding to your CPU model, and download MiniLoaderAll.bin.

1.2.2 Installation for upgrade_tool

The following commands are for Linux, with only slight differences in file and directory names for Mac users:

tar xzf upgrade_tool_v2.30_for_linux.tgz
cd upgrade_tool_v2.30_for_linux
sudo cp upgrade_tool /usr/local/sbin/
sudo chmod 755 /usr/local/sbin/upgrade_tool

1.2.3 Enter Maskrom Mode to Erase the Storage Device

  • Connect NanoPC-T4 to the computer using a USB data cable.
  • Disconnect the power from NanoPC-T4, hold down the MASK button, connect the power, and release the button after 4 seconds.
  • Check the connection with the following command:
upgrade_tool LD

A result similar to "DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=13 Mode=Maskrom SerialNo=" indicates that the device has been detected.

  • Erase the eMMC with the following command:
upgrade_tool EF MiniLoaderAll.bin
  • At this point, NanoPC-T4 has been restored to its initial state and can boot the system normally via SD card or eMMC.