Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Support => Flashrom => Topic started by: biosflasher on June 17, 2010, 03:57:35 pm

Title: First raw mode SPI transaction broken in firmware 4.5?
Post by: biosflasher on June 17, 2010, 03:57:35 pm
Hi,

I'm currently debugging a problem with a flashrom user who has a Bus-Pirate V3 with Firmware v4.5. The problem manifests itself as an all-0x00 read from SPI for the first SPI command.
flashrom essentially does the following:
Init:
Execute SPI command:

The Bus pirate answers 0x01 for every command, so I think it claims everything is OK. Full logs available on request. IIRC this worked with older Bus Pirate hardware/firmware versions.

Ideas I have so far about why this problem exists:
Title: Re: First raw mode SPI transaction broken in firmware 4.5?
Post by: Sjaak on June 17, 2010, 05:00:44 pm
Some I2C chips first wants a stop condition before reacting proper. Could you run into the SPI equivalent?

Yes, I know SPI doesn't have a start/stop condition, but perhaps it needs a proper reset. or wait longer to do the CS?
Title: Re: First raw mode SPI transaction broken in firmware 4.5?
Post by: ian on June 17, 2010, 06:59:41 pm
Hum, I've added it to the list and I'll take a look. There weren't changes to the SPI mode in v4 at all, that I can think of. It could be starting up in the incorrect state (clock high) or something. Does it work if you send a dummy byte while CS is not active for the flash chip and avoid the broken first byte?

How many bytes are you send/reading with 0x10? The Bus Pirate should respond to the 0x10 with 0x01 and then respond to each send/read with a byte from the bus.

I'd be happy to take a look at a full log.
Title: Re: First raw mode SPI transaction broken in firmware 4.5?
Post by: ian on July 07, 2010, 04:13:07 pm
I just wanted to follow up on this. It looks like other people are noticing an issue. Can I get a capture of the port traffic to see what's going on?
Title: Re: First raw mode SPI transaction broken in firmware 4.5?
Post by: ian on July 08, 2010, 03:43:35 pm
I spent time looking this over today in the forum thread here:
http://dangerousprototypes.com/forum/in ... 99#msg6699 (http://dangerousprototypes.com/forum/index.php?topic=154.msg6699#msg6699)

I couldn't find anything, but that doesn't mean there's a bug. Flashrom reads JEDEC IDs ok for me with the latest firmware (there aren't any changes though).

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 (http://the-bus-pirate.googlecode.com/svn/trunk/firmware/v5-nightly/BPv3&v2go/BPv3-Firmware-v5.2.hex)
Title: Re: First raw mode SPI transaction broken in firmware 4.5?
Post by: biosflasher on August 02, 2010, 02:21:31 pm
I am trying to find someone who is seeing the problem and willing to provide verbose logs for a flashrom run where the -c option is _not_ specified. MrHijet did that, but it would make sense to find someone else as well.