Skip to content

A simple system to turn an ESP8266 or ESP32 into an SPI memory flasher

License

Notifications You must be signed in to change notification settings

samipfjo/ESP-SPI-Flasher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESP SPI Flasher

A simple system to turn an ESP8266 or ESP32 into an SPI memory flasher

 

Directions:

Getting the ESP side running

  1. Make sure your device has at least 4MB of memory!
  2. Make sure your board's USB-to-serial drivers are installed - Here is the most common one
  3. Install the PlatformIO CLI (or their VSCode extension)
  4. Configure ./src/SPI-Flasher/platformio.ini if you don't have a nodemcuv2 compatible device
  5. Open ./src/SPI-Flasher/ in your shell and run pio run --target upload
  6. Check the datasheet for your flash chip and read the pin connection requirements (WP and HOLD should be inactive)
    • NOTE: A pull-up resistor on the CS pin will cause boot loops; it is not needed
  7. Wire your flash chip to your device via the SPI pins (example)

 

Getting the host side running

  1. Install Python 3.6+
  2. Open a shell in ./src/read_server/
  3. pip install -r requirements.txt

 

Refer to "Flashing a BIOS chip" below now if you are doing so

 

Flashing the image to the chip

python spi_flasher.py -port [PORT] -baud 921600 -file bios.rom --erase --write

NOTE 1: If you get a bunch of "Hash mismatch" messages, press "ctrl + C" and lower the baud rate

NOTE 2: Erasing is mandatory prior to writes on (most) flash chips that have already been written

 

Flashing a BIOS chip

  • UEFI BIOSes
    1. Check the last 512 bytes of the file in a hex editor (HxD is a good one for Windows)
      1. All 0xFF means it is probably a bad image
    2. Open the BIOS file with UEFITool
      1. Click the drop-down before (...) capsule and ensure it says either "Intel Image" or "UEFI Image"
      2. Extract the image from the capsule (Action > Capsule > Extract Body)
    3. Make sure the size of the image and the chip match exactly
    4. Proceed with flashing

 

Author's note

This project was created to fix the BIOS chip of an ASUS M32AD that was bricked by a faulty automatic update, which it succeeded in doing!

About

A simple system to turn an ESP8266 or ESP32 into an SPI memory flasher

Resources

License

Stars

Watchers

Forks

Packages

No packages published