Recovery from bad SPI flash image
#1
Purpose

Experimentation with SPI flash and u-boot can/will result in a board that will not boot.

Background

To recover from this it is necessary to prevent booting from SPI. This can be done by shorting the flash chip's clock pin to ground. This will allow you to boot to micro SD card so that you can either erase the bad image or erase/write a new one. Erasing and writing images to SPI flash are beyond the scope of these instructions as it is assumed the user successfully flashed the SPI NOR with a bad u-boot image or images.

It is also assumed you have the following:
  • A separate host with a serial connection to the RockPro64
  • A micro SD card with a known good u-boot installed on it (and possibly fixed u-boot image files placed in a partition to reflash SPI NOR)
Preparation

Turn the RockPro64 off before continuing.

Press and hold the Power button for approximately 10 seconds. If the RockPro64 is connected to a network switch, the network switch LED representing the RockPro64 connection will turn off. If you are not set up that way and cannot observe this, then holding the power button for the 10 seconds duration is long enough to turn the board off.


Pin Shorting Methods

Pi-2 GPIO

This method is the easiest and preferable method.

Connect pins 23 and 25 using a jumper or female-female jumper wire.

SPI Flash Chip

The asterisk represents the indentation on the chip (which identifies pin 1). The code rendering is broken, so the ASCII graphic below cannot be fixed, but you will get the general idea which pin is which.

Code:
+------------------+
     |*                 |
CS --- 1            8 --- VCC
     |                  |
SO --- 2            7 --- HOLD/RESET
     |                  |
WP --- 3            6 --- SCLK
     |                  |
VSS --- 4            5 --- SI
     |                  |
     +------------------+
GD25Q127CSIG

Connect pins 6 and 4 using a Pomona 5250 clip and female-female jumper wire. Micro hook test clips could also be used to short the two pins.

Final Recovery

Once the SPI flash pins have been shorted using one of the methods above, insert the known good micro SD card into the the board's slot and power it on. Hit any key on the keyboard to prevent u-boot from trying to autoboot, once it stops at the u-boot prompt you can either erase the SPI flash, or erase/write a new image to it AFTER you have removed the short between the pins.
  Reply
#2
Thank you for this article!

Is this "shorting" method really safe for the chip? Otherwise, if you already have a Pomona 5250 clip, I would recommend to just erase the flash chip using flashrom and a suitable flasher.
  Reply
#3
(10-31-2020, 04:12 PM)kuleszdl Wrote: Thank you for this article!

Is this "shorting" method really safe for the chip? Otherwise, if you already have a Pomona 5250 clip, I would recommend to just erase the flash chip using flashrom and a suitable flasher.

Hi! Yes it is safe. I have tested both methods and the easiest to use method is the jumper between pins 23 and 25.
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)