Difference between revisions of "Rkdeveloptool"

From Rockchip open source Document
Jump to: navigation, search
(Created page with " = Download rkdeveloptool = Get the source code for rkdeveloptool <pre>git clone https://github.com/rockchip-linux/rkdeveloptool.git</pre>   = Build rkdeveloptool = F...")
 
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
 +
rkdeveloptool is a tool from Rockchip to communicate with Rockusb devices, consider to be a opensource version of ''upgrade_tool'' with very little&nbsp;difference.
 +
 +
&nbsp;
  
 
= Download rkdeveloptool =
 
= Download rkdeveloptool =
  
 
Get the source code for rkdeveloptool
 
Get the source code for rkdeveloptool
<pre>git clone https://github.com/rockchip-linux/rkdeveloptool.git</pre>
+
<pre>git clone https://github.com/rockchip-linux/rkdeveloptool.git
 +
</pre>
 +
 
  
&nbsp;
 
  
 
= Build rkdeveloptool =
 
= Build rkdeveloptool =
  
 
First, install the libusb and udev. In Ubuntu,&nbsp;
 
First, install the libusb and udev. In Ubuntu,&nbsp;
<pre>sudo apt-get install libudev-dev libusb-1.0-0-dev</pre>
+
<pre>sudo apt-get install libudev-dev libusb-1.0-0-dev dh-autoreconf</pre>
  
 
Then&nbsp;
 
Then&nbsp;
<pre>sudo make && make install</pre>
+
<pre>autoreconf -i
 +
./configure
 +
make
 +
make install
 +
</pre>
 +
 
 +
&nbsp;
 +
 
 +
If you encounter compile error like below
 +
<pre>./configure: line 4269: syntax error near unexpected token `LIBUSB1,libusb-1.0'
 +
./configure: line 4269: `PKG_CHECK_MODULES(LIBUSB1,libusb-1.0)'
 +
</pre>
 +
 
 +
You should install pkg-config libusb-1.0
 +
<pre>sudo&nbsp;apt-get&nbsp;install&nbsp;pkg-config&nbsp;libusb-1.0&nbsp;
 +
</pre>
  
 
= Usage =
 
= Usage =
  
---------------------Tool Usage ---------------------<br/> Help: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -H<br/> Version: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-V<br/> DownloadBoot:&nbsp;&nbsp; &nbsp;DB <Loader><br/> ReadLBA:&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;RL &nbsp;<BeginSec> <SectorLen> <File><br/> WriteLBA:&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;WL &nbsp;<BeginSec> <File><br/> EraseFlash:&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;EF&nbsp;<br/> TestDevice:&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;TD<br/> ResetDevice:&nbsp;&nbsp; &nbsp;RD [subcode]<br/> ReadFlashID:&nbsp;&nbsp; &nbsp;RID<br/> ReadFlashInfo:&nbsp;&nbsp; &nbsp;RFI<br/> ReadChipInfo:&nbsp;&nbsp; &nbsp;RCI<br/> -------------------------------------------------------
+
== Support commands ==
 +
 
 +
----
 +
 
 +
Tool Usage ---------------------
 +
 
 +
Help: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -H<br/> Version: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-V<br/> DownloadBoot:&nbsp;&nbsp; &nbsp;DB <Loader><br/> UpgradeLoader:&nbsp;&nbsp; &nbsp;UL <Loader><br/> ReadLBA:&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;RL &nbsp;<BeginSec> <SectorLen> <File><br/> WriteLBA:&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;WL &nbsp;<BeginSec> <File><br/> WriteGPT: &nbsp; &nbsp; &nbsp; GPT <parameter><br/> EraseFlash:&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;EF&nbsp;<br/> TestDevice:&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;TD<br/> ResetDevice:&nbsp;&nbsp; &nbsp;RD [subcode]<br/> ReadFlashID:&nbsp;&nbsp; &nbsp;RID<br/> ReadFlashInfo:&nbsp;&nbsp; &nbsp;RFI<br/> ReadChipInfo:&nbsp;&nbsp; &nbsp;RCI<br/> -------------------------------------------------------<br/> &nbsp;
 +
 
 +
&nbsp;
 +
 
 +
&nbsp;
 +
 
 +
== Flash image to target emmc ==
 +
 
 +
In order to flash image to target emmc,&nbsp;
 +
 
 +
#Make target&nbsp;&nbsp;get into [[Rockusb|rockusb mode]];
 +
#Connect target to Host PC via USB;
 +
#Write the image to the eMMC with tool command;
 +
<ul style="margin-left: 40px;">
 +
<li>use&nbsp;download boot command to make target init DRAM and run usbplug;</li>
 +
</ul>
 +
<pre style="margin-left: 80px;">rkdeveloptool db rkxx_loader_vx.xx.bin</pre>
 +
<ul style="margin-left: 40px;">
 +
<li>use ''wl'' command to write image to target, this step can be repeat for many times;</li>
 +
</ul>
 +
<pre style="margin-left: 80px;">rkdeveloptool wl 0x40 idbLoader.img
 +
rkdeveloptool wl 0x4000 uboot.img
 +
rkdeveloptool wl 0x8000 boot.img
 +
rkdeveloptool wl 0x40000 rootfs.img</pre>
 +
<ul style="margin-left: 40px;">
 +
<li>usb ''ul'' command to write idbloader into idb from rockchip loader</li>
 +
</ul>
 +
<pre style="margin-left: 80px;">rkdeveloptool ul rkxx_loader_vx.xx.bin</pre>
 +
 
 +
'''NOTE''':&nbsp;The ''ul'' command is the same operation with below command when using Rockchip miniloader, but using different source.
 +
<pre style="margin-left: 80px;">rkdeveloptool wl 0x40 idbLoader.img</pre>
 +
 
 +
'''NOTE2''': The ''ul&nbsp;''command in rkdeveloptool(ul= wl idbloader) is different with the command in '''upgrade_tool'''(ul = db + wl idbloader + rd).
 +
<ul style="margin-left: 40px;">
 +
<li>use ''gpt'' command to write gpt table with parameter_gpt.txt</li>
 +
</ul>
 +
<pre style="margin-left: 80px;">rkdeveloptool gpt parameter_gpt.txt</pre>
 +
<ul style="margin-left: 40px;">
 +
<li>use ''rd'' comamnd to reset the target after image write complete</li>
 +
</ul>
 +
<pre style="margin-left: 80px;">rkdeveloptool rd</pre>
 +
 
 +
&nbsp;
 +
 
 +
= See also =
 +
 
 +
[[Partitions|Rockchip Linux partitions definition]]
 +
 
 +
[[Boot_option|Boot_option]]
 +
 
 +
[[Rockusb|Rockusb]]

Latest revision as of 07:36, 30 August 2017

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

 

If you encounter compile error like below

./configure: line 4269: syntax error near unexpected token `LIBUSB1,libusb-1.0'
./configure: line 4269: `PKG_CHECK_MODULES(LIBUSB1,libusb-1.0)'

You should install pkg-config libusb-1.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

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

 

See also

Rockchip Linux partitions definition

Boot_option

Rockusb