Discussion:
[flashrom] Fail to flash W25X40
Yang Hu
2018-05-30 16:03:41 UTC
Permalink
Hi,

I'm trying to rewrite a W24X40AL flash on a Seagate hard drive motherboard.
I can successfully read the data, although some weird things happened.
(First dumped code is nonsense, second time works fine, third or the rest
are just partial corrupted code).

Then I want to flash the code back but get the following error,

***@ubuntu:~/Desktop$ sudo flashrom -p
buspirate_spi:dev=/dev/ttyUSB0,spispeed=2M -E
flashrom on Linux 4.4.0-59-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Winbond flash chip "W25X40" (512 kB, SPI) on buspirate_spi.
Erasing and writing flash chip... FAILED at 0x00001000! Expected=0xff,
Found=0x7f, failed byte count from 0x00001000-0x00001fff: 0x1
ERASE FAILED!
Looking for another erase function.
FAILED at 0x00001800! Expected=0xff, Found=0x00, failed byte count from
0x00000000-0x0000ffff: 0x42b
ERASE FAILED!
Looking for another erase function.
FAILED at 0x00002000! Expected=0xff, Found=0x00, failed byte count from
0x00000000-0x0007ffff: 0x6596
ERASE FAILED!
Looking for another erase function.
Looking for another erase function.
Looking for another erase function.
No usable erase functions left.
FAILED!
Your flash chip is in an unknown state.
Please report this on IRC at chat.freenode.net (channel #flashrom) or
mail ***@flashrom.org, thanks!

My connection right now is: the motherboard is not powered, using bus
pirate 3.3v directly connects to VCC, /WP and /HOLD. I've tried to add 10k,
20k resistor between 3.3v and /WP, /HOLD pin but the chip won't be
recognized then.

I don't have much experience in electronics. Is this do with write
protection? Is there anything I can do with this?

Thanks for your help.

Yang Hu
David Hendricks
2018-05-31 20:20:50 UTC
Permalink
Post by Yang Hu
Hi,
I'm trying to rewrite a W24X40AL flash on a Seagate hard drive motherboard.
I can successfully read the data, although some weird things happened.
(First dumped code is nonsense, second time works fine, third or the rest
are just partial corrupted code).
Then I want to flash the code back but get the following error,
buspirate_spi:dev=/dev/ttyUSB0,spispeed=2M -E
flashrom on Linux 4.4.0-59-generic (x86_64)
flashrom is free software, get the source code at https://flashrom.org
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Winbond flash chip "W25X40" (512 kB, SPI) on buspirate_spi.
Erasing and writing flash chip... FAILED at 0x00001000! Expected=0xff,
Found=0x7f, failed byte count from 0x00001000-0x00001fff: 0x1
ERASE FAILED!
Looking for another erase function.
FAILED at 0x00001800! Expected=0xff, Found=0x00, failed byte count from
0x00000000-0x0000ffff: 0x42b
ERASE FAILED!
Looking for another erase function.
FAILED at 0x00002000! Expected=0xff, Found=0x00, failed byte count from
0x00000000-0x0007ffff: 0x6596
ERASE FAILED!
Looking for another erase function.
Looking for another erase function.
Looking for another erase function.
No usable erase functions left.
FAILED!
Your flash chip is in an unknown state.
Please report this on IRC at chat.freenode.net (channel #flashrom) or
My connection right now is: the motherboard is not powered, using bus pirate
3.3v directly connects to VCC, /WP and /HOLD. I've tried to add 10k, 20k
resistor between 3.3v and /WP, /HOLD pin but the chip won't be recognized
then.
I don't have much experience in electronics. Is this do with write
protection? Is there anything I can do with this?
Hi Yang,
It sounds like your Bus Pirate is backpowering other electronics on
the board (e.g. an embedded controller), which in turn try to access
the SPI flash and interfere. This happens when the vendor does not
isolate the SPI flash circuitry.

Determine what other electronics might be powered by the Bus Pirate
and see if you can hold them in reset so that they don't try to access
the SPI flash.

Loading...