Flashing U Boot to SPI - sigmaris/u-boot GitHub Wiki

Before trying to use SPI flash, I strongly recommend connecting a serial / UART console so that you can see more information about what's going on in the U-Boot and Linux console messages.

Instructions for RockPro64

Download flash_spi.img.gz from the latest release, uncompress it and write it to an SD card.

If you have an eMMC module attached, either disable it using jumper SW4 or remove it temporarily. Insert the SD card while the RockPro64 is powered off, then turn on the power. After a few seconds, you should see the white LED blink several times, and eventually switch to being constantly on without blinking. If you have a serial console, you should see on it "Wrote U-Boot to SPI Flash successfully."

Once the white LED is constantly on, remove the SD card, insert whatever boot media you want to use, and reset the RockPro64. It will start U-Boot from the SPI Flash.

If you see both red and white LEDs blinking, it indicates the SPI Flash wasn't detected. Check you're not bridging the SPI CLK pin to GND (see below).

If you see the red LED alone blinking, it indicates the SPI U-Boot image couldn't be found on the SD card - try a different card.

Recovering from problems with SPI

Since the SPI flash is first in the RK3399 boot ROM's boot order, if there is a problem with SPI boot it can be tricky to recover, since if the SPI boot program loads but doesn't work, it can't boot from a recovery SD card or eMMC. In this case, you can temporarily disable SPI by bridging pins 23 (SPI CLK) and 25 (GND) on the Pi-2 Bus header. This will disable SPI and let you boot from eMMC or SD card; you can then interrupt U-Boot by pressing a key on the serial console at the "Hit any key to stop autoboot" prompt, remove the bridge between pins 23 and 25, and then enter:

sf probe
sf erase 0 400000

to erase the SPI flash, so it won't be used to boot.