Page 6 of 49
#76 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by Wootever 19.09.2017 18:40

I'd like to introduce another programmer application (flashrom) and driver for Windows, which i personally prefer over the default software.
I created a simple CH341A WinUSB driver, signed it and bundled it with a driver installer.

Download flashrom_windows.zip

Instructions:
Extract the provided archive and execute Install.cmd, it will automatically install the CH341A WinUSB driver and open a command shell to access flashrom.
Enter flashrom in the command shell to probe for the device and connected flash chips:

flashrom

Calibrating delay loop... OK.
Found Winbond flash chip "W25Q64.W" (8192 kB, SPI) on ch341a_spi.
No operations were specified.


To read data from the flash chip:
flashrom -r backup.bin

Calibrating delay loop... OK.
Found Winbond flash chip "W25Q64.W" (8192 kB, SPI) on ch341a_spi.
Reading flash... done
.


To write data to the flash chip:
flashrom -w bios.bin

Calibrating delay loop... OK.
Found Winbond flash chip "W25Q64.W" (8192 kB, SPI) on ch341a_spi.
Reading old flash chip contents... done.
Erasing and writing flash chip... Erase/write done.
Verifying flash... VERIFIED.


Changelog:
- Added CH341A patches from flashrom patchwork.
- Added support for FTDI and PICkit 2.
- Added timer and progress bar.
- Built from current staging branch.

#77 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by Wootever 11.10.2017 21:39

Edit: Updated my previous post with the new flashrom windows binary.

Sometimes flashrom identifies several flash chip types, which need to be specified with the -c command:

flashrom

Calibrating delay loop... OK.
Found PMC flash chip "Pm25LV010" (128 kB, SPI) on ch341a_spi.
Found PMC flash chip "Pm25LV010A" (128 kB, SPI) on ch341a_spi.
Multiple flash chip definitions match the detected chip(s): "Pm25LV010", "Pm25LV010A"
Please specify which chip definition to use with the -c <chipname> option.
.


Read BIOS from a specified flash chip:
flashrom -c Pm25LV010 -r backup.bin

Calibrating delay loop... OK.
Found PMC flash chip "Pm25LV010" (128 kB, SPI) on ch341a_spi.
Reading flash... done.

#78 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by Wootever 16.10.2017 12:13

3.3V Programmer CH341A
1.8V Adapter for the CH341A

#79 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by minarikka 16.10.2017 23:00

Is there a way to patch the three files generated by Paul Kocialkowski that allow flashrom to read the ENE KB9012 EC chips to this Windows version?

#80 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by Wootever 17.10.2017 08:08

@minarikka
Here is a compiled flashrom.exe with ENE KB9012 support built from git.code.paulk.fr

#81 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by SilverPuppy 29.10.2017 16:17

Wow. Wootever, you are the best of the web. Someone who would go to all the work to build that, and then just throw it out there for anyone to use is a scholar AND a gentleman. :D Granted, that's the whole FOSS community modus operandi, and kind of how the Bus Pirate came to be, but still....I'm seriously appreciative.

I guess I'm buying a CH341A now. I bought a TL866A instead because it supposedly supported ICSP, but then I got it home and found out that it only supports it on a handful of chips, and the uber-common 25SPI chips are not supported for ICSP and it won't work. >:( I only didn't buy it because it was late at night and I interpreted a warning about being unable to write to ESMT 25s as being unable to write all 25SPI chips. My bad. I'm working with Macronix so it should be just fine.

Is there any reason you can think of why it wouldn't work with the MX25V4006E family? Datasheet says they run 2.5-3.6 volts, which puts the CH341A in spec. It's on a Toshiba hard drive board.

#82 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by Wootever 02.11.2017 17:23

@SilverPuppy
Unfortunately just found out that the black pcb version supplies 5V to the chip due to an improper design (CH341A Programmer Schematic, CH341A Power Supply Fix).
Might be possible that it would fry 3.3V chips that are less tolerant to 5V.

The green pcb version works correctly by supplying only 3.3V to all pins, but i would also recommend to order the 1.8V adapter as an secondary safety measure.

Green PCB:


Black PCB:


Pin Overview:


The voltage on CH341A VCC (5V or 3.3V) provides the same amount to CS, DO, CLK, DI


Edit:
About the MX25V4006E, it seems that flashrom has no specific support, but the corresponding MX25L and MX25V versions seems interchangeable.

From flashchips.h:
#define MACRONIX_MX25L4005 0x2013 /* Same as MX25L4005A, MX25L4005C, MX25L4006E */
#define MACRONIX_MX25L8005 0x2014 /* Same as MX25V8005, MX25L8006E, MX25L8008E, FIXME: MX25L8073E (4k 0x20) */


From the Macronix driver:
#ifdef MX25V4006E
#define FlashID 0xC22013

(0xC2 is the vendor id and 0x2013 the chip id)

#83 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by mooms 06.11.2017 19:20

Thank you very much Wootever, your work is very appreciated !

I've used the the black PCB version (with Flashrom, because with the Chinese flash program I had errors with 1.18, 1.29 and 1.30) on a Winbond 25Q128FV1Q with success, although the flash was somewhat slow, it worked great.
I used it to disable the ME (Management Engine with) me_cleaner.

Since you said this programmer can fry some chips, I had ordered the green one you've linked.


edit: This is the correct placement of the chip in the ZIF socket:

I have placed it backwards at first, and the chip and the programmer ran very hot !

#84 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by Wootever 06.11.2017 20:43

Zitat von mooms im Beitrag #83
I've used the the black PCB version (with Flashrom, because with the Chinese flash program I had errors with 1.18, 1.29 and 1.30) on a Winbond 25Q128FV1Q with success, although the flash was somewhat slow, it worked great.

I had similar problems with the CH341A Programmer software, there are also various versions available with some of them cracked or bypassed and without any official download source.
When looking for alternatives i stumbled across flashrom, which worked remarkably well. (I initially used a Ubuntu VM for flashrom, but that wasn't very practical or portable.)

The slower speed might be a limitation of the WinUSB driver or even the CH341A itself.

Zitat von mooms im Beitrag #83
Since you said this programmer can fry some chips, I had ordered the green one you've linked.

The output pins of the CH341A (CS, DO, CLK, DI) are supplied with 5V on the black pcb version.
It seems most of the desktop mainboard 3.3V flashchips will tolerate the overvoltage, but it might be dangerous to other components if used with a soic clip on notebooks for example.

Zitat von mooms im Beitrag #83
edit: This is the correct placement of the chip in the ZIF socket:

Indeed, some of the earlier CH341A Programmer versions had a wrong pinout picture.

#85 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by mooms 06.11.2017 23:08

Actually, this image was taken from the V1.18, it's the newer version (1.30) that have a wrong image.
You can also see on the PCB it had the correct pinout engraved.

About the speed, the only version of the Chinese program that somewhat worked (v1.18) was even slower than flashrom, and it crashed a lot.

#86 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by Wootever 07.11.2017 00:45

You are right, it seems the pinout has changed on the newer software versions, most likely to match the associated SkyGz CH341A programmer:



The generic CH341A programmers use the default pinout:

#87 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by Wootever 10.11.2017 19:40

Small update:
I added a simple timer to compare the flashing process time between different chips or programmers.

Fortunately, the programming speed for the CH341A is identical on Windows and Linux.
Windows log:

flashrom -r backup.bin
Calibrating delay loop... OK.
Found Winbond flash chip "W25Q64.W" (8192 kB, SPI) on ch341a_spi.
Reading flash... done (in 1 minute and 4 seconds).

flashrom -E
Calibrating delay loop... OK.
Found Winbond flash chip "W25Q64.W" (8192 kB, SPI) on ch341a_spi.
Erasing and writing flash chip... Erase/write done (in 3 minutes and 13 seconds).

flashrom -w bios.bin
Calibrating delay loop... OK.
Found Winbond flash chip "W25Q64.W" (8192 kB, SPI) on ch341a_spi.
Reading old flash chip contents... done (in 1 minute and 4 seconds).
Erasing and writing flash chip... Erase/write done (in 56 seconds).
Verifying flash... VERIFIED (in 1 minute and 5 seconds).
Process completed in 3 minutes and 5 seconds.


Linux log:
sudo flashrom -p ch341a_spi -r backup.bin
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Winbond flash chip "W25Q64.W" (8192 kB, SPI) on ch341a_spi.
Reading flash... done (in 1 minute and 4 seconds).

sudo flashrom -p ch341a_spi -E
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Winbond flash chip "W25Q64.W" (8192 kB, SPI) on ch341a_spi.
Erasing and writing flash chip... Erase/write done (in 3 minutes and 16 seconds).

sudo flashrom -p ch341a_spi -w bios.bin
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Winbond flash chip "W25Q64.W" (8192 kB, SPI) on ch341a_spi.
Reading old flash chip contents... done (in 1 minute and 5 seconds).
Erasing and writing flash chip... Erase/write done (in 58 seconds).
Verifying flash... VERIFIED (in 1 minute and 5 seconds).
Process completed in 3 minutes and 8 seconds.


I also added a function to disable quick edit on cmd.exe when flashrom is active to prevent accidentally application freeze which might corrupt the flashing process.

#88 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by mooms 11.11.2017 15:42

Researchers find almost EVERY computer with an Intel Skylake and above CPU can be owned via USB

I'm really happy to have disabled the ME.

#89 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by davidm71 11.11.2017 18:48

avatar

Hi,

I have the Black Gold version of the CH341A.

I read that it does not operate at 3.3v and could fry bios chips?

I have a faulty bios chip on the Foxconn NT-525 netbox. Its a 8 pin soldered chip that I was told operates at 3.3v.

What is the easiest way to reflash it? Use a SOIC clip? Or should I just heat the leads up and remove it?

Heres a picture of the bios chip:

Never done this before but it seems like a fun weekend project if anyone can help.

Please comment also on chip orientation.

Thanks.

#90 RE: [Guide] Using CH341A-based programmer to flash SPI EEPROM by Wimpy 11.11.2017 19:54

avatar

The white mask on the ch431a adapter shows the orientation and pinning correctly.
The engraved dot on the chip is pin number 1.

See the link in the post #82 to fix the 3.3v for black ch431a.

You can try to flash with a clip adapter first, if this does not work you might need to resolder the chip.

Xobor Forum Software von Xobor
Datenschutz