Flashing a bios chip with an Arduino

In this post I will describe how to flash a BIOS (SPI) chip using a Arduino Duemilanove. I first learned about this method after reading about it on hackaday. At the time I had a Asus P5B motherboard that suffered from a bad BIOS flash and needed to be recovered. I tried other methods before but found none were as easy as this one.

So lets get started.

The requirements

Hardware

  • Arduino Duemilanove (full list can be found here https://www.flashrom.org/Serprog/Arduino_flasher )
  • A flash chip that is supported by flashrom ( full list available here https://www.flashrom.org/Supported_hardware )

Software

  • Ubuntu 16.04 VM
  • Flashrom
  • Fser-duino

Preparing the environment

Installing Git and the dependencies needed for Flashrom and frser-duino:

sudo apt-get install git libpci-dev libusb-dev libusb-1.0 gcc-avr binutils-avr gdb-avr avr-libc avrdude

Compiling and installing Flashrom

git clone git://github.com/flashrom/flashrom.git
cd flashrom
make && make install

Preparing the Arduino Duemilanove

git clone --recursive git://github.com/urjaman/frser-duino
cd frser-duino
make ftdi
make flash-ftdi

The table below shows which pins on the Arduino should go to which pin on the SPI flash chip.

Arduino Pins SPI Pins
12 SO
11 SI
10 CS
13 SCLK
3.3V VCC +/WP + /HOLD
GND GND

Flashing the SPI chip

To verify that everything is working correctly we first run flashrom without any operations:

tom@ubuntu-vm:~$ sudo flashrom -p serprog:dev=/dev/ttyUSB0:2000000
flashrom v0.9.9-91-g0bfa819 on Linux 4.10.0-28-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
serprog: Programmer name is "frser-duino"
Found Macronix flash chip "MX25L8005" (1024 kB, SPI) on serprog.
No operations were specified.

As can be seen from the above command output, both the Arduino and the SPI chip are detected. Now we can continue with writing the new BIOS to the chip:

tom@ubuntu-vm:~$ sudo flashrom -p serprog:dev=/dev/ttyUSB0:2000000 -w <NEWBIOS>

flashrom v0.9.9-91-g0bfa819 on Linux 4.10.0-28-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
serprog: Programmer name is "frser-duino"
Found Macronix flash chip "MX25L8005" (1024 kB, SPI) on serprog.
Reading old flash chip contents... done.
Erasing and writing flash chip... Erase/write done.
Verifying flash... VERIFIED.

And thats it, the new BIOS is written to the chip and all that is left is testing if my computer boots up again.

Resources:

HP ENVY SPECIFIC:

95 thoughts on “Flashing a bios chip with an Arduino”

  1. Hi, I have an HP Mini with IIRC the 25C32 but apparently it will probably work with a larger chip. Has anyone managed to clone a BIOS this way, in order to use the extra space for a bootblock etc?

  2. Hi,

    Not that I know of.

    What version of the HP mini do you have ( I cant find any HP mini with a 25C32 )?

    1. Sorry my bad, its actually on a different HP.
      The Mini uses a 16Mb (2MB) part.
      Also it just failed completely due to an SSD install, never seen this happen before. Any ideas?
      About the only change was to put the chip in a socket, so hopefully any repair should be slightly easier.

  3. Hi! When I try to make I get this error:
    alessio@alessio-VirtualBox:~/frser-duino > make u2 && make flash-u2
    DFLAGS= FRBAUD=115200 make clean all
    make[1]: Entering directory `/home/alessio/frser-duino’
    rm -f frser-duino.bin
    rm -f frser-duino.out
    rm -f frser-duino.hex
    rm -f frser-duino.s
    rm -f *.o
    avr-gcc -mmcu=atmega328p -DBAUD=115200 -Os -Wl,–relax -fno-inline-small-functions -fno-tree-switch-conversion -frename-registers -g -Wall -W -pipe -flto -fwhole-program -std=gnu99 -Ilibfrser -I. -o frser-duino.out main.c uart.c spihw.c libfrser/frser.c libfrser/udelay.c libfrser/spilib.c libfrser/spihw_avrspi.c
    In function ‘__vector_18’:
    uart.c:31:1: warning: ‘_vector_18’ appears to be a misspelled signal handler [enabled by default]
    ISR(USART_RX_vect) {
    ^
    avr-size frser-duino.out
    text data bss dec hex filename
    1370 0 1036 2406 966 frser-duino.out
    make[1]: Leaving directory `/home/alessio/frser-duino’
    BLBAUD=115200 SERIAL_DEV=/dev/ttyACM0 make program
    make[1]: Entering directory `/home/alessio/frser-duino’
    avr-objcopy -j .text -j .data -O ihex frser-duino.out frser-duino.hex
    avrdude -c arduino -p m328p -P /dev/ttyACM0 -b 115200 -U flash:w:frser-duino.hex
    avrdude: ser_open(): can’t open device “/dev/ttyACM0”: No such file or directory
    ioctl(“TIOCMGET”): Invalid argument

    avrdude done. Thank you.

    make[1]: *** [program] Error 1
    make[1]: Leaving directory `/home/alessio/frser-duino’
    make: *** [flash-u2] Error 2

    How to fix it?
    Thanks in advance,
    Alessio.

    1. I’ve looked into this (I was using ubuntu 12.04 and vmware). Depending on your Arduino it will either be on /dev/ttyUSB0 or /dev/ttyACM0. I have a Chinese Uno which does not have the 8u2 chip but instead has a Chinese FTDI chip so it will show up as /dev/ttyUSB0. I had to alter the makefile to make sure the correct device was selected when using the make u2 command. Finally I had to upgrade ubuntu to 14.04 and install VMWare tools to fix a problem I had when using flashrom. Please let me know if this works for you.

  4. hi.. I am using msi p67a-gd65. the bios is bricked. and it is in an infinite boot loop mode. I was going to do the things listed here but I am not really sure on what to do because the “how to do” issues are without any visual illustrations therefore I am easily lost on what to do. Am I able to do that on windows? or I need ubuntu specificaly to apply it? and is there a video or more pictures available ? so an amateur like me won’t get lost while trying to do it. I really appreciate your help.

    1. Hi Mehmet,

      If you are not able to follow the howto without extra information I would suggest sending your motherboard to someone who can repair it for you.

      Kinds regards,

      Tom

  5. Hi, unfortunately there is nothing said about the resistors if using the SPI header. But in the hardware part there are mentioned three of them, are they for the signal lines to reduce the voltage of the high level? I want to try flashing the bios on a MSI z77a-g45 with an arduino micro..

    1. Hi,

      I did not use any resistors during this project as they were not needed. The flashrom website I linked to below the post does speak of resistors for getting the correct voltage (5v or 3.3v). Ultimately it will depend on the kind of chip you are flashing.

  6. Hi Tom,
    thanks for your reply!

    I missed the link of the flashrom website about the arduino flasher, even though I browsed them for software reasons. Things are clear now, and my winbond 25Q64 chip can withstand VCC + 0.4 v and with a max VCC of 4.6 v it may work without resistors. Nevertheless I do not want to risk that and will built up level translation..

    Kind regards
    Lorenz

    1. Hi Lorenz,

      No problem! First time I get a response after giving a reply :D. To be honest I did not bother with the resistors because I’m kinda lazy. Luckily for me it worked perfectly. Will edit my post to mention the fact I did not use the resistors. Please let me know if you succeed with flashing your bios.

      Kind regards,

      Tom

      1. Hi Tom,

        I gave up trying to use my arduino micro, because its not supported by the serprog/frser-duino project! I did some research about that, but it looks like nobody is using a arduino micro to do rom flashing. The problem is, that the usb-to-serial bridge has moved in to the atmega32u4 chip on the arduino micro and it doesn’t look like there is an option in the flashrom program to use this kind of microcontroller.
        Good thing is, I get my mainboard working again using a LPT-to-SPI adapter according to this tutorial:
        http://rayer.g6.cz/elektro/spipgm.htm
        https://blah.cloud/hardware/fix-broken-motherboard/

        Now I am looking forward to find a solution without this outmoded LPT port. Maybe one day I have no PC left with a LPT port! But flashrom supports flashing via a raspberry pi and that looks great for me..

        Kind regards,
        Lorenz

        1. Hi Lorenz,

          Yeah its a bummer that your Arduino is not supported. You can always buy one that is supported by flashrom :). My first attempt was with the LPT to SPI adapter/cable but I could not get it to work and I shelved the project. When I read about using the arduino I decided it was time to try again.

  7. Hello,

    I have a issue while using the make flash-u2. In fact, i have this error:
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attenmpt 1 of 10: not in sync: resp=0x00.

    I’m using a mega 2560 and a VM of Lubuntu.
    can you help me please ?

    A.Murat

    1. Hi,

      I can not do much with the information you are giving me.

      Can you maybe give me some info on the steps you’ve taken?

      Kind regards,

      Tom

  8. hi,
    I have a problem. i did everything as you instructed. the first problem i came into was when i tried to read the bios chip which is MX25L1605D. the Error was cannot open serial port: permission denied. i searched around and found out that i need to chagne user. with this command

    sudo usermod -a -G dialout
    sudo chmod a+rw /dev/ttyACM0 (for uno r3) or ttyUSB0 (for nano with ftdi chip)

    then i was able to follow the read command but on arduino uno it says

    “Calibrating delay loop… OK.
    serprog: Programmer name is “frser-duino”
    Found Macronix flash chip “MX25L1605D/MX25L1608D/MX25L1673E” (2048 kB, SPI) on serprog.
    Reading flash… Error: invalid response 0x90 from device (to command 0x13)
    Read operation failed!
    FAILED.
    Error: invalid response 0xF5 from device (to command 0x15)
    serprog: serprog_shutdown: Warning: could not disable output buffers

    and on arduino nano it is just stuck on “reading flash” and doesnt go further

    can you please help.

    1. Hi Ali,

      The permission error is likely because you are not running the program as root or any other privileged user.

      From what I can gather the chip is detected but does not give the response expected by Flashrom.

      Could you give more information on: how you connected the wires and if you used the resistors or not?

      Kind regards,

      Tom

  9. Hi Tom. I have the same problem as Ali. I get to the point where it detects the chip but is stuck at “reading flash contents…”. I connected the pins as below and did not use resistor:

    [Header Pins] [Arduino Pins]
    ———————————–
    [1] VCC (3.3V in my case)[5V]
    [3] SO(MISO,DO)[12]
    [4] SI(MOSI,DIO)[11]
    [5] CS#(SS)[10]
    [6] SCLK(CLK,SCK)[13]
    [7] GND[GND]

    I have an Arduino ATMEGA328P board. It is detected as dev/ttyUSB0.

    Using 3.3V does not detect the port at all but when I connected to 5V, it detects the USB0.

    One thing I am curious is that, on the Arduino board, there are 2 other GND pins opposite the numbered pins (10, 11, 12, etc.). Same row as the 3.3V and 5V. Wondering if I should connect the GND header pin to either one of these Power GND pins in Arduino. Currently it’s connected to the GND next to Pin [13]. Thanks and would appreciate any help.

    Elmer

    1. Hi Elmer,

      I don’t own a Mega but I assume using another GND pin will not solve your issue.

      Are you using the software branch for the normal Arduino or the Mega?

      Kind regards,

      Tom

      1. When you say software branch, do you mean the board’s driver? Initially, I used the driver my mega came with. I got the driver from this website:

        http://www.wch.cn/download/CH341SER_LINUX_ZIP.html

        It is only good for Kernel versions 2.6.25 to 3.13.x which is up to Ubuntu 12.04. Board is recognized but got the result above. Gets stuck at “Reading flash..”.

        I upgraded to Ubuntu 14.04 and this time did not use the drivers with the board but somehow it is still recognized as USB0 so I figure it must be from my Arduino IDE installation that it gets recognized. Same result though. Moved cables to other GND and still get the same result. Might get a Raspberry Pi where some people have more success but I am just too close at this, it might just be something I am missing. Thanks anyhow. I will keep researching as someone might have experienced the same thing.

        Elmer

  10. I am using the normal branch for Arduino as it builds successfully using that branch only using “make u2 && make flash-u2”. I tried all the other branches and it doesn’t get a response.

    1. Did you use the following command as instructed by the arduino flasher page: “$ git clone –recursive git://github.com/urjaman/frser-duino -b arduino-mega-1280” ?

  11. done with raspberry pi 3 debian jessie and arduino uno. Its works thanks… 😀

    pi@Sasikirana ~/flashrom $ ./flashrom -p serprog:dev=/dev/ttyACM0:115200 -w P5KPL-EPU-0404.ROM
    flashrom v0.9.9-r1954 on Linux 4.4.36-v7+ (armv7l)
    flashrom is free software, get the source code at https://flashrom.org

    Calibrating delay loop… OK.
    serprog: Programmer name is “frser-duino”
    serprog: requested mapping AT45CS1282 is incompatible: 0x1080000 bytes at 0xfef80000.
    Found Macronix flash chip “MX25L8005/MX25L8006E/MX25L8008E/MX25V8005” (1024 kB, SPI) on serprog.
    Reading old flash chip contents… done.
    Erasing and writing flash chip… Erase/write done.
    Verifying flash… VERIFIED.

      1. Sory i dont have, i forgot to make screen shot my phone with juice ssh.
        I flash using command from ssh over my xiaomi phone. my computer die coz corupt bios, nothing change, just follow the instruction from article.

        fist time i don know how to flash it, if i buy bios flasher its make me spent extra money, so i think debian on raspi 3 or b+ can do it. its no thing to lose if fail (i assume bios broken) so must buy new one) so i try it.

        this my step

        download all library to my home dir on raspi debian weze, were its have mono, gcc, python (i have install homegenie smarthome, u can see on http://www.homegenie.it/)

        – sudo apt-get install flashrom gcc-avr binutils-avr gdb-avr avr-libc avrdude git
        – sudo git clone –recursive https://github.com/flashrom/flashrom.git
        – cd flashrom
        – then compile it with command make (look on flashrom instruction, coz some time u need to istall another library, on my case all ready no error on compile it)
        – then i download the flasher arduino
        sudo git clone –recursive git://github.com/urjaman/frser-duino
        – cd frser-duino
        – make u2 && make flash-u2
        – i see 2 new file
        frser-duino.out and frser-duino.hex
        copy or move it to folder flashrom
        mv frser-duino.out /home/pi/flashrom
        mv frser-duino.hex /home/pi/flashrom
        – then go to flashrom folder
        cd /home/pi/flashrom
        – download rom asus p5kpl with wget, extact it
        – then i get ot bios from mainboard to project board, wiring it with my uno

        [pin1 of the bios chip] /CS VCC 3.3V
        [pin1 of the bios chip] /CSArduino pin10(SS, PORTB2)
        [pin2 of the bios chip] DOArduino pin12(MISO, PORTB4)
        [pin3 of the bios chip] /WPVCC 5V
        [pin4 of the bios chip] GNDGND on the power pins
        [pin8 of the bios chip] VCC+3.3V on the power pins of the Arduino
        [pin7 of the bios chip] /HOLDVCC 3.3V
        [pin6 of the bios chip] CLKArduino pin13(SCK, PORTB5)
        [pin5 of the bios chip] DIOArduino pin11(MOSI, PORTB3)

        – connect raspi to uno via usb, i push reset button on my uno
        – then flash it
        ./flashrom -p serprog:dev=/dev/ttyACM0:115200 -w P5KPL-EPU-0404.ROM
        sow message bla bla bla VERIFIED

        – then i get back thts bios chip to my mainboard
        – viola now i can write this message from my pc again 😀

  12. Hello,

    After a while of solving problems, I got to a problem which i can’t solve. Someone above had same issue – i got stuck on “Reading old flash chip contents…”
    I use chinesse nano, and I’m trying to flash Winbond W25Q80 chip, it’s from asus motherboard. If it matters, only green led i lightning with a still green light. Any kind of idea what to do? ;-;

    1. Hi Patrick, we (me and maybe some other commenters) need some more info on what steps you took so far. It also good to know how you connected the arduino to the chip etc.

      Kind regards,

      Tom

  13. Hi,
    I need to reflash my M4N68T-M LE V2 motherboard’s BIOS chip. It uses cFeon EN25F80 chip, which is listed as working with this method. I previously had troubles programming my Geekcreit Arduino (uses Atmel ATMEGA328P), but that I got working. After some research I found that my Arduino is on dev=/dev/ttyACM0:115200, so I successfully addressed the Arduino. But while running flashrom I got errors:

    Calibrating delay loop… OK.
    serprog: Programmer name is “frser-duino”
    serprog: requested mapping AT45CS1282 is incompatible: 0x1080000 bytes at 0xfef80000 .
    No EEPROM/flash device found.
    Note: flashrom can never write if the flash chip isn’t found automatically.

    I checked the wiring, I even rewired it, then rewired it using resistor divider method described on flashrom.org. Still same result.

    Thanks for any suggestions.

    Kind regards,

    Franta

    1. Hi, so it seems Flashrom does not see the chip. Could you upload a picture showing how you connected the Arduino to the chip? Any other information is also welcome :).

      1. I am not very proud of this… umm… contraption? (I don’t have enough 10k resistors so i had to build them)

        http://i1382.photobucket.com/albums/ah276/krivulak/P_20170219_225730_zpsd7adnn9o.jpg

        Computer I am using is P4E 3.2GHz 3GB RAM with live Linux Mint.
        Also, when I tried to disconnect the chip, I got another error.

        There could even be possibility that the chip is fried, because I have never seen it working.

        If you need anything else to know, just tell me. 🙂

        1. Oh my. That is a lot of wires going all over the place. My advice would be to redo the wiring without the resistors. Could you maybe point out how you connected VCC and GND as I see lots of connections going from either VCC or GND directly to the chip.

          1. Hi,

            VCC is a pin on the BIOS chip, not the Arduino. On this particular bios chip pin 8 = VCC. I’m not sure how you oriented the BIOS chip but please have look at the datasheet: EN25F80 Datasheet, It will tell you almost everything you need to know. Also please let me know if you are uncertain on how to connect the wires, I might be able to help :).

  14. Oh, good grief, the chip has poorly marked the pin 1. It is mirrored!

    So I was able now to flash the chip correctly, everything went fine, except the fact that the motherboard still does not function. 😀

    Thank you for your time, you helped me very much!

      1. Yeah, sorry, I wasn’t around for some time. I don’t have the output of the FlashRom and since it was ran on Live Linux, it no longer exists. But it wasn’t the problem, the main issue with the board was destroyed USB controller, it hanged while initializing and after through investigation with multimeter I found out that the controller has short between Data+ and Power. USB headers were clean, so the chip is dead. I would have disabled it and use external 3.0 controller (the main plan was to use it like 4k HTPC), but I wasn’t able to get to the BIOS to disable the controller. Anyway, the old one went to “parts crate” and I bid on another one few minutes ago. 🙂

        1. No problem, thanks for getting back to me. I had to throw out my board as the network controller started failing :-(. Recently I got another P5B which is still running strong!

  15. I have an HP 20-d013w.

    I have followed the instructions and I am running Ubuntu in a VM.

    I have no issues until I try: “flashrom -p serprog:dev=/dev/ttyACM0:115200 -r old.ROM” to test by backing up the current ROM.

    flashrom will either hang during probing or terminate with the following:

    “No EEPROM/flash device found.
    Note: flashrom can never write if the flash chip isn’t found automatically.
    serprog: Output drivers disabled”

    I have tried all the possible combinations of the following:

    3.3v vrs 5.0v

    Swapping pins 11 and 12 (reversing MISO and MOSI)

    Moving pin 10 to the opposing SPI_CS# pin

    Moved the jumper on JSPISLT1/JFCHSPI1 from 1,2 to 2,3 and even removed it completely.

    I have tried every conceivable combination of all of the above. Nothing worked.

    I followed the steps outlined here: http://h30434.www3.hp.com/t5/Desktop-Hardware-and-Upgrade-Questions/HP-Envy-23-AIO-No-Beep-Screen-Blank-No-USB/m-p/5715632#M133287

    No change: Hanging or the same error as above on “Step 24”.

    I would appreciate any assistance.

    Thank you in advance.

  16. Hi,
    finally I managed to read MX25L8005 via flashprog talking to one of 2 Arduino Nano clones. First I tried with a clone which has a CH340G USB-Chip. No luck with that. Flashprog recognizes the MX25L8005 but never terminates. It’s stuck at “Reading flash…”.
    After fiddling a while, I tried with anonther Arduino Nano clone which has the FTDI-Chip. That worked:
    flashrom -p serprog:dev=/dev/ttyUSB0:2000000 -r dumped.rom

    Calibrating delay loop… OK.
    serprog: Programmer name is “frser-duino”
    serprog: requested mapping AT45CS1282 is incompatible: 0x1080000 bytes at 0x00000000fef80000.
    Found Macronix flash chip “MX25L8005/MX25L8006E/MX25L8008E/MX25V8005” (1024 kB, SPI) on serprog.
    Reading flash… done.
    Maybe the CH340 cannot handle the 2Mbit transferspeed? Tried with 115200, etc. but that didn’t work either. Flashprog then terminates with:
    Error: cannot synchronize protocol – …

    Used Ubuntu 14.04 and flashprog as well as frser-duino compiled from source.

    Greetings,
    Michael

  17. Worked! I used this method to re-program the EEPROM chip on my new ASRock Z170 Pro4 so I could upgrade to the bios that supports 7th gen CPUs. I needed to do this without a processor that would allow the board to get into bios since I only had the 7th gen processor. This did the trick and saved me from having to buy a chip or processor just to upgrade. Thanks a ton Tom!

    I used LUbuntu 16.04 for this on a old laptop. My tips to anyone trying this would be: Check if your bios chip has been confirmed as compatible or not on serprogs page. Make sure you have the Arduino IDE installed before attempting this. If you get a permission denied error add your user to the “dialout” group.

    1. That’s great! Also big thanks to you for letting me know it worked and for the tips, hopefully it will encourage more people to try it :).

      Kind regards,

      Tom

  18. Hi
    Keep getting “Error cannot synchronize protocol- check communications and reset device?

    1. Hi Michael,

      This error is caused mainly because the Arduino can not be found and or is not recognised. Can you show me how you’ve connected the Arduino to the BIOS chip?

      Kind regards,

      Tom

      P.s. Other helpful info (setup, type of Arduino etc) is welcome too.

  19. I am using an ELEGOO UNO R3 connected to a Winbond 25Q64FVSIG chip on a IPISB-CH2 Motherboard:
    pin 10 ELEGOO to CS
    pin 11 ELEGOO to DI
    pin 12 ELEGOO to DO
    pin 13 ELEGOO to CLK
    GRD ELEGOO to GRD
    3.3V ELEGOO to VCC
    The ELEGOO is USB connected to a Raspberry PI.
    sudo flashrom -p serprog:dev=/dev/ttyACM0:115200 -r /home/pi/old.rom
    flashrom v0.9.9-r1954 on Linux 4.9.24-v7+ (armv7l)
    Calibrating delay loop… OK.
    Error: cannot synchronize protocol – check communications and reset device?
    Error: Programmer initialization failed.
    I saw your response for this type of problem and redid all of my wires to try to verify that they are correct according to instructions from Stouffer’s blog. I have also tried this on another motherboard: IPMMB-FM with the same error. There is something basically wrong with my connection or procedure. I did not prep the ELEGOO device in any way. The device has a green power light and a flashing amber light which indicates something is going on. I probably need to spend time learning about the ELEGOO. I was just trying to see if I could save a friend’s Motherboard which may have a corrupted ROM.

    Any help will be greatly appreciated.

    Thanks,

    Fred

  20. As you requested, I have posted two images to imgur:
    http://imgur.com/a/Ub6Ue
    The first is the Motherboard zooming in on the 25Q64FVSIO and the header I am using to wire to the ELEGOO board. This is a new Motherboard so there is a good chance the 25Q… is good. I will work on the bad Motherboard once I learn how to read this chip. The second image is the wiring I have been using to try to read the 25Q…
    White is 3.3V, Brown is Ground, Red is CS, Purple is Clk, Black is DO, and Gray is DI. I metered the connections between the header and the chip more than once to make sure the connections are correct. The ELEGOO board is USB connected to the Raspberry PI. The ELEGOO uses the ATMEGA 328P chip. I used the make flash-U2 and I could see where binary code was flashed onto the ELEGOO successfully. I did notice that the ELEGOO yellow light does not pulse while the ELEGOO is connected to the RPI. I assume this has to do with the new code in it. The yellow light on the ELEGOO flashes a couple of times when the board is connected to the RPI via USB, but it no longer flashes all of the time. I am hoping this is a good thing.

    Meanwhile, I tried to go straight from the GPIO port on the RPI using the serial pins available there. I verified a loopback on send/receive, but again, I have not been able to read the 25Q… I’m not sure how much wire can go between the RPI and the 25Q.. header. I had about a foot. Also, I worry about possibly breaking the RPI trying to use this method.

    Pin 1 on the header is not connected. This pin usually has a jumper from pin 1 to pin 2 (CS) I think this is for VCC but I’m not sure. Anyway, there is no connection from this pin 1 on the header to any pin on the 25Q…

    For some reason, the 25Q is not giving up its secrets. Somehow, it is not being enabled.

    Any help will be appreciated.
    Thanks!
    Fred

    1. Hi Fred,

      Could make some pictures where I can better see what wire goes where on the arduino and rom_recovery header?

      Also do you have the header pinout of the rom_recovery header?

      My preliminary conclusion is that the wiring is not correct but I need some clear pictures to be sure.

      Kind regards,

      Tom

  21. More: I uploaded a blink program to the Elegoo and made it blink again; so, I know the Elegoo isn’t broken.

    Thanks,

    Fred

  22. The wiring may not be correct; however, I metered all of the connections from the header to the chip. I used a data-sheet for the chip to be sure I knew which pins should go where.

    After many hours of Google, I have decided that the problem is that the ELEGOO is having to power the Motherboard through VCC, and it is too much for it. I have ordered a TL866A USB Universal Minipro Programmer that may be able to do the job. Even this may require me to cut pin 8 on the chip to take the load of the Motherboard off the flasher. I don’t understand why there isn’t a jumper to isolate VCC to make flashing easier. There are very expensive flashers that can do the job, but I’m not in for that kind of money.

    In a couple of days, I should know more and will post what I find out back here.

    Thanks a lot for your help!

    Fred

    1. Hi Fred,

      I wouldn’t do anything drastic just yet.

      Cutting pins is never a good idea.

      Did you find the header pin_out I was talking about?

      p.s. I also installed a live chat function on the bottom right so we can chat directly and privately.

      Kind regards,

      Tom

  23. vm@ubuntu-VM:~/frser-duino$ sudo flashrom -p serprog:dev=/dev/ttyACM0:2000000 -w A7522IMS.8D0
    flashrom v0.9.9-r1954 on Linux 4.13.0-16-generic (i686)
    flashrom is free software, get the source code at https://flashrom.org

    Calibrating delay loop… OK.
    Error: cannot synchronize protocol – check communications and reset device?
    Error: Programmer initialization failed

    Arduino Uno v3 SMD, MSI X58 Pro, it is compatible. I bricked it by flashing a bios from the MSI website. I´m using Lubuntu 17.10 32 bit in Virtualbox, Arduino installed and user is added to group.
    I have used u2 because my Arduino seems to not have an FTI chip.

  24. I’m getting the dreaded ‘Error cannot synchronize protocol- check communications and reset device?’ error message when trying to flash an HP Envy23 with the corrupt BIOS. I followed the instructions via the comments from: https://www.youtube.com/watch?v=fnbVVwMbZCA (many of his commands were from: https://marcusstouffer.com/2016/11/25/raspberry-pi-and-arduino-uno-r3-to-manually-flash-hp-envy-bios/ ). I quadruple checked that my wires were in the correct location. I’m using an ELEGOO UNO R3 board, flashing from Ubuntu Mate.

    One thing I noticed, if I tried to use the 5V from the Arduino board, the connection to the PC would drop, but using the 3.3V , there was no issue.

    Any suggestions on what could be going wrong?

    1. Hi!

      I believe the error you are getting means that Flashrom can not communicate with the ELEGOO UNO R3. Could you post the full error message Flashrom gives you? Also what command are you using to run Flashrom?

      Kind regards,

      Tom

      1. Here’s the full command and result:

        dave@DaveUbuntu1:~/frser-duino$ sudo flashrom -p serprog:dev=/dev/ttyACM0:115200 -r old.rom
        [sudo] password for dave:
        flashrom v0.9.9-r1954 on Linux 4.13.0-25-generic (x86_64)
        flashrom is free software, get the source code at https://flashrom.org

        Calibrating delay loop… OK.
        Error: cannot synchronize protocol – check communications and reset device?
        Error: Programmer initialization failed.

        1. The last line confirms my suspicion. Flashrom is having trouble communicating with the ELEGOO. Did you get any errors when making frser-duino and was programming the ELEGOO successful?

          1. The only odd message I get during the initial setup process was this:
            dave@DaveUbuntu1:~/frser-duino$ make u2 && make flash-u2
            The program ‘make’ can be found in the following packages:
            * make
            * make-guile
            Try: sudo apt install

          2. This tells me that ‘make’ is not installed and thus the ELEGOO was never programmed, causing an error when trying to use Flashrom. Did you install all the dependencies for installing/making both Flashrom and frser-duino?

            A successful programming attempt would look something like this (please note that I use a different Arduino so the output is slightly different):

            sudo make flash-ftdi
            [sudo] password for tom:
            BLBAUD=57600 SERIAL_DEV=/dev/ttyUSB0 make program
            make[1]: Entering directory ‘/home/tom/Desktop/frser-duino’
            avrdude -c arduino -p m328p -P /dev/ttyUSB0 -b 57600 -U flash:w:frser-duino.hex

            avrdude: AVR device initialized and ready to accept instructions

            Reading | ################################################## | 100% 0.01s

            avrdude: Device signature = 0x1e950f (probably m328p)
            avrdude: NOTE: “flash” memory has been specified, an erase cycle will be performed
            To disable this feature, specify the -D option.
            avrdude: erasing chip
            avrdude: reading input file “frser-duino.hex”
            avrdude: input file frser-duino.hex auto detected as Intel Hex
            avrdude: writing flash (1416 bytes):

            Writing | ################################################## | 100% 0.77s

            avrdude: 1416 bytes of flash written
            avrdude: verifying flash memory against frser-duino.hex:
            avrdude: load data flash data from input file frser-duino.hex:
            avrdude: input file frser-duino.hex auto detected as Intel Hex
            avrdude: input file frser-duino.hex contains 1416 bytes
            avrdude: reading on-chip flash data:

            Reading | ################################################## | 100% 0.66s

            avrdude: verifying …
            avrdude: 1416 bytes of flash verified

            avrdude: safemode: Fuses OK (E:00, H:00, L:00)

            avrdude done. Thank you.

            make[1]: Leaving directory ‘/home/tom/Desktop/frser-duino’

          3. I have corrected the make installation. Now getting this error when attempting to flash:
            serprog: Programmer name is “frser-duino”
            serprog: requested mapping AT45CS1282 is incompatible: 0x1080000 bytes at 0x00000000fef80000.
            No EEPROM/flash device found.
            Note: flashrom can never write if the flash chip isn’t found automatically.
            Double checked the connections, made sure they were on the right pins. Tried moving the blue jumper to the left 2 pins, the right 2 pins, and removed altogether. All get same result. Any ideas?

          4. Hi Dave, good to hear flashrom recognizes your device now. Could you supply some more info like: what type of motherboard you are trying to fix. Also a photo that shows how you connected everything would be nice.

          5. I’ve tried using 5V several times, but as soon as I connect the wire to 5V, the Arduino board light goes from bright orange to a dim orange and loses connection to the Linux system. Once I go back to 3.3V, the board shows back up. I’ve used the USB power only, and also connected a power supply (not sure if that changes anything).

          6. I did some more research and found that most people trying to recover their HP machine use 5v because 3.3v is not working. If the ELEGOO is not able to deliver 5v while being connected over USB you might need to connect a power supply to the ELEGOO. The following is a post on the HP forum also confirming only 5v works: https://h30434.www3.hp.com/t5/Desktop-Hardware-and-Upgrade-Questions/HP-Envy-23-AIO-No-Beep-Screen-Blank-No-USB/m-p/5715632/highlight/true#M133287 and last but not least we have another tutorial saying the same: http://systats.or8.net/hpspi/

          7. Thanks for that. I have tried using an external power supply in addition to the USB cable, but drops out just as if there was no power supply there.

            Those were the same instructions I have been following. I’ll have to get my hands on a different Arduino board and see if that can handle the 5V load. Thanks again.

            If I have any luck I’ll make sure to post here to let you know.

  25. Using the Vin port, I was able to successfully read the old.rom, but when trying to write the new ROM, getting this error during the erase..
    dave@DaveUbuntu1:~/frser-duino$ sudo flashrom -p serprog:dev=/dev/ttyACM0:115200 -w new.ROM
    [sudo] password for dave:
    flashrom v0.9.9-r1954 on Linux 4.13.0-32-generic (x86_64)
    flashrom is free software, get the source code at https://flashrom.org

    Calibrating delay loop… OK.
    serprog: Programmer name is “frser-duino”
    serprog: requested mapping AT45CS1282 is incompatible: 0x1080000 bytes at 0x00000000fef80000.
    Found Winbond flash chip “W25Q64.V” (8192 kB, SPI) on serprog.
    Reading old flash chip contents… done.
    Erasing and writing flash chip… FAILED at 0x0020b000! Expected=0xff, Found=0x00, failed byte count from 0x0020b000-0x0020bfff: 0x1000
    ERASE FAILED!
    Reading current flash chip contents… done. Looking for another erase function.
    FAILED at 0x00415c00! Expected=0xff, Found=0x00, failed byte count from 0x00410000-0x00417fff: 0x2400
    ERASE FAILED!
    Reading current flash chip contents… done. Looking for another erase function.
    FAILED at 0x0020b800! Expected=0xff, Found=0x00, failed byte count from 0x00200000-0x0020ffff: 0x4800
    ERASE FAILED!
    Reading current flash chip contents… done. Looking for another erase function.
    FAILED at 0x0020b400! Expected=0xff, Found=0x00, failed byte count from 0x00000000-0x007fffff: 0x1cc00
    ERASE FAILED!
    Reading current flash chip contents… done. Looking for another erase function.
    FAILED at 0x0020b400! Expected=0xff, Found=0x00, failed byte count from 0x00000000-0x007fffff: 0x1cc00
    ERASE FAILED!
    Looking for another erase function.
    No usable erase functions left.
    FAILED!
    Uh oh. Erase/write failed. Checking if anything has changed.
    Reading current flash chip contents… done.
    Apparently at least some data has changed.
    Your flash chip is in an unknown state.

    1. Hi Dave, so we have some results at last. This error might have to with interference picked up by the wires etc. Could you try writing the chip again? Flashing can sometimes be a bit unreliable.

      1. I’ll definitely try again, I’ll switch out with some different wires.. and hopefully go with some shorter wires as well. Just a quick note, I have tried the flash probably 20-30 times already, but I’m not ready to give up. 🙂

          1. Well using shorter wires was all it took! I have flashed the BIOS with success!
            The bad news is the system still isn’t booting. I even went back and flashed to a previous BIOS, still with no luck. Not sure where to go from here.

          2. System is powering on, but getting no video. Some tries the fan will spin up fast, then slow down a bit, then go back to full speed and stay there. Other times the fan just comes on low and stays low. Not seeing any video or POST going on, but also no beeps or anything.

          3. Hmmm. Just out of curiosity, did you move the jumper above the ROM_RECOVERY header to the original position? Not sure if this does anything but I read that they needed to be moved in order to flash. So maybe moving it to the original position makes your system boot?

          4. I did. I moved the jumper back to the correct position, as well as putting the other jump back that was removed to flash.

Leave a Reply

Your email address will not be published.