LinuxCommandLibrary

rkdeveloptool

Flash firmware to Rockchip devices

TLDR

[l]ist all connected Rockchip-based flash [d]evices

$ rkdeveloptool ld
copy

Initialize the device by forcing it to [d]ownload and install the [b]ootloader from the specified file
$ rkdeveloptool db [path/to/bootloader.bin]
copy

[u]pdate the boot[l]oader software with a new one
$ rkdeveloptool ul [path/to/bootloader.bin]
copy

Write an image to a GPT-formatted flash partition, specifying the initial storage sector (usually 0x0 alias 0)
$ rkdeveloptool wl [initial_sector] [path/to/image.img]
copy

Write to the flash partition by its user-friendly name
$ rkdeveloptool wlx [partition_name] [path/to/image.img]
copy

[r]eset/reboot the [d]evice, exit from the Maskrom/Bootrom mode to boot into the selected flash partition
$ rkdeveloptool rd
copy

SYNOPSIS

rkdeveloptool [options] command [arguments]

Common usage examples:
rkdeveloptool listdevice
rkdeveloptool db <loader_file>
rkdeveloptool writeflash <partition_name> <image_file>
rkdeveloptool upgrade <firmware_image.img>

PARAMETERS

listdevice
    Lists all connected Rockchip devices detected in Maskrom or Loader mode.

db <loader_file>
    Downloads the specified boot loader file to the device's RAM. This is often the first step before further operations.

readflash <partition> <output_file>
    Reads data from a specified flash partition on the device and saves it to a local file.

writeflash <partition> <image_file>
    Writes the content of the specified image file to a designated flash partition on the device.

eraseflash <partition>
    Erases a specific flash partition on the connected device.

reset
    Resets the connected Rockchip device, typically used after flashing operations to reboot.

boot
    Tells the device to boot from its internal storage after a loader has been downloaded.

upgrade <firmware_image.img>
    Performs a complete firmware upgrade using a single unified firmware image file (.img).

readid
    Reads the unique chip ID from the connected device.

test <argument>
    Executes internal test functions (less commonly used by end-users).

DESCRIPTION

rkdeveloptool is a command-line utility designed for interacting with Rockchip-based devices, primarily for firmware development and flashing operations.

It allows users to download boot loaders, flash firmware images (such as ROMs, bootloaders, kernel, and root file systems) to the device's internal storage (e.g., eMMC, NAND, SPI flash), read flash content, erase partitions, and reset the device.

The tool typically communicates with the Rockchip device when it is in a special mode, often referred to as 'Maskrom' mode or 'Loader' mode, which is accessible via a USB connection. It's an indispensable tool for developers working on Rockchip platforms, custom ROMs, or recovering bricked devices.

CAVEATS

rkdeveloptool requires specific USB drivers to be installed and correctly configured on the host system (e.g., libusb and udev rules on Linux, Rockchip drivers on Windows).
The device must be in the correct mode (Maskrom or Loader) for the tool to detect and interact with it, often requiring specific button presses (e.g., recovery button) during power-up.
Incorrect usage, flashing corrupted images, or interrupting the process can lead to device bricking.
Compatibility can vary between different Rockchip SoC models; sometimes specific versions of the tool are required for certain chips or firmware.

TYPICAL FLASHING WORKFLOW

A common workflow involves:
1. Putting the device into Maskrom mode.
2. Running rkdeveloptool listdevice to confirm detection.
3. Downloading the boot loader: rkdeveloptool db <loader.bin>.
4. Flashing individual partitions: rkdeveloptool writeflash <partition> <image> for boot, kernel, rootfs, etc.
5. Resetting the device: rkdeveloptool reset.
Alternatively, for a full image: rkdeveloptool upgrade <firmware.img> after step 3.

MASKROM VS. LOADER MODE

Maskrom mode is a low-level, unchangeable boot mode built into the SoC's ROM, used for initial device detection and downloading a secondary bootloader. Loader mode (or 'Bootloader mode') is entered after a loader is successfully downloaded to RAM, allowing more complex operations like partition flashing and full firmware upgrades. The tool often transitions between these modes automatically or explicitly via commands like db.

HISTORY

rkdeveloptool is developed and maintained by Rockchip, a leading Chinese fabless semiconductor company specializing in SoCs for various devices. The tool has evolved alongside their chip product lines (e.g., RK3288, RK3399, RV1109/RV1126, RK3588), adapting to new hardware features and flashing protocols. It's a fundamental part of the Rockchip SDKs provided to developers and manufacturers, primarily facilitating low-level flashing and debugging of Rockchip silicon from a host PC.

SEE ALSO

fastboot(1), adb(1), dd(1), udev(7)

Copied to clipboard