Difference between revisions of "Rock3/install/spi"
(→Boot the board to maskrom mode) |
Amazingfate (Talk | contribs) |
||
Line 44: | Line 44: | ||
* [https://dl.radxa.com/rock3/images/loader/rock-3a/idbloader.img ROCK 3A idbloader] | * [https://dl.radxa.com/rock3/images/loader/rock-3a/idbloader.img ROCK 3A idbloader] | ||
* [https://dl.radxa.com/rock3/images/loader/rock-3a/u-boot.itb ROCK 3A u-boot.itb] | * [https://dl.radxa.com/rock3/images/loader/rock-3a/u-boot.itb ROCK 3A u-boot.itb] | ||
+ | |||
+ | === Create GPT U-Boot image === | ||
+ | To avoid random mac address after every reboot, it is recommended to create a 16MB size gpt uboot image which contains idbloader.img and u-boot.itb. | ||
+ | Use these command on Linux to create the image: | ||
+ | |||
+ | dd if=/dev/zero of=spi_image.img bs=1M count=0 seek=16 | ||
+ | /usr/sbin/parted -s spi_image.img mklabel gpt | ||
+ | /usr/sbin/parted -s spi_image.img unit s mkpart idbloader 64 7167 | ||
+ | /usr/sbin/parted -s spi_image.img unit s mkpart vnvm 7168 7679 | ||
+ | /usr/sbin/parted -s spi_image.img unit s mkpart reserved_space 7680 8063 | ||
+ | /usr/sbin/parted -s spi_image.img unit s mkpart reserved1 8064 8127 | ||
+ | /usr/sbin/parted -s spi_image.img unit s mkpart uboot_env 8128 8191 | ||
+ | /usr/sbin/parted -s spi_image.img unit s mkpart reserved2 8192 16383 | ||
+ | /usr/sbin/parted -s spi_image.img unit s mkpart uboot 16384 32734 | ||
+ | dd if=./idbloader.img of=spi_image.img seek=64 conv=notrunc | ||
+ | dd if=./u-boot.itb of=spi_image.img seek=16384 conv=notrunc | ||
=== Write U-Boot images to SPI Nor Flash or erase SPI Nor Flash === | === Write U-Boot images to SPI Nor Flash or erase SPI Nor Flash === | ||
Line 50: | Line 66: | ||
===== Option one: Write U-Boot images to SPI Nor Flash ===== | ===== Option one: Write U-Boot images to SPI Nor Flash ===== | ||
+ | |||
+ | On PC, run command rkdeveloptool. | ||
+ | |||
+ | Confirm that ROCK 3A is in maskrom mode. | ||
+ | |||
+ | rkdeveloptool ld | ||
+ | DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=104 Maskrom | ||
+ | |||
+ | Download the loader (flash helper) to init the ram and prepare the flashing environment etc. | ||
+ | |||
+ | rkdeveloptool db rk356x_spl_loader_ddr1056_v1.10.111.bin | ||
+ | |||
+ | Write bootloader | ||
+ | |||
+ | rkdeveloptool wl 0 spi_image.img | ||
+ | |||
+ | Reboot the device | ||
+ | |||
+ | rkdeveloptool rd | ||
+ | |||
+ | Now the device should boot on SPI Nor Flash. And '''the blue led is on'''. | ||
+ | |||
+ | ===== Option two: Update U-Boot images to SPI Nor Flash ===== | ||
On PC, run command rkdeveloptool. | On PC, run command rkdeveloptool. | ||
Line 73: | Line 112: | ||
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'''. | ||
− | ===== Option | + | ===== Option three: Erase SPI Nor Flash ===== |
Please notice that when you want to erase SPI Nor Flash, fire these commands. Get zero.img from [https://dl.radxa.com/rock3/images/others/zero.img.gz here]. | Please notice that when you want to erase SPI Nor Flash, fire these commands. Get zero.img from [https://dl.radxa.com/rock3/images/others/zero.img.gz here]. | ||
Line 82: | Line 121: | ||
==== Windows PC ==== | ==== Windows PC ==== | ||
− | |||
===== Option one: Write U-Boot images to SPI Nor Flash ===== | ===== Option one: Write U-Boot images to SPI Nor Flash ===== | ||
+ | |||
+ | Double click the '''RKDevTool.exe''' and click button '''Download Image'''. | ||
+ | |||
+ | [[File:Rkdevtool-write-uboot-to-spi-nor-flash.png | 1000px]] | ||
+ | |||
+ | ====== Step 1: Write config ====== | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! # || Address || Name || Path | ||
+ | |- | ||
+ | | 1 || 0x00000000 || Loader || /path/to/rk356x_spl_loader_ddr1056_v1.10.111.bin | ||
+ | |- | ||
+ | | 2 || 0x00000000 || ubootimage || /path/to/spi_image.img | ||
+ | |} | ||
+ | |||
+ | ====== Step 2: Confirm "Found One Maskrom Device" ====== | ||
+ | If your ROCK 3A is in maskrom mode and connects to PC, you can see that RKDevTool shows '''Found one MASKROM Device'''. | ||
+ | |||
+ | ====== Step 3: Run ====== | ||
+ | Finally, click the "run" button, and you will see the content on the right side. When RKDevTool shows '''Download image OK''', the download job is completed. | ||
+ | |||
+ | [[File:Rkdevtool-write-rock-3a-u-boot-sucess-log.png | 1000px]] | ||
+ | |||
+ | ===== Option two: Update U-Boot images to SPI Nor Flash ===== | ||
Double click the '''RKDevTool.exe''' and click button '''Download Image'''. | Double click the '''RKDevTool.exe''' and click button '''Download Image'''. | ||
Line 110: | Line 173: | ||
[[File:Rkdevtool-write-rock-3a-u-boot-sucess-log.png | 1000px]] | [[File:Rkdevtool-write-rock-3a-u-boot-sucess-log.png | 1000px]] | ||
− | ===== Option | + | ===== Option three: Erase SPI Nor Flash ===== |
Double click the '''RKDevTool.exe''' and click button "Advanced Function" to get into '''Advanced Function''' window. | Double click the '''RKDevTool.exe''' and click button "Advanced Function" to get into '''Advanced Function''' window. | ||
Revision as of 13:53, 12 March 2022
ROCK 3 > Installation > Install the image to SPI Nor Flash
Contents
- 1 Install the image to SPI Nor Flash from USB port
- 1.1 Requirement
- 1.2 Install Tools&Drivers
- 1.3 Boot the board to maskrom mode
- 1.4 Get RK356X loader and U-Boot images
- 1.5 Create GPT U-Boot image
- 1.6 Write U-Boot images to SPI Nor Flash or erase SPI Nor Flash
- 1.7 Troubleshooting
Install the image to SPI Nor Flash from USB port
ROCK 3 supports Maskrom mode, which is a special operation mode for CPU to wait for USB OTG port command. The Linux/macOS PC tool we use to communicate with ROCK 3 in Maskrom mode are the rkdeveloptool and RKDevTool. We use tool rkdeveloptool in Linux/macOS and RKDevTool tool under Windows.
Available boards:
- ROCK 3A
Here we do the test on ROCK 3A.
Requirement
- ROCK 3A with SPI Nor Flash (You can find SPI Nor Flash from ROCK 3 Model A Main Board)
- Power adapter
- USB Male A to Male A cable(important) USB-C has been seen as not working, an adaptor for USB-C to USB-A has worked. See discussion.
Install Tools&Drivers
Please check this guide, Install rockchip flash tools under Windows/Linux/MacOS PC.
Boot the board to maskrom mode
To boot ROCK 3A into maskrom mode is simple:
- Power off the board
- Remove bootable devices like microSD card, eMMC module, etc
- Plug the USB Male A to Male A cable to ROCK 3A OTG port(the upper USB3.0 port), the other side to PC
- Short-circuit the following pins. See the left yellow hat.
- Power on the board
- Take off the yellow hat.
- Check usb device
- For macOS host: lsusb result: Bus 000 Device 004: ID 2207:350a Fuzhou Rockchip Electronics Co., Ltd. Composite Device
- For Linux host: lsusb result: Bus 001 Device 112: ID 2207:350a Fuzhou Rockchip Electronics Company
- For Windows host: Open RKDevTool and you would see the device is in Found One MASKROM Device.
Alternatively, if you are running Android and can access ADB, you can reboot the device to loader mode 'adb reboot bootloader' then use the rkdeveloptool to reset the device into maskrom mode 'rkdeveloptool rd 3' or Windows RKDevTool Switch button to go to maskrom mode.
Get RK356X loader and U-Boot images
Create GPT U-Boot image
To avoid random mac address after every reboot, it is recommended to create a 16MB size gpt uboot image which contains idbloader.img and u-boot.itb. Use these command on Linux to create the image:
dd if=/dev/zero of=spi_image.img bs=1M count=0 seek=16 /usr/sbin/parted -s spi_image.img mklabel gpt /usr/sbin/parted -s spi_image.img unit s mkpart idbloader 64 7167 /usr/sbin/parted -s spi_image.img unit s mkpart vnvm 7168 7679 /usr/sbin/parted -s spi_image.img unit s mkpart reserved_space 7680 8063 /usr/sbin/parted -s spi_image.img unit s mkpart reserved1 8064 8127 /usr/sbin/parted -s spi_image.img unit s mkpart uboot_env 8128 8191 /usr/sbin/parted -s spi_image.img unit s mkpart reserved2 8192 16383 /usr/sbin/parted -s spi_image.img unit s mkpart uboot 16384 32734 dd if=./idbloader.img of=spi_image.img seek=64 conv=notrunc dd if=./u-boot.itb of=spi_image.img seek=16384 conv=notrunc
Write U-Boot images to SPI Nor Flash or erase SPI Nor Flash
Linux/macOS PC
Option one: Write U-Boot images to SPI Nor Flash
On PC, run command rkdeveloptool.
Confirm that ROCK 3A is in maskrom mode.
rkdeveloptool ld DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=104 Maskrom
Download the loader (flash helper) to init the ram and prepare the flashing environment etc.
rkdeveloptool db rk356x_spl_loader_ddr1056_v1.10.111.bin
Write bootloader
rkdeveloptool wl 0 spi_image.img
Reboot the device
rkdeveloptool rd
Now the device should boot on SPI Nor Flash. And the blue led is on.
Option two: Update U-Boot images to SPI Nor Flash
On PC, run command rkdeveloptool.
Confirm that ROCK 3A is in maskrom mode.
rkdeveloptool ld DevNo=1 Vid=0x2207,Pid=0x350a,LocationID=104 Maskrom
Download the loader (flash helper) to init the ram and prepare the flashing environment etc.
rkdeveloptool db rk356x_spl_loader_ddr1056_v1.10.111.bin
Write bootloader
rkdeveloptool wl 64 idbloader.img rkdeveloptool wl 16384 u-boot.itb
Reboot the device
rkdeveloptool rd
Now the device should boot on SPI Nor Flash. And the blue led is on.
Option three: Erase SPI Nor Flash
Please notice that when you want to erase SPI Nor Flash, fire these commands. Get zero.img from here.
rkdeveloptool db rk356x_spl_loader_ddr1056_v1.10.111.bin rkdeveloptool wl 0 zero.img rkdeveloptool rd
Windows PC
Option one: Write U-Boot images to SPI Nor Flash
Double click the RKDevTool.exe and click button Download Image.
Step 1: Write config
# | Address | Name | Path |
---|---|---|---|
1 | 0x00000000 | Loader | /path/to/rk356x_spl_loader_ddr1056_v1.10.111.bin |
2 | 0x00000000 | ubootimage | /path/to/spi_image.img |
Step 2: Confirm "Found One Maskrom Device"
If your ROCK 3A is in maskrom mode and connects to PC, you can see that RKDevTool shows Found one MASKROM Device.
Step 3: Run
Finally, click the "run" button, and you will see the content on the right side. When RKDevTool shows Download image OK, the download job is completed.
Option two: Update U-Boot images to SPI Nor Flash
Double click the RKDevTool.exe and click button Download Image.
Step 1: Write config
# | Address | Name | Path |
---|---|---|---|
1 | 0x00000000 | Loader | /path/to/rk356x_spl_loader_ddr1056_v1.10.111.bin |
2 | 0x00000040 | idbloader | /path/to/idbloader.img |
3 | 0x00004000 | u-boot.itb | /path/to/u-boot.itb |
Step 2: Confirm "Found One Maskrom Device"
If your ROCK 3A is in maskrom mode and connects to PC, you can see that RKDevTool shows Found one MASKROM Device.
Step 3: Run
Finally, click the "run" button, and you will see the content on the right side. When RKDevTool shows Download image OK, the download job is completed.
Option three: Erase SPI Nor Flash
Double click the RKDevTool.exe and click button "Advanced Function" to get into Advanced Function window.
Step 1: Confirm "Found One Maskrom Device"
If your ROCK 3A is in maskrom mode and connects to PC, you can see that RKDevTool shows Found one MASKROM Device.
Step 2: Download RK356X Loader
Choose loader rk356x_spl_loader_ddr1056_v1.10.111.bin and download it.
Step 3: Erase device
Click button "EraseAll" to erase device.
Step 4: Reset device
Click button "ResetDevice" to reset device.
Erasing job is done.
Troubleshooting
- If you have issue with flashing via USB OTG, start a new post on the forum, https://forum.radxa.com/c/rock3.