Dangerous Prototypes

Other projects => Past projects => CPLD programmable logic => Topic started by: ian on February 16, 2011, 02:20:57 pm

Title: CPLD/FPGA programmer for Bus Pirate
Post by: ian on February 16, 2011, 02:20:57 pm
The Bus Pirate currently has JTAG debugging support through OpenOCD, but that is overkill for programming CPLDs and FPGAs.

I dug up the old XSVF JTAG programming firmware based on the Xilinx XAPP058 app note and sample code (license unknown, so no distribution on the source until I clarify). I put just the XSVF and JTAG chain scan stuff into a new firmware that works with the v4 bootloader (attached). This firmware will quickly and easily program CPLDs and FPGAs (any brand that can export XSVF, or even SVF processed with the Xilinx converter) from the Bus Pirate v3.

It follows this simple protocol:
http://dangerousprototypes.com/docs/Bus ... SVF_player (http://dangerousprototypes.com/docs/Bus_Pirate_JTAG_XSVF_player)

We're working on a simple loader app now. It will take the XSVF output for CPLDs/FPGAs and hand it to the Bus Pirate.

This was spurred because urJtag doesn't want to work with teh XC9572XL breakout board, and we needed a way to test it. Not only that, but it should greatly expand the audience for the new boards.
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: rsdio on February 16, 2011, 02:34:41 pm
Nice!
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: PALMA on February 16, 2011, 04:04:15 pm
Awesome!! I can't wait to get one XC9500XL board
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: ian on February 17, 2011, 11:58:11 am
Got it working with the XC2c64a and the xc9500xl today.

Here's a screenshot, firmware, windows app, and app source (attachment on first post).
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: Rubu on February 17, 2011, 01:18:46 pm
Cool! Just out of curiousity, could this also be used to program the FPGA in the OLS, without writing the flash?
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: ian on February 17, 2011, 01:42:12 pm
The OLS is hard-wired for flash loading, and the JTAG is 2.5 volts (Bus Pirate is 3.3volts).
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: robots on February 17, 2011, 02:03:42 pm
does it really need different fw ?:) couldn't it use OOCD1 binary protocol ?
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: ian on February 17, 2011, 02:25:34 pm
Then the SVF player app would have to be smart. This uses a ready-made app-note on-PIC firmware to decode the SVF file. It was just a little bit of work. The application feeds the XSVF file in 4096 byte chunks, it doesn't know or care what the data is. It was only a marginal amount of work :)
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: Philip on February 22, 2011, 01:12:26 am
It would be cool if we could read the contents of the CPLD/FPGA hihi <<-- i really need this option hehehe
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: robots on February 22, 2011, 06:13:10 pm
of course you can, but not with
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: Philip on February 22, 2011, 08:07:13 pm
can i use the xilinx ise with the buspirate?
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: ian on February 22, 2011, 08:35:44 pm
No, just the parallel cables, USB pods, and some JTAG debuggers under LInux with a special alternative Xilinx driver.
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: Philip on February 25, 2011, 03:01:56 pm
Hi

can this parallel adapter be used with xilinx ISE to read from an FPGA?

http://www.sparkfun.com/products/8460 (http://www.sparkfun.com/products/8460)

[i found an old computer with a parallel port hihi]
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: ian on February 25, 2011, 03:08:00 pm
I think that will probably work.
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: Philip on February 25, 2011, 03:27:05 pm
ganna try to build one hehehehe
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: Philip on February 25, 2011, 03:27:25 pm
Thanks every one!
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: robots on February 25, 2011, 05:01:38 pm
You just have to understand that it is not like "normal" cpu programming. There is almost no way to get from "binary" file back to the logic it represents. Also, read lock can be set. So you are probably not going to get the data from the chip.
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: Philip on February 25, 2011, 05:22:59 pm
Actually the logic does not matter..my goal is to copy code from an existing FPGA and write it to a fresh FPGA to reproduce the old part
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: robots on February 25, 2011, 07:06:01 pm
most fpga's have external flash rom for storing the configuration. Only few have non-volatile memory inside them. You should probably look into that first.
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: jeanmarc78 on March 25, 2012, 04:31:21 pm
Hello Ian,

I have seen in a previous message of this thread that the source code of xsvf player cannot be provided.
Then could it be possible to get a version for Bus Pirate v4 ?
Or may be you can send me the source in order i adapt it to BPv4.

I have a BPv4 and  would like to load an xsvf file in the XC9572XL dev board.

Regards
  JM
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: ian on March 26, 2012, 06:00:52 pm
Hi JM,

Source for the XSVF player is in our Dangerous Protrotypes SVN, and can be downloaded from our google code page as a .zip with all the other Bus Pirate stuff I think. If you have problems finding it please let me knwo, I'm not in the office but I can attached a link when I am back.
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: maiorfi on July 05, 2012, 07:05:34 am
Hi.

Do you know whether is possible to reset CPLD via JTAG after programming, of course without power-cycling it?

Thanks!
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: ian on July 10, 2012, 12:20:22 pm
It depends on the exact chip I guess. I know most CPLDs I have used (XILINX) are reset after programming without a power cycle.
Title: Re: CPLD/FPGA programmer for Bus Pirate
Post by: semofa on August 05, 2013, 06:31:18 am
hi everybody
what different between this device and Xilinx Platform Cable USB?can i expect this device do Xilinx platform cable work?
and if i want build one can i replace an avr usb to serial convertor(that i build later) with the ft232rl?

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01872129272session_write_close ( )...(null):0
20.01902260864ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01902261640Database_MySQL->query( ).../DatabaseHandler.php:119
40.06322400376Database_MySQL->error( ).../Db-mysql.class.php:273