Program SPI NOR Flash on Pinebook Pro with u-boot on micro SD Card
Hello again!

Administrative: I apologize in advance for posting the actual instructions offsite as I have yet to figure out how to format headings using bbcode. If I ever figure it out or it becomes possible I will bring the content back over here. The instructions may be found at the link at the end of this post.

This process allows you to program/erase the Pinebook Pro (PBP) SPI NOR flash (flash) using u-boot on a micro SD card. 
  • The user is still required to remove the back cover to turn the eMMC switch off and the UART switch on.
  • The user is also required to connect to the PBP over USB serial UART from a host machine (Rock64 with keyboard and monitor for example).
  • You cannot use this process to recover from writing bad images to the flash though, you would still have to short the pins on the flash to boot from SD card again in this instance.
It is possible automatically write to flash using a boot.scr script (i tested this) but this is left as an exercise for the user. This also highlights why I think it is preferable for SD card to be at the bottom of the boot order and not at the top.

The mainline u-boot version as of this writing is 2020.10-rc4-g9de3126e. These are some observations I have made that you may find useful:
  • The SPI flash is not automatically detected. I am not a u-boot expert yet but I assume it is because an alias for 'spi0 = $spi1' is missing from the device tree. And I additionally assume this is because rk3399-pinebook-pro-u-boot.dtsi does not #include rk3399-pinebook-pro.dts. I tested this theory by temporarily adding the alias to rk3399-pinebook-pro.dts and the SPI was detected (should have also tested by adding the #include to rk3399-pinebook-pro-u-boot.dtsi).
  • CONFIG_ENV_OFFSET is set too low. CONFIG_ENV_OFFSET is automatically set to 0x140000. uboot.itb is written to 0x60000 and its current size is 949936 (928K) bytes which overlaps with 0x140000. If you want to safely saveenv you will need to set CONFIG_ENV_OFFSET to 0x150000. You could also place it at the end of SPI ((16M bytes - 1 byte) - 32K bytes).
You can find the instructions at this link:

Please reply to this thread for any questions or comments on the document found at the link above. Thanks!

Possibly Related Threads…
Thread Author Replies Views Last Post
  Write SD cards with Etcher for Pinebook Pro futurejones 17 19,643 03-19-2021, 12:52 AM
Last Post: Alex007
  [GUIDE] ArchLinuxARM on Pinebook Pro hku2 10 12,964 12-25-2020, 05:44 AM
Last Post: boteium
  Tinkering with docker-chromium-armhf to use any armhf program e.g. vncviewer wrzomar 0 1,648 09-30-2020, 02:07 PM
Last Post: wrzomar
  Extracting a copy of SPI NOR flash contents using micro SD card and u-boot hmuller 0 1,654 09-21-2020, 11:24 AM
Last Post: hmuller
  In-Circuit Programming of SPI NOR Flash hmuller 13 11,152 09-13-2020, 01:20 PM
Last Post: hmuller
Exclamation Flash dhivael's SPI uboot (risky) clover 51 32,540 06-20-2020, 03:24 PM
Last Post: craftkiller
  How to boot Manjaro from NVME with uboot on eMMC as400 47 35,356 06-07-2020, 02:37 AM
Last Post: as400
  Installing Docker on Pinebook Pro - update 1/18/20 SuperXkoodA 4 5,111 03-24-2020, 03:19 PM
Last Post: chaoskampf
  Swaywm on Pinebook Pro anjanmomi 10 9,031 02-06-2020, 11:47 AM
Last Post: xmixahlx
  Quick Guide to installing Ubuntu Unity on your Pinebook Pro 19 14,533 02-03-2020, 11:17 AM
Last Post: MIchael

Forum Jump:

Users browsing this thread: 1 Guest(s)