Flash Image
Update time:2018-03-15 Views:13094
1 Introduction
This page describes how to flash the image file from the host to the development board's eMMC flash memory, via the Micro USB OTG cable.
Please choose the right way according to the host OS and image file type.
2 Before Start
What you need:
Firefly RK3288 development board
Image file
Host PC
Good Micro USB OTG Cable
There are two types of image file:
Monolithic image, often known as update.img, which contains the bootloader, parameter and all the partition image files. It is used for firmware distribution.
Multiple partition image, like kernel.img, boot.img, recovery.img, etc, which are created during development.
You can find compiled update.img, download and uncompress. Or you can reference Build Android to compile your own image files.
Supported host OS:
Windows XP (32/64bit)
Windows 7 (32/64bit)
Windows 8 (32/64bit)
Linux (32/64bit)
3 Windows
We used to need two utilities to flash rockchip image file:
RKBatchTool, used to flash update.img
RKDevelopTool, used to flash partition image file separately.
Later, Rockchip release new tool: AndroidTool. It is based on RKDevelopTool, but adds flashing support for update.img. Therefore, one utility is sufficient.
Before using the flashing utility, you need to install RK USB driver. If the driver is already installed, you can skip to next step.
3.1 Install RK USB Driver
Download DriverAssistant, uncompress it, then run DriverInstall.exe inside.
In order to use new driver for all the rockchip devices, please select "驱动卸载"(Driver uninstall), then "驱动安装"(Driver install).
3.2 Connect Device
There are two ways to get the device into upgrade mode
One way is to disconnect the power adapter
Use micro USB OTG cable to connect host and device together.
Press and hold RECOVERY key.
Plug in the power
After around two seconds, release RECOVERY key.
One way is to connect the power adapter
Use micro USB OTG cable to connect host and device together.
Press and hold RECOVERY key.
Shortly press RESET key.
After around two seconds, release RECOVERY key.
RECOVERY, RESET, OTG, USB of each device are as follows:
The host will prompt to have new device detected and configured. Open the Device Management, you'll find a new device name "Rockusb Device", as shown below. Return to previous step to reinstall driver if it is not shown.
3.3 Flash Image
Download AndroidTool. Uncompress it and change to directory AndroidTool_Release_v2.33.
AndroidTool defaults to display in Chinese. We need to change it to English. Open config.ini with an text editor (like notepad). The starting lines are:
#选择工具语言:Selected=1(中文);Selected=2(英文) [Language] Kinds=2 Selected=1 LangPath=Language\
Change "Selected=1" to "Selected=2", and save. From now on, AndroidTool will display in English.
Now, run AndroidTool.exe: (Note: If using Windows 7/8, you'll need to right click it, select to run it as Administrator)
3.3.1 Flash update.img
Steps of flashing update.img:
1.Switch to "Upgrade Firmware" tab page.
2.Click "Firmware" button and open the image file. Detail information of the image file, like version and chip, is shown.
3.Click "Upgrade" button to start flash.
4.If upgrade fails, please try "LowerFormat" in the "Download Image" tab page first, then try again.
WARNING: If you flash firmware laoder different version of the original machine, please click "Erase Flash" before upgrading the firmware.
3.3.2 Flash Partition Images
Please Using FFTools/AndroidTool.rar of the SDK , Steps of flashing partition images:
1.Switch to "Download Image" tab page.
2.Check the partitions you want.
3.Make sure the image file's path is correct. Click the rightmost empty table cell to select new path if needed.
4.Click "Run" button to start flashing. Device will reboot automatically when finish.
4 Linux
Rockchip provides a command line utility named "upgrade_tool" under Linux, which support flashing of both update.img and partition images.
We have two choices with regard to open source tools:
rkflashtool https://github.com/Galland/rkflashtool_rk3066
rkflashkit https://github.com/linuxerwang/rkflashkit
Both of them only support flashing partition images, not update.img. rkflashtool is a command line tool, and flashkit has a nice and easy to use GUI with command line support lately added. We only introduce rkflashkit below.
There is no need to install device driver. Just connect the device and host as described in the Windows section.
4.1 upgrade_tool
Download Linux_Upgrade_Tool, and install it to host filesystem:
unzip Linux_Upgrade_Tool_v1.24.zip cd Linux_UpgradeTool_v1.24 sudo mv upgrade_tool /usr/local/bin sudo chown root:root /usr/local/bin/upgrade_tool
Flash update.img:
sudo upgrade_tool uf update.img
Flash partition images:
sudo upgrade_tool di -b /path/to/boot.img sudo upgrade_tool di -k /path/to/kernel.img sudo upgrade_tool di -s /path/to/system.img sudo upgrade_tool di -r /path/to/recovery.img sudo upgrade_tool di -m /path/to/misc.img sudo upgrade_tool di resource /path/to/resource.img sudo upgrade_tool di -p paramater # flash parameter sudo upgrade_tool ul bootloader.bin # flash bootloader
If errors occur due to flash problem, you can try to low format, or erase the flash:
upgrade_tool lf # low format flash upgrade_tool ef # erase flash
4.2 rkflashkit
Install:
sudo apt-get install build-essential fakeroot git clone https://github.com/linuxerwang/rkflashkit cd rkflashkit ./waf debian sudo apt-get install python-gtk2 sudo dpkg -i rkflashkit_0.1.2_all.deb
GUI:
sudo rkflashkit
Command line:
$ rkflashkit --help Usage: <cmd> [args] [<cmd> [args]...] part List partition flash @<PARTITION> <IMAGE FILE> Flash partition with image file cmp @<PARTITION> <IMAGE FILE> Compare partition with image file backup @<PARTITION> <IMAGE FILE> Backup partition to image file erase @<PARTITION> Erase partition reboot Reboot device For example, flash device with boot.img and kernel.img, then reboot: sudo rkflashkit flash @boot boot.img @kernel.img kernel.img reboot
See the example above, which is really handy to flash multiple images then reboot device in one command, especially good for developers who will compile and flash kernel again and again.
5 FAQ
How to Enter MaskRom Mode
If Loader mode is not available and SD card boot also fails, you might need to enforce the device into MaskRom mode. Please check here.