Skip to main content
Topic: Adding Bus Pirate support to flashrom? (Read 62482 times) previous topic - next topic

Re: Adding Bus Pirate support to flashrom?

Reply #60
Here's the latest nightly version (will be v5.2 tomorrow probably) if you'd like to try it:

Code: [Select]
HiZ> i
Bus Pirate v3a
Firmware v5.2RC (r419) Bootloader v4.3
DEVID:0x0447 REVID:0x3043 (B5)
http://dangerousprototypes.com
HiZ>

http://the-bus-pirate.googlecode.com/sv ... e-v5.2.hex
Got a question? Please ask in the forum for the fastest answers.

Re: Adding Bus Pirate support to flashrom?

Reply #61
I've upgraded to v 5.2, but I still can't understand why with flashrom this continues t fail.

Manual SPI mode:
Code: [Select]
m
1. HiZ
2. 1-WIRE
3. UART
4. I2C
5. SPI
6. 2WIRE
7. 3WIRE
8. KEYB
9. LCD
x. exit(without change)

(1)> 5
Set speed:
 1. 30KHz
 2. 125KHz
 3. 250KHz
 4. 1MHz

(1)> 4
Clock polarity:
 1. Idle low *default
 2. Idle high

(1)> 1
Output clock edge:
 1. Idle to active
 2. Active to idle *default

(2)> 1
Input sample phase:
 1. Middle *default
 2. End

(1)> 1
Select output type:
 1. Open drain (H=Hi-Z, L=GND)
 2. Normal (H=3.3V, L=GND)

(1)> 2
Ready.
SPI> W
POWER SUPPLIES ON
SPI> [0x9F r:4]
CS ENABLED
WRITE: 0x9F
READ: 0x1C 0x31 0x15 0x1C
CS DISABLED
SPI>

Flashrom
Code: [Select]
53	0.00065535	flashrom.exe	IRP_MJ_WRITE	VCP0	SUCCESS	Length 1: 00 	
54 0.01508169 flashrom.exe IRP_MJ_READ VCP0 SUCCESS Length 5: 42 42 49 4F 31
55 0.00098858 flashrom.exe IRP_MJ_WRITE VCP0 SUCCESS Length 1: 01
56 0.00701392 flashrom.exe IRP_MJ_READ VCP0 SUCCESS Length 4: 53 50 49 31
57 0.00089599 flashrom.exe IRP_MJ_WRITE VCP0 SUCCESS Length 1: 4B
58 0.01500788 flashrom.exe IRP_MJ_READ VCP0 SUCCESS Length 1: 01
59 0.00091818 flashrom.exe IRP_MJ_WRITE VCP0 SUCCESS Length 1: 67
60 0.01473140 flashrom.exe IRP_MJ_READ VCP0 SUCCESS Length 1: 01
61 0.00113876 flashrom.exe IRP_MJ_WRITE VCP0 SUCCESS Length 1: 8A
62 0.01400693 flashrom.exe IRP_MJ_READ VCP0 SUCCESS Length 1: 01
63 0.00094890 flashrom.exe IRP_MJ_WRITE VCP0 SUCCESS Length 1: 03
64 0.01502921 flashrom.exe IRP_MJ_READ VCP0 SUCCESS Length 1: 01
65 0.00073514 flashrom.exe IRP_MJ_WRITE VCP0 SUCCESS Length 1: 02
66 0.01102412 flashrom.exe IRP_MJ_READ VCP0 SUCCESS Length 1: 01
67 0.00050346 flashrom.exe IRP_MJ_WRITE VCP0 SUCCESS Length 5: 13 9F 00 00 00
68 0.01300597 flashrom.exe IRP_MJ_READ VCP0 SUCCESS Length 5: 01 00 18 7F FF
69 0.00095231 flashrom.exe IRP_MJ_WRITE VCP0 SUCCESS Length 1: 03
70 0.01499337 flashrom.exe IRP_MJ_READ VCP0 SUCCESS Length 1: 01
71 0.00030976 flashrom.exe IRP_MJ_WRITE VCP0 SUCCESS Length 1: 00
72 0.00495015 flashrom.exe IRP_MJ_READ VCP0 SUCCESS Length 5: 42 42 49 4F 31
73 0.00094079 flashrom.exe IRP_MJ_WRITE VCP0 SUCCESS Length 1: 0F
74 0.00000171 flashrom.exe IRP_MJ_CLEANUP VCP0 SUCCESS
75 0.13480893 flashrom.exe IRP_MJ_CLOSE VCP0 SUCCESS

Sometimes buspirate returns 01 00 18 7F FF others 01 00 1F FF FF, on manual mode it always reads it correctly

Re: Adding Bus Pirate support to flashrom?

Reply #62
Have you tweaked your settings in FTDI driver?

Re: Adding Bus Pirate support to flashrom?

Reply #63
No, its all default settings, on Windows 7

Re: Adding Bus Pirate support to flashrom?

Reply #64
I'm not sure what else to test on my side, I'm open to any suggestions though. Probably we need to work together with the flashrom devs to figure out what's going on.

Do you have any luck with the older version posted in the forum? How about compiling from source? Have you tried on a different computer?

This is a test compile of the firmware with a new SPI bulk routine. It should move data in and out faster than before in bulk chunks. I'm not sure why timing would effect you, given that the user terminal mode is much slower than the binary mode, but here is it just in case:
http://the-bus-pirate.googlecode.com/sv ... .2-alt.hex
http://the-bus-pirate.googlecode.com/sv ... .2-alt.hex
Got a question? Please ask in the forum for the fastest answers.

Re: Adding Bus Pirate support to flashrom?

Reply #65
Thanks for all your efforts. Maybe my chip is damaged!
I ordered another device, I'll test later when it arrives.

Re: Adding Bus Pirate support to flashrom?

Reply #66
Quote
Windows 7

I missed that... My hunch is it'll work on an XP PC. Either because of flashrom executable or FTDI drivers. Is it possible to test?
Got a question? Please ask in the forum for the fastest answers.

Re: Adding Bus Pirate support to flashrom?

Reply #67
I was running 3.0 on WinXP SP2 and as previously stated that worked fine.


David

Re: Adding Bus Pirate support to flashrom?

Reply #68
I'll try at someone's windows XP PC when I get a new chip.

Today I  accidentally powered it from the 5V rail, and now its is very unreliable, sometimes works on manual mode, sometimes is doesn't.

The datasheet states 2.7V - 3.6 V, so it must be toasted now.

Searching for a website to order a new EN25F16 (SOP 8), the cheapest I've found was about 7 USD + shipping, and mine came form an 11 USD (shipping included) micro video camera I was patching the firmware to remove a forced yellow overlay date.
With a flash chip costing more than 65% of a full device that happens to contain it, I prefer to buy a new one and keep the old PCB for parts!

Does any of you know of an website where to order an EN25F16 at an affordable price?

Thanks!

Re: Adding Bus Pirate support to flashrom?

Reply #69
[quote author="RJSC"]
Command Line:
Code: [Select]
C:>flashrom -p buspiratespi:dev=COM5 -c EN25F16 -V
flashrom v0.9.1-r905
SPI speed is 8MHz
Raw bitbang mode version 1
Raw SPI mode version 1
Probing for Eon EN25F16, 2048 KB: RDID[u][b] returned 0x1f 0xff 0xff[/b][/u]. probe_spi_rdid_generic: id1 0x1f, id2 0xffff
No EEPROM/flash device found.
[/quote]

There is one huge difference between what you're doing and what others are doing. You are specifying the flash chip, and everyone else (well, at least everyone who doesn't have problems) is not specifying the flash chip. This may very well be related to the problem that the first SPI response from the chip in many verbose logs is shown to be garbage, at least in the combination of some Bus Pirate versions with some flash chip families. A good explanation would be that flash chips need time to "boot" and will only respond with garbage until 1-200 ms after applying power. Given the communication speed between the host and the Bus Pirate, some chips will be fast enough to work, and others will be too slow.

Please run
Code: [Select]
flashrom -p buspiratespi:dev=COM5 -V
and post the full log either here or mail it to flashrom@flashrom.org would be appreciated).
If you have any flashrom problems, please mail flashrom@flashrom.org and include "Bus Pirate" in the subject line. As an alternative, you can send me a private message.
It is recommended to use at least flashrom 0.9.2 or later, and latest flashrom from svn if you want a 3x speedup.

Re: Adding Bus Pirate support to flashrom?

Reply #70
I have tried without specifying the chip and the result is the same, I get an "Unknown Device".
I just posted the command specifying the chip because it produces a much smaller verbose output to post here.
If I don't specify the chip, it tries every supported chip on the list, getting back the same erroneous response I get when I specify the chip each try it makes.
Now I can't test it anymore, the chip was flashed with a parallel port interface and is now soldered on the device.

Re: Adding Bus Pirate support to flashrom?

Reply #71
[quote author="RJSC"]
I have tried without specifying the chip and the result is the same, I get an "Unknown Device".
[/quote]
If you still have a full verbose log, maybe I can see a pattern in there.

[quote author="RJSC"]
I just posted the command specifying the chip because it produces a much smaller verbose output to post here.
If I don't specify the chip, it tries every supported chip on the list, getting back the same erroneous response I get when I specify the chip each try it makes.
[/quote]
OK, that should not have happened. If I had seen your post earlier, I would have asked you to try a patches which makes Bus Pirate init a lot more paranoid.

I noticed that the frequency differed between the manual run and the flashrom run. I need to check the rest of the settings as well.

[quote author="RJSC"]
Now I can't test it anymore, the chip was flashed with a parallel port interface and is now soldered on the device.
[/quote]
Congratulations on having gotten it working again.

I would be very interested in a flashrom run on that mainboard (internal programmer, verbose mode, detection only).
If you have any flashrom problems, please mail flashrom@flashrom.org and include "Bus Pirate" in the subject line. As an alternative, you can send me a private message.
It is recommended to use at least flashrom 0.9.2 or later, and latest flashrom from svn if you want a 3x speedup.