Pinebook Pro Write to Spi Flash

Table of Contents

WARNING

Be prepared to recover your broken SPI flash if an error occurs. When a binary is written to the SPI flash, the SPI flash will be what chooses which drives to boot from. Any problems when writing to the SPI can render your machine soft bricked. Learn about the SPI flash and recovery options here:

  1. https://wiki.pine64.org/index.php/Pinebook_Pro_SPI
  2. https://wiki.pine64.org/index.php/Pinebook_Pro#Using_the_SPI_flash_device

Preface

This guide is a simpler rewrite of pcm72's forum post. I'd recommend reading that whole thread before proceeding. We're going to be flashing the Pinebook Pro's SPI flash so that it contains boot code for the nvme. Your kernel needs to be compiled with SPI support. A simple check will be to see if /dev/mtd0 exists. I'm using Manjaro Arm.

Downloading files

Download the files from pcm72's git release page.

Flashing the SPI

This is all you have to do:

dd if=spiflash.bin of=/dev/mtd0 status=progress

Important details

In pc72's post, he explained why booting from micro-sd will fail. You basically have to remove all boot code from your micro-sd to have the SPI boot from it.

Here's how you do that:

dd if=/dev/zero bs=32k seek=1 count=1 of=<microSD>
dd if=/dev/zero bs=64k seek=128 count=64 of=<microSD>
dd if=/dev/zero bs=64k seek=192 count=64 of=<microSD>

Boot order

  1. micro-sd
  2. nvme
  3. emmc

I'm not sure if it's capable of USB boot.