DEV Community

Cover image for Read&Write BIOS Image using Dediprog SF100 SPI NOR Flash Programmer
MachineHunter
MachineHunter

Posted on

Read&Write BIOS Image using Dediprog SF100 SPI NOR Flash Programmer

SPI flash stores most of the module executed by UEFI BIOS. If you want to extract actual UEFI module to take a look at, or modify some of the content, SPI flash programmer is a perfect solution. Moreover, some BIOS images are distributed as .bin file, and you can use SPI flash programmer to update BIOS with those image.

Environment

I will be using followings in this article.

Finding SPI Flash Chip and detecting Device ID

For UP2 board, you first have to take off heatsink like this.
Image description
Most SPI flash chip is manufactured by winbond, so it is one way to find a chip that has a letter "winbond" written. In my UP2 board, it was located here. It first had a seal on so I had to take off the seal to find this.
Image description
It's too small to look from above picture, but it says winbond 25Q128JWSQ 2117 which we can tell that the device ID for this chip is W25Q128JW.

Setup for using SF100

Download the following three items from here.

  • Latest version of software for using SF100
    • I downloaded version 7.3.90.46
  • USB driver
  • USB Driver User Guide for Win 8/8.1/10

You will be asked to enter your email and serial number when downloading. The serial number is written on the back of the SF100.
Image description

Once downloaded, run .msi installer to install the software. If the following 4 app shortcuts are generated on the desktop (note that I have moved contents to a folder), then the installation is complete.
Image description

After that, you have to setup the USB driver.
Let's connect SF100 and TestClip like this.
Image description
You can referer to the "USB Driver User Guide" from now on, but here's what I did. First, connect the above to the Host PC (which you will be using for manipulating SF100) and check the device manager. It should be like this.
Image description
Right click the above "SF100-ISP" and select "Update Driver Software...". Then follow the steps below.

  1. Browse my computer for driver software
  2. Let me pick from a list of device drivers on my computer
  3. Click Next without selecting any
  4. Click Have Disk
  5. Browse and locate the USB driver we downloaded before dediprog.inf and click OK
  6. Select "DediProg SF Programmer driver" and click Next
  7. Installation will start and if nothing goes wrong, "Window has successfully updated your driver software" will be shown.
  8. Again if you open device manager and see this, then it's a success Image description

Recognize SPI flash from Host PC

Now let's clip the SPI flash with the TestClip. Looking closely, you will see a dot on flash chip, and small white paintings on the TestClip. Make sure you clip it the right way, so that the white paint and the dot on the chip are in the same position.
Image description
After that, connect USB cable to the host PC and run the software "DediProg Engineering" which is one of the 4 shortcuts created after installation.
Image description
If it recognized correctly, the software asks you to select SPI flash Chip ID. You have found out that the device ID was W25Q128JW so select that. If there's no error, then the recognition is success.

Reading SPI flash

( The usage of SF100 software is written in "DediProg Help" which is one of the four desktop shortcuts created at installation )

To read the SPI flash content, click the Edit icon and then, press Read.... While reading, busy lamp glows orange on SF100, and the percentage of progress will be displayed on the place where Read... button was located.
Image description
After reading is complete, you can press Chip Buffer to File to save image as a .bin file.

After saving file, you might get an error message like an unnamed file contains ..., but you can ignore that. If you are not sure you've read the flash contents successfully, check if the contents start with the flash descriptor's magic byte 5A A5 F0 0F.

Writing SPI flash

Click Config icon and select/check the following two items.

  • Download a whole file to chip (Without Blank Check)…
  • Reload file each time Image description Then, press OK. There will be about two warning messages showing up, but you can ignore those. Next, click File icon and do the followings.
  • click Find and select the BIOS image file you want to write in
  • select Raw Binary and make sure you don't check Trucate file to...

After pressing OK, check if you have Operation completed. Finally, press the Batch icon and start flashing.
Image description
You can check if flashing is over by seeing if busy lamp becomes pass. You will see this kind of log output if it succeeded.
Image description
If you want to restore it, you can use the flash content file read in the previous section.

Acknowledgement

Great thanks to Satoshi Tanda for the support and for introducing this wonderful topic.

Top comments (0)