Please login or register.

Login with username, password and session length
 

News:

Latest updates at DangerousPrototypes.com.


Author Topic: Cross Platform ROM Programmer GUI with the Bus Pirate  (Read 1889 times)

audiohacked

  • Newbie
  • *
  • Posts: 45
  • Karma: +1/-0
    • View Profile
    • Sean Nelson blog
Cross Platform ROM Programmer GUI with the Bus Pirate
« on: October 21, 2009, 03:57:32 PM »
After seeing James' Windows EEPROM programmer in C, I took it upon myself to write a GUI programmer (for fun). My Question for everyone is what would you all like to see as part of the GUI. So far I have the framework setup and started writing the SPI and I2C GUI parts, but I'd like to know what everyone else thinks?

It should work on Windows, Linux, and Mac.
pyBusPirate: http://www.github.com/audiohacked/pybuspirate
P.S. I'm a really bored Dude! Give me an idea or project and I'll run with it!

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2861
  • Karma: +61/-0
    • View Profile
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #1 on: October 22, 2009, 01:07:11 AM »
Sounds cool. I'd like to be able to read from, and dump to binary files in addition to ASCII hex. The ASCII hex is a really great idea because you can see the values and change them with a note pad, but I usually deal with raw binary files and edit them with HxD.

Maybe a 1-wire programmer? It seems to be a popular protocol.

A simple power button to enable the regulators would be great. I get requests for a power option in HiZ mode all the time - some times you just need a quick little power supply. I think this would make your ap an instant hit :)

Out of curiosity, what tool-chain do you use for that type of cross-platform development?

PS: I'll probably never add power to HiZ because HiZ is supposed to be a safe mode where you're sure the Bus Pirate won't fry anything.

audiohacked

  • Newbie
  • *
  • Posts: 45
  • Karma: +1/-0
    • View Profile
    • Sean Nelson blog
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #2 on: October 22, 2009, 09:14:10 AM »
The Tool-chain I use is C++ Qt4.5. I'm kinda rusty so I'm having to retrain myself on how to use it. I have a few googlecode projects, but one of them uses it heavily to create a Valve Steam-like service/app.
pyBusPirate: http://www.github.com/audiohacked/pybuspirate
P.S. I'm a really bored Dude! Give me an idea or project and I'll run with it!

audiohacked

  • Newbie
  • *
  • Posts: 45
  • Karma: +1/-0
    • View Profile
    • Sean Nelson blog
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #3 on: October 23, 2009, 03:08:17 PM »
Today, I've ran into a wall. The Qt Library I'm using for the Serial Port is having problems connecting to the Bus Pirate on my Macbook. So far that's the only problem and I've haven't tested the app on Windows or Linux yet.

To test if my programming is correct, is to see if i can read the chip id off of my SPI Flash chip connected to the BP.
pyBusPirate: http://www.github.com/audiohacked/pybuspirate
P.S. I'm a really bored Dude! Give me an idea or project and I'll run with it!

audiohacked

  • Newbie
  • *
  • Posts: 45
  • Karma: +1/-0
    • View Profile
    • Sean Nelson blog
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #4 on: October 23, 2009, 04:18:00 PM »
Ok, I've fixed the QextSerialPort problem; found out how to get the latest source code.
pyBusPirate: http://www.github.com/audiohacked/pybuspirate
P.S. I'm a really bored Dude! Give me an idea or project and I'll run with it!

audiohacked

  • Newbie
  • *
  • Posts: 45
  • Karma: +1/-0
    • View Profile
    • Sean Nelson blog
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #5 on: October 23, 2009, 07:35:34 PM »
Screenshots of current progress, as follows:





pyBusPirate: http://www.github.com/audiohacked/pybuspirate
P.S. I'm a really bored Dude! Give me an idea or project and I'll run with it!

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2861
  • Karma: +61/-0
    • View Profile
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #6 on: October 24, 2009, 12:57:22 AM »
WoW, that looks really slick. What is the last screen for power? I don't understand the different settings.

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2861
  • Karma: +61/-0
    • View Profile
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #7 on: October 24, 2009, 01:01:40 AM »
Never mind, I get it. It's the power + pin mode for programming, right?

Are you doing the I2C scan in software? I can help with sample code, or we could add a command for it.

Here's the code in the Bus Pirate, there's a few quirks to get it right:
http://code.google.com/p/the-bus-pirate/source/browse/trunk/source/I2C.c#171

The important thing is read an extra byte and then NACK the read addresses (last bit 1) or the device won't let go of the I2C bus.

audiohacked

  • Newbie
  • *
  • Posts: 45
  • Karma: +1/-0
    • View Profile
    • Sean Nelson blog
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #8 on: October 24, 2009, 08:38:15 AM »
I haven't started on the I2C code except for the GUI. I think scan should be done in software, since I can't think of a good way for you to easily implement it in firmware.

P.S. I've been reading the firmware code while writing all my software.
pyBusPirate: http://www.github.com/audiohacked/pybuspirate
P.S. I'm a really bored Dude! Give me an idea or project and I'll run with it!

audiohacked

  • Newbie
  • *
  • Posts: 45
  • Karma: +1/-0
    • View Profile
    • Sean Nelson blog
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #9 on: October 24, 2009, 09:22:18 PM »
I've done some updates to the Interface; some of the features are programmed and are usable, but I honestly feel this is the worst programming I've done. The only reason it might look good to everyone else is because I'm a huge Perfectionist. I've been running into many problems with it, and my SPI test code is only returning nonsense when It should be printing the chip id "0x61 0x42 0x00". The good news is the ASCII GUI Tab actually works except for printing to the log window.

Anyways, I felt it would be better to post a blog entry for the screen shots, instead of posting 5 new shots everytime I decide to drastically change the GUI.

http://seancrazy.net/blog/?p=3
pyBusPirate: http://www.github.com/audiohacked/pybuspirate
P.S. I'm a really bored Dude! Give me an idea or project and I'll run with it!

dvbguy

  • Newbie
  • *
  • Posts: 7
  • Karma: +1/-0
    • View Profile
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #10 on: October 24, 2009, 09:55:28 PM »
looks pretty good.. if you want some base code for programming SPI based chips, there is a project called spipgm2 that is used to reprogram the bios chips on many motherboards.. it contains the parameters for a wide selection of chips.. Do a quick google search.. Its easy to find.. here is a link to the lates source that I know about

http://richard-burke.dyndns.org/wordpress/wp-content/uploads/2009/02/SPIPGM.C




dvbguy

  • Newbie
  • *
  • Posts: 7
  • Karma: +1/-0
    • View Profile
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #11 on: October 24, 2009, 09:58:51 PM »
looks pretty good.. if you want some base code for programming SPI based chips, there is a project called spipgm2 that is used to reprogram the bios chips on many motherboards.. it contains the parameters for a wide selection of chips.. Do a quick google search.. Its easy to find.. here is a link to the lates source that I know about

http://richard-burke.dyndns.org/wordpress/wp-content/uploads/2009/02/SPIPGM.C

ht send to fast.. see his link also for info additional info.. it also mentions a common difficult chip to program..

http://richard-burke.dyndns.org/wordpress/tag/spipgm/

audiohacked

  • Newbie
  • *
  • Posts: 45
  • Karma: +1/-0
    • View Profile
    • Sean Nelson blog
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #12 on: October 24, 2009, 10:49:21 PM »
It's not the SPI programming thats hard, I've done plenty of hardware and software for SPI. It's getting C++ Qt and Serial Ports to play nice. My SPI Flash part is a Numonyx M45PE20 from a Nintendo DS Lite, which works with my python library and script.
pyBusPirate: http://www.github.com/audiohacked/pybuspirate
P.S. I'm a really bored Dude! Give me an idea or project and I'll run with it!

ian

  • Crew
  • Hero Member
  • *****
  • Posts: 2861
  • Karma: +61/-0
    • View Profile
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #13 on: October 25, 2009, 11:18:30 AM »
You seem to have a better grasp on all aspects of programming than I do, but I've had issues with buffer size (set it to 1 byte in and out) and unexpected system timeouts on serial port reads that are supposedly blocking calls.

audiohacked

  • Newbie
  • *
  • Posts: 45
  • Karma: +1/-0
    • View Profile
    • Sean Nelson blog
Re: Cross Platform ROM Programmer GUI with the Bus Pirate
« Reply #14 on: October 25, 2009, 03:28:09 PM »
What's funny to me is I kinda hate programming. My true passion is hardware hacking. I've always wanted to build something like the Bus Pirate, but never found the time to actually design anything; or I was just Lazy.

I have a few ideas for GUIs for the Bus Pirate, but I know I tend to switch projects midway through and forget what I was working on. But I usually do continue to support/work on everyone of my projects. On the maybe do list is: Firmware updater GUI.

Firmware Updater GUI would only take a new GUI Tab and logic for programmer. I would probably remove the other tabs for a standalone release.

~Sean
pyBusPirate: http://www.github.com/audiohacked/pybuspirate
P.S. I'm a really bored Dude! Give me an idea or project and I'll run with it!