Vous êtes sur la page 1sur 9

15/11/2018 Bus Pirate JTAG XSVF player - DP

Skip to Navigation

Blog
Projects
Forum
About
Contact
Shop
Free PCBs

Facebook Twitter RSS Comments

Bus Pirate JTAG XSVF player


From DP

http://dangerousprototypes.com/docs/Bus_Pirate_JTAG_XSVF_player 1/9
15/11/2018 Bus Pirate JTAG XSVF player - DP

Contents
1 Overview
1.1 SVF
1.2 XSVF
2 Downloads
3 Replace firmware
4 Connections
5 Application
6 XSVF firmware protocol
6.1 Reset
6.2 Chain scan
6.3 XSVF player

Overview
XSVF is a set of instructions that tell a programmer how to wiggle pins in such a manner as to enter the firmware into a JTAG devices such as FPGAs and CPLDs.

The XSVF player is a bonus firmware for the Bus Pirate that 'plays' XSVF files to program JTAG devices. We also whipped up a PC utility that sends XSVF files
to the Bus Pirate.

Load the alternate firmware using your normal firmware update procedure.

SVF

SVF (no X) is a common programming format used in manufacturing. It's a human-readable list of JTAG instructions that program a chip. The programmer doesn't
actually know anything about the target device, the SVF file just tells it what JTAG instructions to execute and the reply to expect.

SVF is used with many devices, but is most commonly used with FPGAs, CPLDs, and other programmable logic. The compilers for many different chips can
output a SVF file.

XSVF

http://dangerousprototypes.com/docs/Bus_Pirate_JTAG_XSVF_player 2/9
15/11/2018 Bus Pirate JTAG XSVF player - DP

XSVF is a compressed version of SVF that works better with small devices (like the Bus Pirate). An SVF to XSVF converter is included in the XSVF player
download.

Downloads
You'll need:

The latest BPv3.XSVFplayer.vX.X (http://code.google.com/p/the-bus-pirate/downloads/list) firmware and application

Other resources:

Application source in SVN (http://code.google.com/p/the-bus-pirate/source/browse/#svn%2Ftrunk%2Fscripts%2FBPXSVFPlayer)


Xilinx XAPP058 app note (http://www.xilinx.com/support/documentation/application_notes/xapp058.pdf) and code archive
(http://www.xilinx.com/support/documentation/application_notes/xapp058.zip)
Forum (http://dangerousprototypes.com/forum/viewtopic.php?f=51&t=1867&p=18116#p18116)
JTAG SVF to XSVF file converter

Replace firmware
The XSVF player firmware is big and doesn't fit in the normal Bus Pirate release. Instead, we made a separate firmware that works with the small application
included in the download. It doesn't have a user terminal, it only contains the XSVF player.

Use your favorite USB firmware update method to load the BPv3.XSVFplayer.vx.hex firmware file into your Bus Pirate with the bootloader.

When you're done using the Bus Pirate as an XSVF player, just load the latest BusPirate.firmware.vx.x firmware (http://code.google.com/p/the-bus-
pirate/downloads/list) to get the normal Bus Pirate stuff back.

Connections
Bus: JTAG (http://en.wikipedia.org/wiki/Joint_Test_Action_Group) (Joint Test Action Group)
Connections: 4 connections (TDI, TCK, TDO, TMS) and ground
Output type: 3.3volt normal pin output
Maximum voltage: 5.5volts (5volt safe)
Power supplies: active at all times in this firmware

Bus Pirate Dir. JTAG Description


MOSI TDI Master Out, Slave In
http://dangerousprototypes.com/docs/Bus_Pirate_JTAG_XSVF_player 3/9
15/11/2018 Bus Pirate JTAG XSVF player - DP


MISO ← TDO Master In, Slave Out

CS → TMS Chip Select

CLK → TCK Clock signal

GND ⏚ GND Signal Ground

Connect the Bus Pirate to the JTAG device as shown in the table. Don't forget to either power Vio or to set the Vio jumper on the board.

The Bus Pirate's power supplies are active, you can use them to power the JTAG device (150mA max).

There are two ways to power the CPLD development boards from the Bus Pirate:

1. The easiest is to connect the Bus Pirate 3.3volt power supply pin to the to the 3.3volt pin of the JTAG header on the CPLD board (but this might be
dangerous to the voltage regulator on the CPLD board)
2. Alternately, connect the Bus Pirate 5volt power supply pin to the V+ pin of the breakout header on the side of the CPLD board

The XSVF player supports the minimum 4-wire JTAG connection. It does not support any of the reset signals used in many ARM processors. It is based on source
code provided by FPGA manufacturer Xilinx and is intended primarily for use with FPGAs and CPLD.

Application

http://dangerousprototypes.com/docs/Bus_Pirate_JTAG_XSVF_player 4/9
15/11/2018 Bus Pirate JTAG XSVF player - DP

E:\>BPXSVFPLAYER -p com5 -f c:\svf\xc2cprog.xsvf


File is 22846 bytes, read 22846 bytes
Opening Bus Pirate on com5 at 115200bps
Using XSVF file c:\svf\xc2cprog.xsvf
Entering XSVF Player Mode
Waiting for first data request...ok
Sending 4096 Bytes (1000)...ok
Sending 4096 Bytes (2000)...ok
Sending 4096 Bytes (3000)...ok
Sending 4096 Bytes (4000)...ok
Sending 4096 Bytes (5000)...ok
Sending 2366 Bytes (593E)...ok
End of operation reply 00
Success!
Thank you for Playing! :-)
E:\>

Example XSVF programming session.

The programming app sends the XSVF file to the Bus Pirate in chunks, then waits for the programmer to ask for more data. At the end, the programmer replies
with a success or error code.

BPXSVFPLAYER -p com5 -f c:\svf\xc2cprog.xsvf

Run the application with the Bus Pirate serial port (-p COM5) and XSVF file (-f) specified.

The application can also perform JTAG chain operations. A chain scan lists the IDs of all the devices in the chain. A reset is internal and applies only to the JTAG
state machine.

Usage:

-p the Bus Pirate serial port


-f location of the XSVF file to program
-x (optional) Perform a JTAG Chain Scan
-r (Optional) Perform a JTAG Reset

XSVF firmware protocol


http://dangerousprototypes.com/docs/Bus_Pirate_JTAG_XSVF_player 5/9
15/11/2018 Bus Pirate JTAG XSVF player - DP

0x01 - JTAG RESET


0x02 - JTAG chain scan
0x03 - XSVF player

Reset

Resets the connected JTAG devices.

1. Send 0x01
2. Wait a little

Chain scan

Chain scan is a JTAG device detection method.

1. Send 0x02 to perform a chain scan


2. Wait for 1 byte, the number of bytes that will be returned
3. Get that many bytes

Currently the firmware is hard-coded to use 4 byte JTAG IDs, so the IDs will be at 4 byte boundaries.

XSVF player

This mode plays XSVF formatted JTAG programming files, usually for programming FPGAs and CPLDs.

1. Open the port and send 0x03 to enter XSVF player mode
2. Wait for 0xFF, if <0xFF then it is finished or error codes (see below)
3. Send 1 byte: the byte count of XSVF data you will send next (up to 255 bytes)
4. Send up to 255 bytes of XSVF data
5. Repeat from 2 until the return value is less than 0xff

XSVF packet format


byte count XSVF byte 1 XSVF byte 2
0x02 data1 data2

Result codes

0x00 XSVF_ERROR_NONE
http://dangerousprototypes.com/docs/Bus_Pirate_JTAG_XSVF_player 6/9
15/11/2018 Bus Pirate JTAG XSVF player - DP

0x01 XSVF_ERROR_UNKNOWN
0x02 XSVF_ERROR_TDOMISMATCH
0x03 XSVF_ERROR_MAXRETRIES
0x04 XSVF_ERROR_ILLEGALCMD
0x05 XSVF_ERROR_ILLEGALSTATE
0x06 XSVF_ERROR_DATAOVERFLOW
0x07 XSVF_ERROR_LAST
0xFF XSVF_READY_FOR_DATA

Retrieved from "http://dangerousprototypes.com/docs/Bus_Pirate_JTAG_XSVF_player"


Categories: Projects | Bus Pirate | CPLD development boards | Xilinx

jump to

Projects homepage
Bus Pirate
USB Infrared toy
Web platform
Bus Blaster
Logic Sniffer
CPLD dev boards
Logic Shrimp
Breakout boards
Proto boards
#twatch network LCD
Flash Destroyer
In development
Partlist and reference
Recent changes

projects

http://dangerousprototypes.com/docs/Bus_Pirate_JTAG_XSVF_player 7/9
15/11/2018 Bus Pirate JTAG XSVF player - DP

buy stuff

Bus Pirate v3
USB Infrared Toy
web platform
Bus Blaster v2
Logic Sniffer

Search

Go Search

Toolbox

What links here


Related changes
Special pages
Printable version
Permanent link

Views

Page
Discussion
View source
History

Personal tools

Log in

Site

This page was last modified on 20 February 2012, at 13:01.

http://dangerousprototypes.com/docs/Bus_Pirate_JTAG_XSVF_player 8/9
15/11/2018 Bus Pirate JTAG XSVF player - DP

Copyright 2011 Where Labs, LLC.


CC BY-SA unless otherwise noted.

Connect
Follow us on Twitter
Subscribe to our feed
Subscribe to our comments
Visit our Facebook page
Send us an email

Projects

Get a Bus Blaster v2


Get a Bus Pirate v3
Get a Flash Destroyer kit
Get a Logic Sniffer
Get a USB Infrared Toy

About Us
Our goal is to release a new open source hardware project every month. Copies of our projects are available through Seeed Studio and our distributors.

http://dangerousprototypes.com/docs/Bus_Pirate_JTAG_XSVF_player 9/9

Vous aimerez peut-être aussi