Linux Upgrade Tool (upgrade_tool)

What is Linux Upgrade Tool

Rockchip’s Linux Upgrade tool is a proprietary solution developed by Rockchip for flashing images onto various storage devices such as SPI, eMMC, SD-card, and more. Unlike open-source rkdeveloptool software, this tool does not provide access to its source code.

Instead, it is distributed solely in binary executable form, allowing users to utilize the provided executable files for the purpose of flashing images onto their desired storage devices.

How to use Linux Upgrade Tool

Installing required system dependencies

Linux Upgrade Tool requires the following dependencies to be installed on your Debian or Ubuntu system.

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

For other Linux distributions, please refer to the following table for the equivalent package names.

Debian/Ubuntu

Fedora

Arch Linux

libudev-dev

libusb-1.0-0-dev

libusb-devel

libusb

Download the Linux_Upgrade_Tool from Vicharak GitHub

git clone https://github.com/vicharak-in/Linux_Upgrade_Tool

Booting the board into MaskROM mode

Tip

MaskROM mode is a special mode that allows the board to be flashed with new firmware.

To boot the board into MaskROM mode, follow the steps below:

  1. Connect the board to your computer using a USB-C cable.

  2. Short the eMMC CLK on the board to GND using a tweezer or a jumper wire.

Alternative Options to boot into MaskROM mode

You can Refer to the Alternative MaskROM boot modes for more information.

  1. After shorting the eMMC CLK to GND, You can now release the Pogo pin.

  2. Confirm that the board is in MaskROM mode by running the following command:

sudo ./upgrade_tool ld
List of rockusb connected(1)

DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=7143 Mode=Maskrom SerialNo=

Important

Understand the firmware file formats before flashing

See the Firmware File Formats

Flashing RAW Image (Raw firmware) using upgrade_tool

Tip

RAW images can be flashed to any storage devices such as SD card, NVMe or eMMC using the dd command or the Linux_Upgrade_Tool.

In the following example we will use the dd command to flash the RAW image to the on-board eMMC on Vicharak Vaaman.

Check for connected devices

sudo ./upgrade_tool ld
List of rockusb connected(1)

DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=7143 Mode=Maskrom SerialNo=

Flash the miniloader loader binary

sudo ./upgrade_tool db rk3399_loader_xxx.bin
Download boot ok.

Writing the RAW GPT Image (Raw Firmware) to the storage device

Danger

Make sure to flash the loader first to the storage device.

sudo ./upgrade_tool wl 0 <some_gpt_image>.img

Example:

sudo ./upgrade_tool wl 0 V1.0.2311.000-vicharak-debian-bullseye-xfce-raw.img
Write LBA OK.

Reboot the device

sudo ./upgrade_tool rd
[sudo] password for vicharak:

Reset Device Success!

Tip

If you encounter Reset Device Fail! then try to manually reboot using the power button on the board or else try removing and re-inserting the USB power cable.


Tip

Alternatively you can directly flash update image to eMMC using RK Firmware method.

RK Firmware method can be used to flash the firmware to the eMMC of the development board or any SD-card using the tools provided by Rockchip.

Flash eMMC Image using (RK Firmware) method

sudo ./upgrade_tool uf <some_rockchip_image>.img

Example:

sudo ./upgrade_tool uf V1.0.2311.000-vicharak-debian-bullseye-xfce-emmc.img
[sudo] password for vicharak:
Loading firmware...
Support Type:330C FW Ver:8.1.00 FW Time:2023-07-07 14:11:41
Loader ver:1.1e Loader Time:2023-07-07 14:11:08
Start to upgrade firmware...
Download Boot Start
Download Boot Success
Wait For Maskrom Start
Wait For Maskrom Success
Test Device Start
Test Device Success
Check Chip Start
Check Chip Success
Get FlashInfo Start
Get FlashInfo Success
Prepare IDB Start
Prepare IDB Success
Download IDB Start
Download IDB Success
Download Firmware Start
Download Image... (12%)

Once the flash is complete, the board will reboot automatically.