1 2 Previous Next 16 Replies Latest reply on Nov 17, 2014 4:05 AM by mhahn

    How to recover after corrupted SPI flash.

    cooler1989

      Hello,

      I used FT4232H chip to program SPI flash with flashrom utility. "Something went wrong". Long story short, I can't even boot UEFI.

       

      There is a section (2.5.4 Force Recovery) in Galileo Board User Guide, but I don't know wheter it applies in case of corrupted UEFI. Is it?

        • 1. Re: How to recover after corrupted SPI flash.
          Clayton Hofrock

          I have step by step instructions using a Dedi-Prog.

           

          Fixing a "bricked" Galileo — Clay and Galileo

          • 2. Re: How to recover after corrupted SPI flash.
            AlexT_Intel

            Yes, force recovery is intended exactly for the cases when UEFI firmware is corrupted.

            • 3. Re: How to recover after corrupted SPI flash.
              Intel_Jesus

              Hi cooler1989,

               

              The recovery mode should fix your unbootable Galileo. You will need the use your serial cable to connect to your Galileo board via Linux. If you do not have a serial cable take a look at Sergey's Blog - Malinov Family Web Presence for steps on how to make one. You will need to build the FVMAIN.fv following the Intel® Quark™ BSP Build and Software User Guide section 8. To save you time i have attached a copy of my FVMAIN.fv using BSP 1.0.0.

               

              1. Copy the FVMAIN.fv to the root of a USB drive
              2. Disconnect the power supply from the Galileo Board
              3. Connect the serial cable to the UART port
              4. Open a client connection using Putty or similar program
              5. Connect the USB to USB HOST port
              6. Ground the resistor mentioned in section 2.5.4 of the Intel Galileo User Guide
              7. Connect the power supply to Galileo board
              8. A menu should popup Type "4" for the Galileo board

                   recover menu.png

              1. Remove the ground connection to the resistor
              2. Press "R" to recover the firmware

                   Recover option.png

              1. The recovery should take about five minutes.

               

              I suggest after the recovery has finished update your firmware from the Arduino IDE to make sure you have the latest firmware.

               

              Regards,

              Intel_Jesus

              1 of 1 people found this helpful
              • 4. Re: How to recover after corrupted SPI flash.
                cooler1989

                It doesn't work. Recovery mechanism probably uses part of firmware on SPI flash. The one that has been overwritten.

                Intel_Jesus: To be sure this way do not apply in this case, could you confirm that file you post was tested on real Galileo board?

                 

                I should find solution to work on clean SPI flash. I still cant figure out why I cant program flash using flashrom. Is SPI flash has some read/write protection mechanisms?

                • 5. Re: How to recover after corrupted SPI flash.
                  mhahn

                  It doesn't work. Recovery mechanism probably uses part of firmware on SPI flash. The one that has been overwritten.

                  yes, I think so.

                  I should find solution to work on clean SPI flash. I still cant figure out why I cant program flash using flashrom. Is SPI flash has some read/write protection mechanisms?

                  Did you flash the whole 8MB SPI flash - that might work. In case you flashed the 6.9MB capsule file: that isn't linearly put onto SPI. You'd have to cut the right pieces and program the right parts ...

                   

                  Anyways: in your case you need to find a serial flashing tool (like e.g. Dediprog) mentioned by Clayton

                  • 6. Re: How to recover after corrupted SPI flash.
                    Intel_Jesus

                    Hi cooler1989,

                     

                    I tested the file myself with my Intel Galileo Board. My Galileo board did not have the firmware corrupted though. I will try to corrupt my firmware and give it a shot. The best way to recover the firmware is to use the DediProg SF100 but its a bit expensive. If you happen to have one follow the instruction on Fixing a "bricked" Galileo — Clay and Galileo as chofrock suggested.

                     

                    Regards,

                    Intel_Jesus

                    • 7. Re: How to recover after corrupted SPI flash.
                      Intel_Jesus

                      Hi cooler1989,

                       

                      Here are my finding, I interrupted the firmware update causing my board to be unbootable. Then the recovery mode worked just fine. Now. i erased the SPI with the DediProg, and the recovery mode did not work. I dont think your SPI is corrupted, i think your SPI is blank or partially blank. You would need to flash it with the .bin file via SPI Flash Program port. The .bin file needs to be build with the MAC address specific to your Galileo Board. You can find all the instructions on the Intel® Quark™ BSP Build and Software User Guide or send me a private message with the MAC address of your Galileo Board and i will build the file for you.

                       

                      Regards,

                      Intel_Jesus

                      • 8. Re: How to recover after corrupted SPI flash.
                        AlexT_Intel

                        I've just re-read the original post and I too think the reason is that the flasher program overwrote/corrupted these pieces of SPI, which have to be present for Recovery to work (there are some, they aren't updated during normal board operation or even FW update, so it's hard to corrupt them), so yeah, I think DediProg is the only way to go and for that one a full image with so called Platform Data is needed  (not a capsule file), just like Intel_Jesus mentioned.

                        • 9. Re: How to recover after corrupted SPI flash.
                          cooler1989

                          By corrupted I meant overwrite by some random data in random places. Now like I said, I am using FT2232H to program.

                           

                          I know I ask questions more specific (deeper) than most galileo arduino users, but I have another one coming.

                           

                          I had to change SPI flash chip to other manufacturer - it probably got burnt in desoldering/soldering process. New chip is not detected correctly. Partially at least. After sucessfull programming I got following dispach:

                            1 Unlock flash components fail!

                            2 ERROR - Unknown SPI Flash Device, Vendor Id: 0xFF, Device ID: 0xFFFF!

                            3

                            4 ASSERT_EFI_ERROR (Status = Unsupported)

                            5 Unlock flash components fail!

                            6 ERROR - Unknown SPI Flash Device, Vendor Id: 0xFF, Device ID: 0xFFFF!

                            7

                            8 ASSERT_EFI_ERROR (Status = Unsupported)

                          And I assure you that my SPI flash does not have 0xFF Vendor and 0xFFFF device ID. What could go wrong if it started to execute EFI (assert_efi suggests that), and I was told that this flash is supported by quark. Maybe this question deserves new post. It is more EFI related.

                          • 10. Re: How to recover after corrupted SPI flash.
                            mhahn

                            wow, you folks are doing cool stuff ...

                            just out of curiosity: why did you exchange the SPI?

                            • 11. Re: How to recover after corrupted SPI flash.
                              cooler1989

                              Like I said It got burnt :].

                               

                              I already know that EFI from new chip is executing, but it cannot validate ID of this SPI flash - that's somewhat wierd. From source code of EFI I also know that my chip is not explicitly supported by quark, but it's older brother is. So it should only trip on validating ID of chip - but should print correct ID of chip I am using. But it is not. Using newer SPI img v1.0.1 I got Vendor Id: 0x00, Device ID: 0x0000!

                              • 12. Re: How to recover after corrupted SPI flash.
                                mon2

                                Hi cooler1989. The past few 2 months of R&D into the SPI operations for our pending reflash tool for the Galileo board has been quite a learning experience for our side. Please note that when you are using the Intel Galileo, the host QUARK CPU is the SPI Bus Master. Respectively, the QUARK CPU is driving the CLK, Chip select, etc. lines related to the SPI interface.

                                 

                                Now, when you enter with your FTDI solution, the FTDI is also attempting to be SPI bus master(!). In the words of Duncan MacLeod of the Clan MacLeod (Adrian Paul), 'There can only be ONE'.

                                 

                                For this reason, please test your idea again, to access the SPI flash but before you launch the FTDI application, press the RESET (or it may be REBOOT) button AND keep them pressed during your external SPI bus master read/write. We do recall we had to do the same during the experiments with our Aardvark SPI tool.

                                 

                                You are quite correct in that the SPI flash has non-FF IDs. Out of curiosity, which vendor of flash do you have ? We have the Winbond W25Q64 device.

                                 

                                Hope this helps.

                                 

                                Kumar

                                • 13. Re: How to recover after corrupted SPI flash.
                                  cooler1989

                                  mon2 wrote:

                                   

                                  Hi cooler1989. The past few 2 months of R&D into the SPI operations for our pending reflash tool for the Galileo board has been quite a learning experience for our side. Please note that when you are using the Intel Galileo, the host QUARK CPU is the SPI Bus Master. Respectively, the QUARK CPU is driving the CLK, Chip select, etc. lines related to the SPI interface.

                                   

                                  Now, when you enter with your FTDI solution, the FTDI is also attempting to be SPI bus master(!). In the words of Duncan MacLeod of the Clan MacLeod (Adrian Paul), 'There can only be ONE'.

                                   

                                  For this reason, please test your idea again, to access the SPI flash but before you launch the FTDI application, press the RESET (or it may be REBOOT) button AND keep them pressed during your external SPI bus master read/write. We do recall we had to do the same during the experiments with our Aardvark SPI tool.

                                   

                                  You are quite correct in that the SPI flash has non-FF IDs. Out of curiosity, which vendor of flash do you have ? We have the Winbond W25Q64 device.

                                   

                                  Hope this helps.

                                   

                                  Kumar

                                   

                                  Quark is completely powered off and SPI flash is powered from the same source as FDTI - PC host USB power.

                                   

                                  I am using Spantion S25FL164K, but older version S25FL064K is supported - that model is defined in the source of EDKII firmware.

                                  • 14. Re: How to recover after corrupted SPI flash.
                                    MarcIII

                                    It doesn't work. Recovery mechanism probably uses part of firmware on SPI flash.

                                     

                                    Yes it does. In the layout.conf you can see that there is a special recovery code section in the Flash that is never updated to ensure there is still something to run even if you unplug the power cable at the worst possible moment, like you were trying to brick the system.

                                    1 2 Previous Next