User:Talpa/Using rkdeveloptool

From PINE64
Revision as of 13:24, 15 January 2023 by Talpa (talk | contribs) (Copied more of the build instructions)
Jump to navigation Jump to search

Using rkdeveloptool

rkdeveloptool is a command line tool that can communicate with a some Rockchip SOCs like the RK3566 in the PineNote when they are in maskrom/download mode.

rkdeveloptool can among other things read and write to the eMMC inside the PineNote.

It is therefor useful for backups and installing an OS to the PineNote.

About the boot process of the PineNote

When the RK3566 is powered on it checks the attached storage devices in the boot order:

 SPI NOR flash
 SPI NAND flash
 eMMC
 SD-Card

In the case of the PineNote there is only the eMMC

If the SOC finds a storage device with a valid ID BLOCK it proceeds to boot from the device.

If no usable storage device is found the ROM in the SOC enters maskrom mode and awaits a connection over USB

The PineNote additionally has a magnet sensor that is read by U-Boot during startup and if it detects a magnet U-Boot places the device in USB download mode


Compiling rkdeveloptool

Pine64 develops a forked version of the rkdeveloptool by RockChip, the following describes how to build the fork:

You will need to have libusb 1.0, its development headers and scdoc installed.

 git clone https://gitlab.com/pine64-org/quartz-bsp/rkdeveloptool.git
 cd rkdeveloptool
 mkdir build
 cd build
 cmake ..

This sets up all the build files. You can then compile with make inside the build directory.

After you're done, you'll likely also need to install the udev rules, or else your user won't have permission to access the USB devices:

 sudo cp 99-rk-rockusb.rules /etc/udev/rules.d/
 sudo udevadm control --reload

Copying the udev rules is also performed automatically when you make install.