[Guide] Using CH341A-based programmer to flash SPI EEPROM

Hi guys,

I am having some issues with Intel ME on a HP elitebook I bough off ebay and wanted to fix it, which requires reflashing the bios. I got myself a black CH341A off aliexpress. I’m using the supplied clip to read the bios image, which actually clamps pretty reliably to the chip on the laptop board.

When everything is correctly connected the red POWER light on the programmer is on, which is fine. If I immediately run flashrom the bios chip is correctly detected as W25Q128.V. The thing is that after a second or so the amber RUN light also turns on and stays on forever as long as everything is connected. When this happens no communication with the bios chip is possible and can also not be detected anymore (No EEPROM/flash device found). If I reconnect the programmer or reclamp I again get it working for a second then the amber light comes on again. Obviously, I cannot run any operation on the bios chip in less that a second (except detect the model). The same behavior is observed on different PCs with linux of win or even if I just supply 5V to the programmer w/o PC.

I think the CH341A works fine since it can detect the chip in that first second. Could this be a voltage/current issue? (I did remove the main laptop battery as well as the bios battery) I don’t want to start soldering unless absolutely necessary since I’m not very (at all) skilled at it. Although I did get a new heat gun for SMD work just in case Anyone else experiencing such behavior? Should I get a new CH341A or solder the bios chip directly to my current CH341A?

20220329_125820.jpg

20220329_125835.jpg

1 Like

Hi guys,

I have an issue relate to my Panasonic Let’s note CF-SX4. I forgot bios password and can not access to PC now.
I used CH341A and already got the BIOS .bin file from BIOS chip (25Q128FVSQ).
I have another [Let’s note CF-SX4] without password and i plan to get the BIOS file from this one to write the broken one (with password). But i worry about serial number, UUID and LAN MAC ID could be same at both PC. Does it work?

Do you have any idea to find password from BIOS .bin file?

CH341A FlashROM for Windows

Version: 1.2-1094-g748575ab (2022-12-02)

I bought a device where the flash chip onboard happens to be an XM25QH128C by XMC from the now world-famous Wuhan. Since FlashROM support for this chip was only added recently, none of the existing Windows builds around come with it. So I built the latest current version for my own use. Sharing it below for the benefit of the community.

Download: flashrom-1.2-1094-outsyde-20221202-ch341a_spi-win64.zip (Mirror: Mega.nz)

Usage Notes

  • Works with the usual “driver” (really just an .inf file for VID:PID 1A86:5512), which is included in the ZIP as well. Credit for it goes to @flashrom I think, who also shared several builds here in the past. Might need to temporarily disable signature enforcement to install if you don’t already have it.
    • For driver installation issues, check the earlier posts in the thread: it’s been discussed extensively, and nothing’s changed since.
  • Only dependency is on libwinpthread-1.dll, which should be in the same directory. If you get an error: “The application was unable to start correctly (0xc000007b)”, it means this DLL file is missing.
    • Other libraries (libusb) are linked statically.
  • Output is verbose. Most warnings can be ignored unless there is an actual error. In particular: “Cannot detach the existing USB driver. Claiming the interface may fail.” is benign.
    • Note that the best practice is to connect directly to a USB port on the system board, not shared with any other devices, and especially not through any USB hub.
  • This build hasn’t been extensively tested, and since it’s just a snapshot cloned as-is from GitHub, it’s certainly not guaranteed to be stable. That being said, I tried reading and writing with a loose Winbond W25Q64FV I have lying around, and all worked fine (verifying too). For the record, I couldn’t check with an actual XM25QH128C as I don’t have the device yet. Still:
    • I won’t be responsible if you run into issues. If you don’t need support for any of the newer chips (see below), consider using any of the earlier builds already battle-proven in many scenarios.
  • Also included in the ZIP is the ich_descriptors_tool.exe tool, which builds together.

Updated Chip List

Over the version I was previously using (the one built and shared here by @flashrom), support has been added or expanded for over 60 chips:

  • Atmel AT25SF128A
  • Boya/BoHong Microelectronics B.25D16A B.25Q128AS
  • Eon EN25F10 EN25QH128 EN25QH32B EN25QH64A EN25S64
  • Fudan FM25F005 FM25F01 FM25F02(A) FM25F04(A) FM25Q08 FM25Q16 FM25Q32
  • GigaDevice GD25LQ128C/GD25LQ128D/GD25LQ128E GD25Q256D/GD25Q256E GD25Q40(B)
  • ISSI IS25LP064
  • Intel 25F640S33B8 AT82802AB
  • Macronix MX25L12833F/MX25L12835F/MX25L12865E/MX25L12873F MX25L1635D
  • Macronix MX25L3233F/MX25L3273E MX25L5121E/MX25L6465E MX25L6473E MX25L6473F MX25U25635F MX66L1G45G
  • Micron MT25QL256 MT25QU256
  • Spansion S25FL128L S25FL128S_UL S25FL128S_US S25FL256L S25FL512S S25FS128S (Large & Small Sectors)
  • Winbond W25Q32BV/W25Q32CV/W25Q32DV W25Q32FV W25Q32JV
  • Winbond W25Q32BW/W25Q32CW/W25Q32DW W25Q32FW W25Q32JW…Q W25Q32JW…M
  • Winbond W25Q64BV/W25Q64CV/W25Q64FV W25Q64JV-.Q W25Q64JV-.M W25Q64JW…M
  • Winbond W25Q256FV W25Q256JV_Q W25Q256JW W25Q256JW_DTR W25Q512NW-IM W25X05
  • XMC XM25QH64C XM25QU64C XM25QH128C XM25QU128C XM25QH256C XM25QU256C

Building from Source

I also couldn’t find any comprehensive and current build instructions for Windows, so here they are. To build, get MSys2 and run the following in the MSys2 MinGW64 shell:

pacman -Syu
pacman -S base-devel binutils git pactoys
pacboy -S cc libusb meson pkg-config
git clone https://github.com/flashrom/flashrom.git
cd flashrom && meson setup \
    --auto-features=enabled --buildtype=plain \
    -Ddefault_programmer_name=ch341a_spi \
    -Dprogrammer=ch341a_spi,dummy -Dtests=disabled \
    --default-library=static --prefer-static \
    --prefix="${MINGW_PREFIX}" --wrap-mode=nodownload \
   build
cd build && meson compile
  • After building, remember to copy libwinpthread-1.dll you can find in mingw64/bin directory together with flashrom.exe if you want to use this build of FlashROM outside the MSys2 MinGW64 shell, or on another device.
  • Note: it’s almost certainly not necessary to install the whole cc meta-package, just faster to grab it all rather than figure out which parts are needed (if you’re a lazy person with a fast connection at least). As a matter of fact, binutils might not be required either.

Enjoy!

PS Massive thanks to @flashrom for providing the earlier builds, which kept me going for years, without having to build it on my own.

3 Likes

Hello,
Sorry to bug. I’m in exactly the same situation as you were with this motherboard. Is there any chance you could share that Manufacturer file: 30528.BIN you got from them. They not answering me unfortunately. Will much appreciate your kind help.
Regards,

Does this programmer work with bios chip of asus b450m-a prime. I’m a newbie and I appreciate any help.

P.S. Does anybody know if there is a pin on Ryzen 2600 not making proper contact with the socket not saving date and time? CMOS is good btw. BIOS/UEFI Settings are being saved.

Flashrom v1.2-1186 for Windows + CH341A WinUSB driver.

flashrom_v1.2-1186.zip (224.0 KB)

2 Likes

An updated FlashROM for Windows build 1.4.0-devel (git:v1.2-1345-gd534100c) is attached.

The Winbond W25Q128.V (16M) chip, which was previously experimental, is now fully supported, as are many others too I guess.

The build process now also has Sphinx as a dependency. Add python-sphinx to pacboy -S.

flashrom-1.4-devel-1345-outsyde-20230826-ch341a_spi-win64.zip (381.0 KB)

1 Like

I have done the 3V Fix above on the Black Gold Edition of CH341A Chip.

Now i have measured the Pins and have on Pin 4 GND and PIN 1-3 & 5-8 3.28Volt if connected to USB

25XXX Chipset
Winbond 25Q128JVSQ
Voltages as follows:

  1. 3.3V - CS
  2. 3.3V - DO (IO1)
  3. 3.3V - WP (IO2)
  4. GND
  5. 3.3V - DI (IO0)
  6. 3.3V - CLK
  7. 3.3V - Hold/Reset (IO3)
  8. 3.3V - VCC

Can someone confirm this is correct ?

@Starfox
What’s wrong with the IC specs pdf from Winbond?
Isn’t this the most secure source of specifications regarding the IC correct operation and functions?

EDIT: Also latest CH341A back version, usually don’t need this fix anymore unless its old stock.
What more pins do you want with 3.3v…
The device operates on a single 2.7V to 3.6V power supply
And what’s that table…3.3 voltage on 7 pins???
You did what you did… so give it USB power and measure yourself the jumper cable output for VCC, this is where the IC need its input… what do you think that feeds the SPI_CMOS circuit???

How about when we have a motherboard with PSU_PW in standby or when remove/insert the CMOS battery… play a bit and do some measures for understanding.

I have read the IC Specs on Winbond Page, but there are no Voltages for the Pins except the VCC Pin

I need to be sure, that the 3.3 V Fix on the CH341A is working 100%

I have soldered Pin

:EDIT:

Yes 3.3Volt on 7 Pins, i have seen this Youtube Video and it seems to be correct.
CH341A Important 3.3v Voltage FIX - Motherboard BIOS Programmer

Can you please say about Boya BY 25Q128AS flash chip how to read data from it using flashrom?
I am beginner in this field please enlighten me with your experience in this field.

Hello. It might be a dumb question but I have a winband 25Q64JVS1Q (Last Q could be a 0 idk) bios chip on a MSI H110M-VH PLUS. Can I flash that with a CH341A flasher?

W25Q64JV - Serial NOR Flash - Code Storage Flash Memory - Winbond

The CH341A is a programming device, it works with a lot of flashing apps and ICs.
These apps must support the IC in their database, so primary it has nothing to do with the device itself.