How to use the command rkdeveloptool (with examples)
The rkdeveloptool
is a versatile command-line utility designed specifically for managing Rockchip-based computer devices. Its primary functions include flashing, dumping, and controlling boot firmware. This tool is essential for developers and technicians who need to interact with Rockchip devices at a fundamental level, especially when manipulating boot firmware or updating device software. Before using rkdeveloptool
, it is usually necessary to put the Rockchip device into a service mode known as Maskrom/Bootrom mode and connect it via USB. Some of its operations require elevated permissions, so running it as root may sometimes be necessary.
Use case 1: List all connected Rockchip-based flash devices
Code:
rkdeveloptool ld
Motivation:
This use case is incredibly useful for anyone managing multiple Rockchip devices connected to a single system. When dealing with several devices, you need a reliable way to ensure that all devices are properly connected and recognized by the system before proceeding with further operations like flashing or updates. Using the ld
command provides a quick overview of all the connected Rockchip devices, helping you avoid confusion or errors during device management.
Explanation:
rkdeveloptool
: This is the primary command that invokes the tool for managing Rockchip devices.ld
: This subcommand stands for “list devices,” and it tellsrkdeveloptool
to scan and display all connected Rockchip-based devices.
Example output:
DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=12041 Maskrom
This output indicates that device number 1 with Vendor ID 0x2207
and Product ID 0x330c
is connected and recognized in Maskrom mode.
Use case 2: Initialize the device by forcing it to download and install the bootloader from the specified file
Code:
rkdeveloptool db path/to/bootloader.bin
Motivation:
Initializing a device with a bootloader is a critical step, especially when setting up a new device or recovering one that has a corrupted bootloader. This command helps in setting up the initial environment that the device needs to function correctly. It’s the cornerstone for getting the device ready for further operations like installing operating systems or performing firmware updates.
Explanation:
rkdeveloptool
: The command-line utility for managing Rockchip devices.db
: This subcommand stands for “download bootloader,” which instructs the tool to download a bootloader file onto the connected device.path/to/bootloader.bin
: This argument specifies the path to the bootloader binary file that you want to download onto the device. It must be a valid path to a bootloader file compatible with the device.
Example output:
Downloading bootloader succeeded.
This output signifies that the bootloader file has been successfully downloaded and installed on the device.
Use case 3: Update the bootloader software with a new one
Code:
rkdeveloptool ul path/to/bootloader.bin
Motivation:
Updating the bootloader is often necessary to bring new features, security patches, or compatibility improvements to a device. This command is especially beneficial when a new version of the bootloader is released, addressing previous issues or providing enhancements. Keeping the bootloader updated ensures optimal operation of the device and can sometimes fix strange behavior caused by outdated firmware.
Explanation:
rkdeveloptool
: The command-line tool used for working with Rockchip devices.ul
: This subcommand stands for “update bootloader,” directingrkdeveloptool
to update the existing bootloader on the device with the one provided.path/to/bootloader.bin
: Specifies the path to the new bootloader binary that you aim to upload to the device.
Example output:
Updating bootloader succeeded.
This message indicates that the bootloader update operation completed successfully.
Use case 4: Write an image to a GPT-formatted flash partition, specifying the initial storage sector
Code:
rkdeveloptool wl 0x0 path/to/image.img
Motivation:
Writing an image to a device’s storage is a common task when setting up new software environments or deploying complete system images. This command is particularly handy when you need to deploy a custom OS or application onto a device that starts from a specific sector. Specifying the initial sector helps in precisely targeting the storage area where the image should be written, crucial for avoiding data overlap or corruption.
Explanation:
rkdeveloptool
: The command-line utility for Rockchip device management.wl
: This subcommand stands for “write LBA,” meaning you’re instructing the tool to write an image at a particular Logical Block Address.0x0
: This is a hex representation of the initial sector, typically indicating the starting point (0) of storage.path/to/image.img
: This argument points to the image file that you wish to write to the device’s storage.
Example output:
Writing image succeeded.
This output confirms that the image has been successfully written to the specified sector of the device’s flash storage.
Use case 5: Write to the flash partition by its user-friendly name
Code:
rkdeveloptool wlx partition_name path/to/image.img
Motivation:
This use case is beneficial when the partition layout of a device is known by names rather than numeric sector addresses. It allows a more human-readable approach to managing where images and files are written on the device. This method reduces the chance of errors associated with directly manipulating sector addresses, making it easier for users to identify and use specific partitions.
Explanation:
rkdeveloptool
: The command for managing Rockchip-based devices.wlx
: This extension of the write command uses partition names, making it easier to work with known partitions by name rather than sector numbers.partition_name
: Specifies the target partition’s name where the image will be written. This name should be recognized by the system and associated with a specific part of the storage.path/to/image.img
: Points to the file that you wish to write onto the specified partition.
Example output:
Writing to partition 'partition_name' succeeded.
This output confirms that the data has been successfully written to the specified partition by its name.
Use case 6: Reset/reboot the device, exiting from Maskrom/Bootrom mode
Code:
rkdeveloptool rd
Motivation:
After making changes to the bootloader or writing new images, a device may need to be reset or rebooted to apply these changes. This command is essential for transitioning the device out of the special service modes (Maskrom/Bootrom) and back into normal operation, where it can boot from the newly updated or installed software. It serves as the culmination of the flashing process, reestablishing normal device operation.
Explanation:
rkdeveloptool
: The utility used for controlling Rockchip devices.rd
: This subcommand stands for “reset device,” instructing the tool to reboot the connected device and exit from its service mode.
Example output:
Rebooting the device succeeded.
This output indicates that the device has been successfully reset and should now boot into normal operation from the updated configuration.
Conclusion:
In summary, the rkdeveloptool
is a powerful utility for managing Rockchip-based devices, offering precise control over bootloader operations and image deployments. Each of its subcommands provides specific functionalities that are crucial for initializing, updating, managing, and rebooting devices, making it an indispensable tool for developers and technicians working within the Rockchip ecosystem. By providing clear syntax and feedback, it ensures a smooth workflow for managing device firmware and operational states.