1
Bus Pirate Support / Coldfire MCF52235 EzPort - Help Please
I'm reasonably new at this - so hoping someone can give me a nudge in a the right direction. This will probably be a slightly longer post - but i want to make sure i put in all the necessary info.
My end game is to write (and also dump) the firmware of a ColdFire MCF52235 micro controller with my BusPirate using the ColdFire's EzPort and the BusPirate in SPI mode.
I'm using profmadd's Ruby lib (viewtopic.php?f=28&t=2005) as i'm familiar with Ruby.
First step was figuring out the SPI settings for my specific setup, which i've done and tested using the BusPirate console directly.
After setting all of the SPI options, i can set CS high, power up my board with the ColdFire on it, and the ColdFire starts in SPI mode.
I can verify this by reading the status register of the chip, setting write enable and then reading back the status register again to see that its changed.
The command list for the EzPort is in section 21.4 of this PDF - http://www.dediprog.com/EZPORT_interface.pdf
Here is a sample from the BusPirate console:
SPI>{0x05 0x00]
/CS ENABLED
WRITE: 0x05 READ: 0xFF
WRITE: 0x00 READ: 0x00
/CS DISABLED
SPI>[0x06]
/CS ENABLED
WRITE: 0x06
/CS DISABLED
SPI>{0x05 0x00]
/CS ENABLED
WRITE: 0x05 READ: 0xFF
WRITE: 0x00 READ: 0x02
/CS DISABLED
I'm now trying to do the same thing with the attached Ruby code (lines 79-88 of wh3.rb - renamed as .txt to attach) - but its failing completely.
I'm using this page as a reference for the BusPirate - http://dangerousprototypes.com/docs/SPI_(binary)
Does anyone have any idea of what i might be doing wrong? wh3.rb works to the point of setting the BusPirate up in SPI mode, and enabling CS so i can power up the board and have the ColdFire in SPI mode. If i then try the BusPirate console, i can communicate with the EzPort, but the lines to do the same thing in Ruby don't work.
Any help would be greatly appreciated. Once i get this going, i'll then need to look at doing a bulk write of one of the firmware files i have here.
Thanks!
Scotty