Please enable javascript, or click here to visit my ecommerce web site powered by Shopify.
Jump to: navigation, search

Difference between revisions of "Rock5/install/spi"

< Rock5‎ | install
(Write U-Boot images to SPI Nor Flash or erase SPI Nor Flash)
Line 1: Line 1:
 
{{rock5_header}}
 
{{rock5_header}}
{{Languages|rock5/dev/usb-install}}
+
{{Languages|rock5/dev/spi}}
 +
 
 
     [[rock5 | ROCK 5]] > [[rock5/install | Installation]] > [[rock5/install/spi | Install the Image to SPI Nor Flash]]
 
     [[rock5 | ROCK 5]] > [[rock5/install | Installation]] > [[rock5/install/spi | Install the Image to SPI Nor Flash]]
  
== Install the image to SPI Nor Flash from USB port ==
+
== Install the image to SPI Nor Flash ==
  
Rock 5 supports Maskrom mode, which is a special operation mode for CPU to wait for USB OTG port command.
+
ROCK 5 supports Maskrom mode, which is a special operation mode for CPU to wait for USB OTG port command.
 
The PC tools we use to communicate with rock 5 in Maskrom mode are the '''rkdeveloptool''' and '''[https://dl.radxa.co/tools/windows/windows_RKDevTool_Release_v2.92.zip RKDevTool v2.92]'''.  
 
The PC tools we use to communicate with rock 5 in Maskrom mode are the '''rkdeveloptool''' and '''[https://dl.radxa.co/tools/windows/windows_RKDevTool_Release_v2.92.zip RKDevTool v2.92]'''.  
 
We use '''the rkdeveloptool in Linux/macOS ''' and '''the [https://dl.radxa.co/tools/windows/windows_RKDevTool_Release_v2.92.zip RKDevTool] under Windows'''.
 
We use '''the rkdeveloptool in Linux/macOS ''' and '''the [https://dl.radxa.co/tools/windows/windows_RKDevTool_Release_v2.92.zip RKDevTool] under Windows'''.
  
=== Requirement ===
+
=== Requirement ===
  
* ROCK 5B  
+
* ROCK 5B with proper power
 
* Linux image for ROCK 5B, Android image is not supported yet
 
* Linux image for ROCK 5B, Android image is not supported yet
* type-c cable
+
* SD card or eMMC module
* SPI Nor Flash on board
+
* USB Type C cable
 
* Windows/linux/macOS  PC
 
* Windows/linux/macOS  PC
  
=== Install Tools&Drivers ===
+
=== Step1: Install Tools&Drivers ===
  
 
Please check this guide, [[rock5/install/rockchip-flash-tools | Install rockchip flash tools under Windows/Linux/MacOS PC]].
 
Please check this guide, [[rock5/install/rockchip-flash-tools | Install rockchip flash tools under Windows/Linux/MacOS PC]].
  
=== Boot the board to Maskrom mode ===
+
=== Step2: Get RK3588 loader and U-Boot images ===
 +
 
 +
==== For ROCK 5B ====
 +
 
 +
* Download the loader image from:
 +
** [https://dl.radxa.com/rock5/sw/images/loader/rock-5b/rk3588_spl_loader_v1.08.111.bin RK3588 loader] - USB flashing helper
 +
 
 +
* Download the latest SPI image from:
 +
** [https://dl.radxa.com/rock5/sw/images/loader/rock-5b/release/rock-5b-spi-image-g49da44e116d.img release version] with u-boot serial console disabled(Recommend)
 +
** [https://dl.radxa.com/rock5/sw/images/loader/rock-5b/debug/rock-5b-spi-image-g3caf61a44c2-debug.img debug version] with u-boot serial console enabled(Use it when you need to troubleshoot booting issue)
 +
 
 +
 
 +
=== Step3: Boot the board to Maskrom mode ===
  
 
[[File:Rock-5b-typec-maskrom.jpeg|400px]]
 
[[File:Rock-5b-typec-maskrom.jpeg|400px]]
Line 35: Line 48:
 
** For macOS host: lsusb result: '''Bus 002 Device 032: ID 2207:350b Fuzhou Rockchip Electronics Co., Ltd. Composite Device'''
 
** For macOS host: lsusb result: '''Bus 002 Device 032: ID 2207:350b Fuzhou Rockchip Electronics Co., Ltd. Composite Device'''
 
** For Linux host: lsusb result: '''Bus 001 Device 112: ID 2207:350b Fuzhou Rockchip Electronics Company'''
 
** For Linux host: lsusb result: '''Bus 001 Device 112: ID 2207:350b Fuzhou Rockchip Electronics Company'''
** For Windows host: Open RKDevTool and you would see the device is in '''Found One MASKROM Device'''.
+
** For Windows host: Open RKDevTool and you would see the device is in '''Found One MASKROM Device'''
  
=== Get RK3588 loader and U-Boot images ===
+
=== Step4: Write U-Boot images to SPI Nor Flash or erase SPI Nor Flash ===
  
==== ROCK 5B ====
+
==== Option 1: Operate on ROCK 5B ====
  
* Download the loader image from:  
+
Boot your ROCK 5B with Linux running on SD card or eMMC module:
** [https://dl.radxa.com/rock5/sw/images/loader/rock-5b/rk3588_spl_loader_v1.08.111.bin RK3588 loader] - USB flashing helper
+
  
* Download the latest SPI image from:
+
Make sure the SPI flash is available:
** [https://dl.radxa.com/rock5/sw/images/loader/rock-5b/release/rock-5b-spi-image-g49da44e116d.img release version] with u-boot serial console disabled(Recommend)
+
ls /dev/mtdblk*
** [https://dl.radxa.com/rock5/sw/images/loader/rock-5b/debug/rock-5b-spi-image-g3caf61a44c2-debug.img debug version] with u-boot serial console enabled(Use it when you need to troubleshoot booting issue)
+
 
 +
sudo dd if=zero.img of=/dev/mtdblock0
 +
sudo dd if=rock-5b-spi-image-g49da44e116d.img of=/dev/mtdblock0
 +
sync
 +
 
 +
Get zero.img from [https://dl.radxa.com/rock5/sw/images/others/zero.img.gz here].
  
=== Write U-Boot images to SPI Nor Flash or erase SPI Nor Flash ===
+
==== Option 2: Flash with Linux PC/Mac ====
  
==== Linux/MacOS ====
+
On your PC or Mac, run the rkdeveloptool  
On your PC, run the rkdeveloptool  
+
  
 
  sudo rkdeveloptool ld
 
  sudo rkdeveloptool ld
 
  DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=106 Maskrom
 
  DevNo=1 Vid=0x2207,Pid=0x350b,LocationID=106 Maskrom
  
Download the loader (flash helper) to init the ram and prepare the flashing environment etc.  If you don't have it, you can download it from [https://dl.radxa.com/rock5/sw/images/loader/rock-5b/rk3588_spl_loader_v1.08.111.bin here]
+
This will load the loader (flash helper, downloaded from Step2) to run on ROCK 5B and init the ram and prepare the flashing environment etc.   
  
 
  sudo rkdeveloptool db /path/to/rk3588_spl_loader_v1.08.111.bin # will output:
 
  sudo rkdeveloptool db /path/to/rk3588_spl_loader_v1.08.111.bin # will output:
 
  Downloading bootloader succeeded.
 
  Downloading bootloader succeeded.
  
Write SPI image to SPI Nor Flash on board.
+
Next, write SPI image from PC/Mac to ROCK 5B SPI flash
  
You can use our pre-built files.
+
You can use the image download from Step 2.
  
 
  sudo rkdeveloptool wl 0 rock-5b-spi-image-g49da44e116d.img
 
  sudo rkdeveloptool wl 0 rock-5b-spi-image-g49da44e116d.img
Line 73: Line 89:
 
now, the device should boot on SPI Nor Flash. And '''the blue led is on'''.
 
now, the device should boot on SPI Nor Flash. And '''the blue led is on'''.
  
==== ROCK 5B ====
+
==== Option 3: Flash with Windows PC ====
On your ROCK 5B
+
 
+
sudo dd if=zero.img of=/dev/mtdblock0
+
sudo dd if=rock-5b-spi-image-g49da44e116d.img of=/dev/mtdblock0
+
sync
+
 
+
Get zero.img from [https://dl.radxa.com/rock5/sw/images/others/zero.img.gz here].
+
 
+
==== Windows ====
+
  
 
Double click the RKDevTool.exe and you will see the following interface:
 
Double click the RKDevTool.exe and you will see the following interface:
Line 107: Line 114:
 
[[File: rock-5b-spi-flash-02.png |1000px]]
 
[[File: rock-5b-spi-flash-02.png |1000px]]
  
== Erase SPI Nor Flash ==
+
=== Addition: Erase the SPI Nor Flash ===
  
=== Linux/MacOS ===
+
==== Option 1: Operate on ROCK 5B ====
 +
 
 +
Boot your ROCK 5B with Linux running on SD card or eMMC module:
 +
 
 +
Make sure the SPI flash is available:
 +
ls /dev/mtdblk*
 +
 
 +
sudo dd if=/dev/zero of=/dev/mtdblock0
 +
sync
 +
 
 +
==== Option 2: Erase with Linux PC/Mac ====
  
 
Please notice that when you want to erase SPI Nor Flash, fire these commands. If you don't have zero.img, download this one please. [https://dl.radxa.com/rock5/sw/images/others/zero.img.gz zero.img]
 
Please notice that when you want to erase SPI Nor Flash, fire these commands. If you don't have zero.img, download this one please. [https://dl.radxa.com/rock5/sw/images/others/zero.img.gz zero.img]
Line 118: Line 135:
 
  rkdeveloptool rd
 
  rkdeveloptool rd
  
=== Windows ===
+
==== Option3: Erase with Windows PC====
  
Before Erasing, please comfirm that ROCK 5B is in Maskrom mode
+
Before Erasing, please confirm that ROCK 5B is in Maskrom mode
  
==== Step 1: Download ====
+
===== Step 1: Download =====
 
Choose the "Advanced features" button, then select rk3588_spl_loader_v1.08.111.bin, next click the "Download" button
 
Choose the "Advanced features" button, then select rk3588_spl_loader_v1.08.111.bin, next click the "Download" button
  
==== Step 2: Erase all  ====
+
===== Step 2: Erase all  =====
 
Click the "erase all" button
 
Click the "erase all" button
  
==== Step 3: Reboot device ====
+
===== Step 3: Reboot device =====
  
 
[[File: eraseall.jpg |700px]]
 
[[File: eraseall.jpg |700px]]
 
=== Verify Loader version ===
 
 
Version is display on UART console when board starts, one of the very first lines (older vs updated):
 
DDR Version V1.07 20220412
 
DDR Version V1.08 20220617
 
  
 
=== Troubleshooting ===
 
=== Troubleshooting ===
  
 
* If you have issue with flashing via USB OTG, start a new post on the forum, https://forum.radxa.com/c/rock5.
 
* If you have issue with flashing via USB OTG, start a new post on the forum, https://forum.radxa.com/c/rock5.

Revision as of 07:49, 26 October 2022

    ROCK 5 >  Installation >  Install the Image to SPI Nor Flash

Install the image to SPI Nor Flash

ROCK 5 supports Maskrom mode, which is a special operation mode for CPU to wait for USB OTG port command. The PC tools we use to communicate with rock 5 in Maskrom mode are the rkdeveloptool and RKDevTool v2.92. We use the rkdeveloptool in Linux/macOS and the RKDevTool under Windows.

Requirement

  • ROCK 5B with proper power
  • Linux image for ROCK 5B, Android image is not supported yet
  • SD card or eMMC module
  • USB Type C cable
  • Windows/linux/macOS PC

Step1: Install Tools&Drivers

Please check this guide, Install rockchip flash tools under Windows/Linux/MacOS PC.

Step2: Get RK3588 loader and U-Boot images

For ROCK 5B

  • Download the loader image from:
  • Download the latest SPI image from:
    • release version with u-boot serial console disabled(Recommend)
    • debug version with u-boot serial console enabled(Use it when you need to troubleshoot booting issue)


Step3: Boot the board to Maskrom mode

Rock-5b-typec-maskrom.jpeg

To boot ROCK 5B to Maskrom mode is simple:

  • Power off the board.
  • Remove bootable device like MicroSD card, eMMC module, etc.
  • Press the golden (or silver on some board revisions) button and hold it.
  • Plug the USB-A to Type-C cable to ROCK 5B Type-C port, the other side to PC.
  • Release the golded button.
  • Check usb device
    • For macOS host: lsusb result: Bus 002 Device 032: ID 2207:350b Fuzhou Rockchip Electronics Co., Ltd. Composite Device
    • For Linux host: lsusb result: Bus 001 Device 112: ID 2207:350b Fuzhou Rockchip Electronics Company
    • For Windows host: Open RKDevTool and you would see the device is in Found One MASKROM Device

Step4: Write U-Boot images to SPI Nor Flash or erase SPI Nor Flash

Option 1: Operate on ROCK 5B

Boot your ROCK 5B with Linux running on SD card or eMMC module:

Make sure the SPI flash is available:

ls /dev/mtdblk*
sudo dd if=zero.img of=/dev/mtdblock0
sudo dd if=rock-5b-spi-image-g49da44e116d.img of=/dev/mtdblock0
sync

Get zero.img from here.

Option 2: Flash with Linux PC/Mac

On your PC or Mac, run the rkdeveloptool

sudo rkdeveloptool ld
DevNo=1	Vid=0x2207,Pid=0x350b,LocationID=106	Maskrom

This will load the loader (flash helper, downloaded from Step2) to run on ROCK 5B and init the ram and prepare the flashing environment etc.

sudo rkdeveloptool db /path/to/rk3588_spl_loader_v1.08.111.bin		 # will output:
Downloading bootloader succeeded.

Next, write SPI image from PC/Mac to ROCK 5B SPI flash

You can use the image download from Step 2.

sudo rkdeveloptool wl 0 rock-5b-spi-image-g49da44e116d.img					
Write LBA from file (100%)

Reboot the device

rkdeveloptool rd

now, the device should boot on SPI Nor Flash. And the blue led is on.

Option 3: Flash with Windows PC

Double click the RKDevTool.exe and you will see the following interface: Double click the RKDevTool.exe and you will see the following interface:

Step 1: comfirm that ROCK 5B is in Maskrom mode

If your ROCK 5B is in maskrom mode and connects to PC, you can see that the program detects it, as the red arrow below

Step 2: Select Loader

Next, click the right last columns in the "Loader" row to select rk3588_spl_loader_v1.08.111.bin

Step 3: Select SPI image

Next, click the right last columns in the "spi" row to select spi-image.

Step 4: Excute

Finally, click the "Excute" button, and you will see the content in the red box on the right. When the progress reaches 100%, the download is completed.

Rock-5b-spi-flash-1.png

Rock-5b-spi-flash-02.png

Addition: Erase the SPI Nor Flash

Option 1: Operate on ROCK 5B

Boot your ROCK 5B with Linux running on SD card or eMMC module:

Make sure the SPI flash is available:

ls /dev/mtdblk*
sudo dd if=/dev/zero of=/dev/mtdblock0
sync

Option 2: Erase with Linux PC/Mac

Please notice that when you want to erase SPI Nor Flash, fire these commands. If you don't have zero.img, download this one please. zero.img And extract it.

rkdeveloptool db rk3588_spl_loader_v1.08.111.bin
rkdeveloptool wl 0 zero.img
rkdeveloptool rd

Option3: Erase with Windows PC

Before Erasing, please confirm that ROCK 5B is in Maskrom mode

Step 1: Download

Choose the "Advanced features" button, then select rk3588_spl_loader_v1.08.111.bin, next click the "Download" button

Step 2: Erase all

Click the "erase all" button

Step 3: Reboot device

Eraseall.jpg

Troubleshooting