[flashrom] External programmer update
fritz
fritzlists at gmail.com
Fri May 28 18:48:55 CEST 2010
An update on my microcontroller-based external serial programmer:
It works.
I can program 5V-only chips, in DIP32 form, or PLCC32 with an adapter.
The highest baud rate I've been able to make work is 115200, which makes
things pretty slow. Further experimentation may show that I could run a
higher baudrate and maybe remove most of the `noop` delays in my I/O
routines - but that's for another day.
Of some old chips I had extracted from old motherboards, I was able to
detect and dump a Winbond W29EE011, and a SST29EE010.
However, the chip I wanted to program - Am29F040B - I could NOT detect.
I'll spare you the in-depth story of the past twelve hours I've spent
working on it.
The summary:
Flashrom (from svn) would detect the other chips using addresses 0x5555,
0x2AAA, 0x5555
Flashrom (from svn) would try to detect the Am29F040 using addresses
0x0555, 0x02AA, 0x0555 - which is not according to the datasheet.
Mine is not the only chip flashrom does that with:
http://pastebin.org/288436
My schematic, board layout, and firmware can be found at
http://www.coldelectrons.com/blog/?page_id=165
I've figured one very small change that makes flashrom properly work to
detect my chip:
diff --git a/flashchips.c b/flashchips.c
index b1af60a..4feabe8 100644
--- a/flashchips.c
+++ b/flashchips.c
@@ -178,7 +178,7 @@ struct flashchip flashchips[] = {
.model_id = AM_29F040B,
.total_size = 512,
.page_size = 64 * 1024,
- .feature_bits = FEATURE_ADDR_2AA | FEATURE_SHORT_RESET,
+ .feature_bits = FEATURE_SHORT_RESET,
.tested = TEST_UNTESTED,
.probe = probe_jedec,
.probe_timing = TIMING_IGNORED, /* routine don't use
probe_timing (am29f040b.c) */
For some reason, having FEATURE_ADDR_2AA set makes jedec.c screw up the
address.
With that changed:
$ sudo ./flashrom -p serprog:/dev/ttyUSB0:115200 -VV
flashrom v0.9.2-r1015 on Linux 2.6.32-trunk-amd64 (x86_64), built with
libpci 3.1.7, GCC 4.4.3 20100108 (prerelease), little endian
flashrom is free software, get the source code at http://www.flashrom.org
Calibrating delay loop... 936M loops per second, 10 myus = 10 us, 100
myus = 100 us, 1000 myus = 1001 us, 10000 myus = 10056 us, OK.
Initializing serprog programmer
serprog_init
serprog:connected - attempting to synchronize
.
serprog:Synchronized
serprog:Interface version ok.
serprog:Programmer name "MEGASHIELDSERPRG"
serprog:serial buffer size 128
serprog:operation buffer size 4096
serprog:Maximum write-n length 1
serprog:Maximum read-n length 16777216
Probing for AMD Am29F040B, 512 KB: Chip lacks correct probe timing
information, using default 10mS/40uS. serprog_chip_writeb
serprog:Passing write-n bytes=1 addr=0x5555
serprog_delay
serprog_chip_writeb
serprog:Passing write-n bytes=1 addr=0x2aaa
serprog_delay
serprog_chip_writeb
serprog:Passing write-n bytes=1 addr=0x5555
serprog_delay
serprog:Executed operation buffer of 30 bytes
serprog_chip_readb addr=0x0 returning 0x01
serprog_chip_readb addr=0x1 returning 0xA4
serprog_chip_writeb
serprog:Passing write-n bytes=1 addr=0x5555
serprog_delay
probe_jedec_common: id1 0x01, id2 0xa4serprog:Executed operation buffer
of 10 bytes
serprog_chip_readb addr=0x0 returning 0xFF
serprog_chip_readb addr=0x1 returning 0xFF
Found chip "AMD Am29F040B" (512 KB, Parallel) at physical address
0xfff80000.
===
This flash part has status UNTESTED for operations: PROBE READ ERASE WRITE
The test status of this chip may have been updated in the latest development
version of flashrom. If you are running the latest development version,
please email a report to flashrom at flashrom.org if any of the above
operations
work correctly for you with this flash part. Please include the flashrom
output with the additional -V option for all operations you tested (-V, -Vr,
-Vw, -VE), and mention which mainboard or programmer you tested.
Thanks for your help!
===
No operations were specified.
serprog_shutdown
I now have my chip programmed, and I didn't have to write an application
from scratch to do it. If it had gone smoother, I'd profess thanks, but
in my sleep-deprived state I think all you are going get out of me is a
grunt and a respectful nod :)
More information about the flashrom
mailing list