At the moment i'm not yet at the stage of using the bulk write command (i'll get there), i'm just trying to set the write enable flag on the chip using the normal SPI write then read command of the BusPirate.
From what you've said profmaad i'm using the write code:
print "reading status register...t" buspirate.spi_write_then_read([0x05], 1, false) # should return 0xFF [255] pp buspirate.spi_write_then_read([0x00], 1, false) # should return 0x00 [0]
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.
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.
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.
I went back last night and re-read all the doco RE the bootlader upgrader - makes a lot more sense now and why trying to flash 4.4 in the archive didn't work :p Helps to read it all - that what you get for having a play on a Friday night
Now have a BP with the 5.1 Firmware and 4.3 bootloader.
So up until about an hour ago had a working BPv3 with bootloader 4.1 and firmware 4.1 I decided to upgrade to firmware 5.1 and bootloader 4.4
Firmware upgrade went fine. After a reset had the nice new terminal. (windows upgrade with ds30 gui).
I then tried to upgrade the bootloader the same way and it failed with an error - that i don't recall right now. And STUPID me unplugged the BP and plugged it back in to try again.
Now ds30 gui spits out Found Unknown device id(193) fw ver 9.9.9
If i run the pirate-loader with 'hi' on a windows command line i get -
+++++++++++++++++++++++++++++++++++++++++++
Pirate-Loader for BP with Bootloader v4+
Loader version: 1.0.2 OS: WINDOWS
+++++++++++++++++++++++++++++++++++++++++++
Opening serial device COM4...OK
Configuring serial port settings...OK
Sending Hello to the Bootloader...OK
Device ID: PIC24FJ64GA002 [d4]
Bootloader version: 1,02
Which seems totally weird (1.2!).
So i then thought to try the v2-v4 bootloader upgrade process again - on windows PIC24F won;t open a connection to the BP (COM4 9600 baud) and if i try it on linux with P24qy.py i get: Using Serial Port /dev/bus_pirate @ 9600 Reading 4 bytes from address 0x00FF0000 RX Error: 0 bytes received Error reading from device! Device with ID: 65535 not listed in the config file!
Any thoughts? Have i killed it completely? If plug in the BP with the PGC and PGD pins jumpered i get the mode light, and vice versa.