January 26, 2022

Orange Pi 4 (Rockchip 3399) USB download

I have known for some time that there is a way to download images into the board via USB. The on chip bootloader supports this, or at least advertises the capability.

I have a board with no mmc installed (due to my oversight when ordering). It occured to me that without mmc or an SD card, it would have no real alternative other than to launch whatever mode does USB booting. So I decided to try it. I dug up a USB-C cable, and connected it to the side of my Dell Dell U4320Q. It has a USB-C port on the lower left side that I have never ever used before. Dell claims it can deliver up to 90 watts, so it should be more than capable of powering the board.
I see this on my linux log when I connect it up:

Jan 26 18:12:19 trona kernel: usb 3-1.4: new high-speed USB device number 80 using xhci_hcd
Jan 26 18:12:19 trona kernel: usb 3-1.4: New USB device found, idVendor=2207, idProduct=330c, bcdDevice= 1.00
Jan 26 18:12:19 trona kernel: usb 3-1.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
This is exciting! It is indeed advertising itself as some kind of USB device. I will need some software on the linux side that knows how to talk to it.

Absolutely nothing on the serial port. I don't believe the Bootrom even initializes or uses the serial port.

Linux side software

The Wiki calls what I am doing "Maskrom mode", which makes sense, and points out that DRAM will not be available, only the limited (200k) of on chip SRAM. All of this is no surprise.
Their document talks about "rkdeveloptool" and "upgrade_tool".

The "upgrade tool" is closed source and besides that, the link to download it is screwed up (see notes below). On top of that, it is a 32 bit executable. We can avoid wasting time on it.

Upgrade Tool

This is available as a zip file within the rockchip-linux/tools section of their repository.
mkdir rkupgradetool
cd rkupgradetool
cp /home/tom/Linux_Upgrade_Tool_v1.33.zip .
The file is 208544 bytes and unzip does not like it. And it seems to be some kind of nasty corrupted html file:
file *.zip
Linux_Upgrade_Tool_v1.33.zip: HTML document, UTF-8 Unicode text, with very long lines
Some searching finds an older version (1.21) on the Firefly (RK3306) download page. This does unzip, and yields an ELF file for Intel named "upgrade_tool"

More reading indicates that it is a closed source binary from Rockchip. Also it is a 32 bit executable (indeed it is) and will likely need 32 bit libraries. I have installed lots of those on my system already, so the version 1.21 executable will run without issue, but gives the message:

No found any rockusb device,please plug device in!
This is nice (sort of), but I am more interested in source code, so this is probably a dead end road for my purposes.


Have any comments? Questions? Drop me a line!

Tom's electronics pages / [email protected]