Firmware Upgrade Using USB Cable

Introduction

This article explains how to burn firmware from a host computer to the LKD3566 development board’s storage via a double male USB cable. When upgrading, it is necessary to choose the appropriate upgrade method based on the host operating system and the type of firmware.

Preparation Tools

  • LKD3568 development board

  • Host computer

  • A good quality double male USB cable

Preparing the Firmware

The firmware can be obtained by compiling the SDK or downloaded from Download the network disk。There are generally two types of firmware files:

Unified Firmware

  • Unified firmware is a single file that packages all files such as the partition table, bootloader, uboot, kernel, system, etc. Neardi’s officially released firmware uses the unified firmware format. Upgrading with unified firmware will update all partition data and the partition table on the motherboard and erase all data on the motherboard.

Multiple Partition Images

  • These are independent files for each function, such as the partition table, bootloader, kernel, etc., generated during the development stage. Independent partition images can update specified partitions only, keeping other partition data intact, which is convenient for debugging during development.

With the unified firmware unpacking/packing tool, you can unpack a unified firmware into multiple partition images or combine multiple partition images into one unified firmware.

Installing the Burning Tool

Windows Operating System

  • Install RK USB Driver Download  Release_DriverAssistant.zip,unzip it, and then run DriverInstall.exe inside. To ensure all devices use the updated driver, first select Uninstall Driver, then select Install Driver.

    ../_images/usb_drv.png

Download  Burning tool RKDevTool_Release_v2.91,unzip it, and run  RKDevTool.exe inside the  RKDevTool_Release_v2.91  directory(note, if it’s Windows 7/8, you need to right-click and select to run as administrator), as shown below:

../_images/RKDevTool_Adb.png

Linux Operating System

No device driver installation is required under Linux.

  • Linux_Upgrade_Tool Download  Linux_Upgrade_Tool and install it into the system using the following method for easy access:

unzip Linux_Upgrade_Tool_xxxx.zip
cd Linux_UpgradeTool_xxxx
sudo mv upgrade_tool /usr/local/bin
sudo chown root:root /usr/local/bin/upgrade_tool
sudo chmod a+x /usr/local/bin/upgrade_tool
  • Linux_adb_fastboot Tool Download  Linux_adb_fastboot and install it into the system using the following method for easy access:

sudo mv adb /usr/local/bin
sudo chown root:root /usr/local/bin/adb
sudo chmod a+x /usr/local/bin/adb
sudo mv fastboot /usr/local/bin
sudo chown root:root /usr/local/bin/fastboot
sudo chmod a+x /usr/local/bin/fastboot

Entering Upgrade Mode

There are usually two modes for upgrading firmware: Loader mode and MaskRom mode. Before burning the firmware, we need to connect the device and put the board into an upgradable mode.

Loader Mode

Entering Loader Mode via Hardware

The steps to enter Loader upgrade mode by pressing the Update button on the device are as follows:

  • First, disconnect the power adapter.

  • Use a double male USB cable to connect one end to the host computer and the other end to the development board.

../_images/otg.png

  • Hold down the Update (Recovery) button on the device and keep it pressed.

../_images/update.png

  • Connect the power.

  • After about two seconds, release the Update button.

Entering Loader Mode via Software

After connecting the double male USB cable, run the following command on the serial port debugging terminal or adb shell to the board:

reboot loader

Checking Loader Mode

To confirm whether the board has entered Loader mode, we can check with the tool.

Windows Operating System

The AndroidTool tool will show a prompt at the bottom saying Found one LOADER device.

../_images/RKDevTool_Loader.png

If you have performed the “Enter Loader Mode” operation and still do not see the burning tool prompt LOADER, you can check if the Windows host has a prompt for discovering new hardware and configuring the driver. Open Device Manager, and you will see a new device  RockusbDevice  appear, as shown below. If not, you can go back to the previous step and [reinstall the driver].

Linux Operating System

Running upgrade_tool will show a Loader prompt when connected to the device:

neardi@T-chip:~/$ sudo upgrade_tool
List of rockusb connected
DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=106    Loader
Found 1 rockusb,Select input DevNo,Rescan press <R>,Quit press <Q>:q

MaskRom Mode

For the method to enter MaskRom mode, please refer to [MaskRom Mode].

Burning the Firmware

Windows Operating System

Burning Unified Firmware update.img

../_images/AndroidTool_Upgrade_IMG.png

The steps for burning the unified firmware update.img are as follows:

  1. Switch to the Upgrade Firmware page.

  2. Press the Firmware button to open the firmware file to be upgraded. The upgrade tool will display detailed firmware information.

  3. Press the Upgrade button to start the upgrade.

  4. If the upgrade fails, you can try pressing the Erase Flash button to erase the Flash and then upgrade again. Note: If the firmware loader version you are burning is inconsistent with the original machine, please perform Erase Flash before upgrading the firmware.

Burning Partition Images

../_images/AndroidTool_Upgrade_Firmwares.png

The steps for burning partition images are as follows:

  1. Switch to the Download Image page.

  2. Check the partitions that need to be burned; multiple selections are possible.

  3. Ensure the image file path is correct; if necessary, click the blank table cell to the right of the path to reselect.

  4. Click the Upgrade button to start the upgrade; the device will automatically restart after the upgrade is completed.

Linux Operating System

Burning Unified Firmware update.img

sudo upgrade_tool uf update.img

If the upgrade fails, you can try erasing and then upgrading again.

# To erase flash using the ef parameter, you need to specify the loader file or the corresponding update.img
sudo upgrade_tool ef update.img   #update.img :the Ubuntu firmware you need to burn
# Re-burn
sudo upgrade_tool uf update.img

Burning Partition Images

sudo upgrade_tool di -b /path/to/boot.img
sudo upgrade_tool di -r /path/to/recovery.img
sudo upgrade_tool di -m /path/to/misc.img
sudo upgrade_tool di -u /path/to/uboot.img
sudo upgrade_tool di -dtbo /path/to/dtbo.img
sudo upgrade_tool di -p paramater   #Burn parameter
sudo upgrade_tool ul bootloader.bin # Burn bootloader

If there are flash issues causing errors during the upgrade, you can try low-level formatting and erasing emmc:

sudo upgrade_tool lf update.img  # Low-level format
sudo upgrade_tool ef update.img  # Erase

Fastboot burning dynamic partitions:

adb reboot fastboot # Enter bootloader
sudo fastboot flash vendor vendor.img
sudo fastboot flash system system.img
sudo fastboot reboot # Restart after successful burning

Common Issues

How to Force Enter MaskRom Mode

If the board cannot enter Loader mode, you can try to forcibly enter MaskRom mode.

Analysis of Burning Failure

If there is a Download Boot Fail during the burning process, or if there are errors during the burning process, as shown below, it is usually due to poor USB cable connection, inferior cable material, or insufficient driving capability of the computer’s USB port. Please replace the USB cable or the computer’s USB port for troubleshooting.