Program SPI NOR Flash on Pinebook Pro with u-boot on micro SD Card
#1
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:

https://gist.github.com/hxmuller/f1091f9...f893747482

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
  Install Tow-Boot on the SPI Shad0w 13 8,125 04-19-2024, 12:20 PM
Last Post: alchemist
  Pinebook Pro Recovery with Void Linux (xbps) bds 0 528 01-14-2024, 10:21 PM
Last Post: bds
Question Can't Boot from MicroSD (What Am I Missing) falken 10 3,917 04-28-2023, 04:26 PM
Last Post: pinemouth
  Write SD cards with Etcher for Pinebook Pro futurejones 17 29,863 03-19-2021, 12:52 AM
Last Post: Alex007
  [GUIDE] ArchLinuxARM on Pinebook Pro hku2 10 19,464 12-25-2020, 05:44 AM
Last Post: boteium
  Tinkering with docker-chromium-armhf to use any armhf program e.g. vncviewer wrzomar 0 2,655 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 2,723 09-21-2020, 11:24 AM
Last Post: hmuller
  In-Circuit Programming of SPI NOR Flash hmuller 13 18,271 09-13-2020, 01:20 PM
Last Post: hmuller
Exclamation Flash dhivael's SPI uboot (risky) clover 51 53,195 06-20-2020, 03:24 PM
Last Post: craftkiller
  How to boot Manjaro from NVME with uboot on eMMC as400 47 56,803 06-07-2020, 02:37 AM
Last Post: as400

Forum Jump:


Users browsing this thread: 1 Guest(s)