[Guide] Recover from failed BIOS flash using Raspberry PI

Thanks for this. My desktop froze in the BIOS then didn’t POST, reflashed BIOS and it works.

Lost MAC from the Intel NIC though. As I haven’t seen anyone else say how to restore it, there’s 3 methods I’ve found:
1. ASRock have a DOS app to rewrite it. Writing a specific NIC seems impossible, I had to disable the other (Realtek) NIC.
2. ASUS use a default MAC of 88:88:88:88:87:88 (stored as bytes), for my board, it was at offset 0x1000 in the BIOS file.
3. FD44Editor

#3 would be best since the BIOS also contains the motherboard serial and other info. If you don’t have a copy of the old BIOS for the data, this thread has the settings to use and what sticker on the motherboard is what data.

I have trouble extracting or checking a vendor’s .cap: when I open it with UEFItool, it says “UEFI image” on top. After I extracted the body, I searched for the 0x0FF0A55A signature on offset 0x10, but it’s nowhere. What could went wrong?
I’ve attached the files. Pls help.

bios-files.zip (4.33 MB)

Not worked for me. the output is:

pi@raspberrypi:~ $ sudo flashrom -E -V -p linux_spi:dev=/dev/spidev0.0
flashrom v0.9.7-r1882 on Linux 4.4.48-v7+ (armv7l)
flashrom is free software, get the source code at http://www.flashrom.org

flashrom was built with libpci 3.2.1, GCC 4.9.2, little endian
Command line (4 args): flashrom -E -V -p linux_spi:dev=/dev/spidev0.0
Calibrating delay loop… OS timer resolution is 3 usecs, 300M loops per second, 10 myus = 11 us, 100 myus = 101 us, 1000 myus = 1002 us, 10000 myus = 10028 us, 12 myus = 14 us, OK.
Initializing linux_spi programmer
Using device /dev/spidev0.0
linux_spi_init: failed to open /dev/spidev0.0: No such file or directory
Error: Programmer initialization failed.

@ErfanDL

If the spidev0.0 is not found you should double check the wiring, this error is almost Always because of a miss in the wiring.


thanks for reply. problem is solved by enabling SPI from raspi-config.

Ok, great :slight_smile:

Hello Pacman, can you elaborate more on the WP pin of JSPI1?
I have a MSI 970A-G43 motherboard with Winbond W25Q64 which I assume that it is write protected.
I can’t flash a bios inside it because every single time I try, it tells me that no SPI devices were assigned/connected something like that.
Then I proceeded with clearing the corrupted bios, which worked well.
Now the motherboard is like a piece paper waiting for me to write a bios inside it.

So, my questions are the following below.
Is there some sort of jumper to clear the write protection and things like that?
Or just disconnecting the WP jumper will make the bios pass?

Any advice would be great!
Thanks in advance.
Sorry for bad English, not my native language.

Hello

The WP pin should be kept to 3.3v for disabling write protection, it is protected when kept to ground, but if i may ask some questions,
i assume your BIOS chip is soldered to the board, right?
Is your JSPI1 9 pin?
When you say that clearing the BIOS went Ok, do you mean you erased it from the PI?
Are you connecting to JSPI1 with resistors?

Yes, the bios is soldered to the board.
Yes, my JSPI1 is 9 pin and i connected only 8 of them. (1-8)
Yes, i erased the bios using the RasPI.
No, i didnt connect the JSPI1 with resistors.

Ok, this is very interesting, i have never seen that before, that you could erase the chip without errors, but it could not find the chip when you try to write.
Without the resistors is good, i have seen some people that they caused problem for.

Have you tried giving the write command several times in a row? if it fails the first time, just try one or two times quickly after that.
Or give the erase command, and then the write command right after that.
And double check the wiring, keep the wires as short as possible.

It seems to me that if you can erase it, you should for sure be able to write it.

EDIT: Also, there is a speed command i have not explored, you could try this command: sudo flashrom -w /tmp/1.rom -V -p linux_spi:dev=/dev/spidev0.0,spispeed=512

Hello
Thanks for your help, turns out there was a fault at the command line because i didnt followed it right.
I did succeded in flashing the bios, but i had a few questions since it didnt work at all.
So, i wanna ask a question, if the file i downloaded from tbe website is in file format which is not in .rom format, what do i do?
-Flash the file directly
-Cconvert to .rom file using UEFItool on a PC.
I did the second method and theres no post/boot on both of my motherboards.
I just thought of this which caused me failed fixing both of the motherboards.

Ok, yes, the file has to be a rom file, and display as a Intel image in UEFITool, if it is a .cap file it will not work.

My first post on this forum hi folks :slight_smile:

Here is my story (You don’t have to read all thing, If you don’t go down)
I changed a value on my modded bios and screen goes off and could’t get back default settings without screen (hdmi and vga not working too)
So I decide to follow this guide and do it again (yes I did It before this)
Connected wires to raspberry pi GPIO pins and flashed everything goes it used to be
Then I plug the charger to mainboard WITHOUT disconnected my little raspberry, seems everything ok. Leds are blinking on mainboard then I remember to remove pi and remove WITH CHARGER ON MAIN BOARD. (Capital letters means a huge mistake)
And no red blinking on mainboard. So I deceiden to flash again.
Did the same process but pi reboots everytime I connect all wires. About 6 months ago I flashed the same bios dump and when I connected all wires it reboots and disconnect some wires -which I didn’t remember- flashed correctly.
Indeed this time I suprised when flashed correctly in first time. Maybe l’m so lucky, some disconnected correct wires and flashed.

I decided to make it flawless and raspberry pi shutdown and don’t turn off when I connected 3 or 8 pins to the chip. (find non-reboot pins with many many tries)





my bios chip is Winbond W25Q32BV and you can find pin configuration below



My question is how can I correctly connect that without any shutdown or reboot?
|addpics|fl6-1-6e0d.jpg,fl6-2-7c15.jpg,fl6-3-c59e.jpg|/addpics|

Hello,

I thought maybe I post in this thread, too. I have this wiring and flashrom can not detect the chip. It is a W25Q64FV. The wiring seems correct to me, I also tried several other constellations. spidev0.0 ist loaded, and I have 3.3V where it belongs. I even can measure a peak when sending flashrom commands to the chip. So SPI Interface seems to be working. The chip is ok, too, because it still boots (I actually try to overwrite a working bios). So I have run out of ideas.

Hello

Have you tried specifying the chip?
Adding the switch -c W25Q64.V

yes, but it will not detect it either. It says no eeeprom / flash device found. I tripple and tripple checked the wiring, I believe I should probably reinstall raspbian.

Well, it is of course always difficult to troubleshoot from a distance, but some generic advise would be to put a small capacitor as close the chip as possible, around 10n, between + & gnd, even stripping the + & gnd wires a little and soldering it on there may help.

// deleted because wrong assumption.


Hello Coderush,

can you explain this step?
My problem is a corrupted bios, i could save it with programmer, but how to rebuild it from a factory bios-file? It is smaller, serials missing, FD44 can’t open the files. Neither spi-image nor factory bios.



Hi there;

I’m having the same problem: 0xFFFFFFFF when connected; 0x00000000 when disconnected.


I tried two Raspberry Pi v2B 1.1 with the 40pin GPIO header and even tried an external source for power; a Skytronic which I can set anywhere within the range specified by Winbond (between -0.6 tot 4.6).

Tried multiple chips (even a old motherboard ready for dumping); all the same issue: 0xFFFFFFFF when connected, 0x00000000 when disconnected.

Have you ever found a solution for this issue?
Thanks!