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.
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.
Supported host OS:
- Windows XP （32/64bit
- Windows 7 (32/64bit)
- Windows 8 (32/64bit)
- Linux (32/64bit)
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.
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).
- Keep device power on.
- 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.
- Note:If device still can not be found after pressing RESET, then try this: long press PWRKEY after short pressing of RESET, before finally releasing RECOVERY.
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.
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)
Steps of flashing update.img:
- Switch to "Upgrade Firmware" tab page.
- Click "Firmware" button and open the image file. Detail information of the image file, like version and chip, is shown.
- Click "Upgrade" button to start flash.
- 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.
Flash Partition Images
Please Using FFTools/AndroidTool.rar of the SDK , Steps of flashing partition images:
- Switch to "Download Image" tab page.
- Check the partitions you want.
- Make sure the image file's path is correct. Click the rightmost empty table cell to select new path if needed.
- Click "Run" button to start flashing. Device will reboot automatically when finish.
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.
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
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
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
- 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.
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.