1. 程式人生 > >rkdeveloptool編譯及使用方法

rkdeveloptool編譯及使用方法

rkdeveloptool is a tool from Rockchip to communicate with Rockusb devices, consider to be a opensource version of upgrade_tool with very little difference.

Download rkdeveloptool【工具原始碼下載】

Get the source code for rkdeveloptool

git clone https://github.com/rockchip-linux/rkdeveloptool.git

Build rkdeveloptool【工具原始碼編譯】

First, install the libusb and udev. In Ubuntu, 

sudo apt-get install libudev-dev libusb-1.0-0-dev dh-autoreconf

Then 

autoreconf -i
./configure
make
make install

編譯異常說明

[email protected]:~/Debian_Github/rkdeveloptool$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes

checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out

checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking whether make sets $(MAKE)... (cached) yes
checking whether ln -s works... yes
./configure: line 4269: syntax error near unexpected token `LIBUSB1,libusb-1.0'
./configure: line 4269: `PKG_CHECK_MODULES(LIBUSB1,libusb-1.0)'

如果是Ubuntu14.0系統編譯出錯的話,需要額外安裝以下兩個安裝包:
sudo apt-get install pkg-config libusb-1.0

Usage【使用說明】

Support commands

Tool Usage ---------------------

Help:             -H
Version:          -V
DownloadBoot:    DB <Loader>
UpgradeLoader:    UL <Loader>
ReadLBA:        RL  <BeginSec> <SectorLen> <File>
WriteLBA:        WL  <BeginSec> <File>
WriteGPT:       GPT <parameter>
EraseFlash:        EF 
TestDevice:        TD
ResetDevice:    RD [subcode]
ReadFlashID:    RID
ReadFlashInfo:    RFI
ReadChipInfo:    RCI
-------------------------------------------------------

Flash image to target emmc【燒錄映象至emmc】

In order to flash image to target emmc, 

  1. Make target  get into rockusb mode;
  2. Connect target to Host PC via USB;
  3. Write the image to the eMMC with tool command;
  • use download boot command to make target init DRAM and run usbplug;
rkdeveloptool db rkxx_loader_vx.xx.bin
  • use wl command to write image to target, this step can be repeat for many times;
rkdeveloptool wl 0x40 idbLoader.img
rkdeveloptool wl 0x4000 uboot.img
rkdeveloptool wl 0x8000 boot.img
rkdeveloptool wl 0x40000 rootfs.img
  • usb ul command to write idbloader into idb from rockchip loader
rkdeveloptool ul rkxx_loader_vx.xx.bin

NOTE: The ul command is the same operation with below command when using Rockchip miniloader, but using different source.

rkdeveloptool wl 0x40 idbLoader.img

NOTE2: The ul command in rkdeveloptool(ul= wl idbloader) is different with the command in upgrade_tool(ul = db + wl idbloader + rd).

  • use gpt command to write gpt table with parameter_gpt.txt
rkdeveloptool gpt parameter_gpt.txt
  • use rd comamnd to reset the target after image write complete
rkdeveloptool rd