Difference between revisions of "Pinebook Pro SPI"

From PINE64
Jump to navigation Jump to search
Line 1: Line 1:
 +
 +
== Writing to the Pinebook Pro SPI ==
 +
 +
'''Necessary Items:'''
 +
 +
1. A screwdriver
 +
2. USB Type-A to USB-C cable
 +
3. Another Computer with a USB-A 3.0 port
 +
*''Not a requirement but if you want to boot from nvme you need:''
 +
4. A bootable NVME (i.e., with /boot/boot.txt having root=/dev/whatever_your_nvme_is plus some operating system.
 +
 +
'''Procedure:'''
 +
 +
1. Build and install rkdeveloptool on your other computer, find out all the info to do that on [https://github.com/rockchip-linux/rkdeveloptool their Github.]
 +
 +
2. Verify correct and successful installation:
 +
:<code>rkdeveloptool --version</code> should output: <code>rkdeveloptool ver 1.3</code>
 +
3. On the same computer, make a directory to hold the necessary files.
 +
:<code>mkdir ~/PBPBoot</code>
 +
 +
:You will need to have two files in this directory:
 +
*The db flash helper([https://droppy.ironrobin.net/%24/JWP47 rk3399_loader_spinor_v1.15.114.bin]). This prepares the SPI for a binary.
 +
*The uboot, or other bootloader binary.
 +
 +
'''Note: SPI binaries are built for SPI environment only. It will not work if you try putting it on your eMMC.'''
 +
 +
:<code>mv rk3399_loader_spinor_v1.15.114.bin ~/PBPBoot</code>
 +
:<code>mv dhiv_SPI_uboot.bin ~/PBPBoot</code>
 +
:<code>cd ~/PBPBoot</code>
 +
 +
4. Put the Pinebook Pro into maskrom mode:
 +
*Plug the Type-A end into your non-Pinebook Pro device.
 +
*Plug the Type-C end into your Pinebook Pro.
 +
*Remove all bootable devices from your pinebook pro.
 +
5. Reboot the Pinebook Pro.
 +
:To verify you are in maskrom mode, with your computers connected, run <code>rkdeveloptool ld</code>
 +
:You should get an output like this: '''DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=1401 Maskrom'''
 +
6. Flash the flash helper db file.
 +
:<code>rkdeveloptool db rk3399_loader_spinor_v1.15.114.bin</code>
 +
:Upon success, the output should read '''Downloading bootloader succeeded.'''
 +
7. Flash the new SPI binary.
 +
:<code>rkdeveloptool wl 0 dhiv_SPI_uboot.bin</code>
 +
:Successful output should read: '''Write LBA from file (100%)'''.
 +
8. Test the installation.
 +
:<code>rkdeveloptool td</code>
 +
:Successful output should read '''Reset Device OK'''.
 +
9. Run <code>rkdeveloptool rd</code> to reboot your Pinebook Pro.
  
 
== Recovering from broken SPI flashes/installs ==
 
== Recovering from broken SPI flashes/installs ==
  
 
If you accidentally soft brick your PBP there is special mode implemented called maskrom mode. In this mode the device is accessible as regular USB device and can be accessed using rkdevelop tools. Especially to rewrite SPI flash or to erase it.
 
If you accidentally soft brick your PBP there is special mode implemented called maskrom mode. In this mode the device is accessible as regular USB device and can be accessed using rkdevelop tools. Especially to rewrite SPI flash or to erase it.
 
  
 
According to Rockchip documentation it should be accessible following below procedure:
 
According to Rockchip documentation it should be accessible following below procedure:
Line 10: Line 56:
 
2. Short press reset.<br>
 
2. Short press reset.<br>
 
3. Release recovery button after about 3 seconds.
 
3. Release recovery button after about 3 seconds.
 
 
  
 
Unfortunately it is not always the case. I had a clear SPI from factory and had to do this procedure trillion times to eventually get into maskrom mode. There is another person who had the same problems.
 
Unfortunately it is not always the case. I had a clear SPI from factory and had to do this procedure trillion times to eventually get into maskrom mode. There is another person who had the same problems.
Line 17: Line 61:
 
The nature of this problem is not clear. There are two suspicions:
 
The nature of this problem is not clear. There are two suspicions:
  
- the button is not working correctly or is just prone to failures.<br>
+
*the button is not working correctly or is just prone to failures.<br>
- the problem occurs only when the SPI was previously flashed.
+
*the problem occurs only when the SPI was previously flashed.
 
 
 
 
  
 
One way or the other the button works by shorting two pins in an SPI device. But in some cases it just does nothing. So if you experience such problem there is a way to overcome it. You can short the two pins by yourself.
 
One way or the other the button works by shorting two pins in an SPI device. But in some cases it just does nothing. So if you experience such problem there is a way to overcome it. You can short the two pins by yourself.
Line 31: Line 73:
 
4. Locate SPI flash (number 29 on picture with Pinebook Pro internals).<br>
 
4. Locate SPI flash (number 29 on picture with Pinebook Pro internals).<br>
 
5. Turn on pbp, short pins CLK and VSS and press reset. It should get your pbp into maskrom mode. (see picture)
 
5. Turn on pbp, short pins CLK and VSS and press reset. It should get your pbp into maskrom mode. (see picture)
 
  
 
[[File:Spi.png]]
 
[[File:Spi.png]]

Revision as of 18:19, 10 February 2020

Writing to the Pinebook Pro SPI

Necessary Items:

1. A screwdriver 2. USB Type-A to USB-C cable 3. Another Computer with a USB-A 3.0 port

  • Not a requirement but if you want to boot from nvme you need:

4. A bootable NVME (i.e., with /boot/boot.txt having root=/dev/whatever_your_nvme_is plus some operating system.

Procedure:

1. Build and install rkdeveloptool on your other computer, find out all the info to do that on their Github.

2. Verify correct and successful installation:

rkdeveloptool --version should output: rkdeveloptool ver 1.3

3. On the same computer, make a directory to hold the necessary files.

mkdir ~/PBPBoot
You will need to have two files in this directory:

Note: SPI binaries are built for SPI environment only. It will not work if you try putting it on your eMMC.

mv rk3399_loader_spinor_v1.15.114.bin ~/PBPBoot
mv dhiv_SPI_uboot.bin ~/PBPBoot
cd ~/PBPBoot

4. Put the Pinebook Pro into maskrom mode:

  • Plug the Type-A end into your non-Pinebook Pro device.
  • Plug the Type-C end into your Pinebook Pro.
  • Remove all bootable devices from your pinebook pro.

5. Reboot the Pinebook Pro.

To verify you are in maskrom mode, with your computers connected, run rkdeveloptool ld
You should get an output like this: DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=1401 Maskrom

6. Flash the flash helper db file.

rkdeveloptool db rk3399_loader_spinor_v1.15.114.bin
Upon success, the output should read Downloading bootloader succeeded.

7. Flash the new SPI binary.

rkdeveloptool wl 0 dhiv_SPI_uboot.bin
Successful output should read: Write LBA from file (100%).

8. Test the installation.

rkdeveloptool td
Successful output should read Reset Device OK.

9. Run rkdeveloptool rd to reboot your Pinebook Pro.

Recovering from broken SPI flashes/installs

If you accidentally soft brick your PBP there is special mode implemented called maskrom mode. In this mode the device is accessible as regular USB device and can be accessed using rkdevelop tools. Especially to rewrite SPI flash or to erase it.

According to Rockchip documentation it should be accessible following below procedure:

1. Press and hold recovery button.
2. Short press reset.
3. Release recovery button after about 3 seconds.

Unfortunately it is not always the case. I had a clear SPI from factory and had to do this procedure trillion times to eventually get into maskrom mode. There is another person who had the same problems.

The nature of this problem is not clear. There are two suspicions:

  • the button is not working correctly or is just prone to failures.
  • the problem occurs only when the SPI was previously flashed.

One way or the other the button works by shorting two pins in an SPI device. But in some cases it just does nothing. So if you experience such problem there is a way to overcome it. You can short the two pins by yourself.

Procedure:

1. Unscrew bottom cover.
2. Remove the metal shield surrounding main CPU - it is held in place by a tape and micro clamps on pcb.
3. Disconnect all (!!!) boot devices (emmc, sdcard, usb).
4. Locate SPI flash (number 29 on picture with Pinebook Pro internals).
5. Turn on pbp, short pins CLK and VSS and press reset. It should get your pbp into maskrom mode. (see picture)

Spi.png