Warning: As far as I am aware, so far, this flash process has had about a 16% failure rate. It is difficult to restore your machine with a bad SPI flash. Please proceed at your own risk, and probably best not to try at all if you don't have experience or the time it takes to recover your machine.
Necessary Items:
- a screwdriver
- USB Type-A to USB-C cable
- Another Computer with a USB-A 3.0 port (I used a Macbook Pro with a type-c dongle, if you use something else, idk.)
Not a requirement but if you want to boot from nvme you need:
- bootable NVME (i.e., with /boot/boot.txt having root=/dev/whatever_your_nvme_is plus some operating system. I use Manjaro. if you are unsure how to do this or want to sync your emmc with your nvme before hand, as400 has a great guide) preferably an intel 660p since it is what I have.
Build and install rkdeveloptool on your other computer, find out all the info to do that on their Github.
sanity test that you have installed it correctly
should output: rkdeveloptool ver 1.3
On this other computer, make a directory to hold all of your files in.
You will need to have two files in this directory get them from: SPI_Flash
Now that is all set up, we need to get our 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.
Extra steps to clear SPI
(Only necessary if you have flashed your SPI before, skip to end if you have never flashed anything to your SPI. If you are not sure and want to make sure it is empty, feel free to follow these steps.)
- on other computer:
- Plug your usb-a end into your other computer and usb-c end into your pinebook pro
- On pinebook, get into maksrom mode. If you can't maskrom easily because SPI is bootable (only should be the case if you have flashed uboot or some other boot software to your SPI already) follow as400's guide
- Verify you are in maskrom. On other computer:
look for maksrom output (e.g., DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=1401 Maskrom)
- flash zerospi
(thanks as400 for this part)
Back to the regular tutorial...
Reboot your computer, it will look like nothing is happening, no LEDs or anything.
to verify you are in maskrom mode, with your computers connected
you should get an output like this
DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=1401 Maskrom
if that is looking good, lets move forward. if you get something like no devices found, either your pinebook is off or you have some bootable device still in your pinebook, or your cable is bad, or your computer doesn't put enough power through its usb. (tried this with two pinebooks and it didn't work)
Now we will flash the flash helper db file.
if that works you will get output
Downloading bootloader succeeded.
Now for the exciting part
time to flash the new uboot to your SPI
your output should end up being
Write LBA from file (100%)
good work, now you can run a test to make sure it's healthy.
hopefully you get Reset Device OK.
Now run
which essentially reboots your pinebook pro.
You should see the red dot almost immediately. if you do see it, congrats! you now have an upstream SPI uboot (don't need to have uboot on emmc anymore. its very cool.)
boot order:
sd -> nvme -> usb -> emmc
Necessary Items:
- a screwdriver
- USB Type-A to USB-C cable
- Another Computer with a USB-A 3.0 port (I used a Macbook Pro with a type-c dongle, if you use something else, idk.)
Not a requirement but if you want to boot from nvme you need:
- bootable NVME (i.e., with /boot/boot.txt having root=/dev/whatever_your_nvme_is plus some operating system. I use Manjaro. if you are unsure how to do this or want to sync your emmc with your nvme before hand, as400 has a great guide) preferably an intel 660p since it is what I have.
Build and install rkdeveloptool on your other computer, find out all the info to do that on their Github.
sanity test that you have installed it correctly
Code:
rkdeveloptool --version
On this other computer, make a directory to hold all of your files in.
Code:
mkdir ~/PBPBoot
You will need to have two files in this directory get them from: SPI_Flash
- the db flash helper(https://www.ironrobin.net/clover/droppy/$/i1mNQ). This prepares the SPI for a binary, in this case, u-boot.
- the uboot binary (https://www.ironrobin.net/clover/droppy/$/H3yzt), built from dhivael's version of u-boot.
Code:
mv rk3399_loader_spinor_v1.15.114.bin ~/PBPBoot
mv dhiv_SPI_uboot.bin ~/PBPBoot
cd ~/PBPBoot
Now that is all set up, we need to get our 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.
Extra steps to clear SPI
(Only necessary if you have flashed your SPI before, skip to end if you have never flashed anything to your SPI. If you are not sure and want to make sure it is empty, feel free to follow these steps.)
- on other computer:
Code:
fallocate -l 16M zerospi
dd if=/dev/zero of=zerospi bs=1M count=16
- Plug your usb-a end into your other computer and usb-c end into your pinebook pro
- On pinebook, get into maksrom mode. If you can't maskrom easily because SPI is bootable (only should be the case if you have flashed uboot or some other boot software to your SPI already) follow as400's guide
- Verify you are in maskrom. On other computer:
Code:
rkdeveloptool ld
- flash zerospi
Code:
rkdeveloptool db rk3399_loader_spinor_v1.15.114.bin
rkdeveloptool wl 0 zerospi
rkdeveloptool td
rkdeveloptool rd
(thanks as400 for this part)
Back to the regular tutorial...
Reboot your computer, it will look like nothing is happening, no LEDs or anything.
to verify you are in maskrom mode, with your computers connected
Code:
rkdeveloptool ld
DevNo=1 Vid=0x2207,Pid=0x330c,LocationID=1401 Maskrom
if that is looking good, lets move forward. if you get something like no devices found, either your pinebook is off or you have some bootable device still in your pinebook, or your cable is bad, or your computer doesn't put enough power through its usb. (tried this with two pinebooks and it didn't work)
Now we will flash the flash helper db file.
Code:
rkdeveloptool db rk3399_loader_spinor_v1.15.114.bin
if that works you will get output
Downloading bootloader succeeded.
Now for the exciting part
time to flash the new uboot to your SPI
Code:
rkdeveloptool wl 0 dhiv_SPI_uboot.bin
your output should end up being
Write LBA from file (100%)
good work, now you can run a test to make sure it's healthy.
Code:
rkdeveloptool td
hopefully you get Reset Device OK.
Now run
Code:
rkdeveloptool rd
which essentially reboots your pinebook pro.
You should see the red dot almost immediately. if you do see it, congrats! you now have an upstream SPI uboot (don't need to have uboot on emmc anymore. its very cool.)
boot order:
sd -> nvme -> usb -> emmc