Discussion:
[OpenOCD-devel] SVF/XSVF player
Akos Vandra
2012-11-25 20:15:15 UTC
Permalink
Hi guys!

I am trying to use openocd to program a jtag chain that is composed of:

- lpc1768 (cortex-m3)
- xc9572XL cpld (xilinx 9500 series)
- XC2C256 cpld (xilinx coolrunner II)

I am using the next config file:

debug_level 3
source [find interface/vsllink.cfg]
transport select jtag
adapter_khz 100
source [find target/lpc1768.cfg]
jtag newtap cpld1 tap -expected-id 0x49604093 -irlen 8
jtag newtap cpld2 tap -expected-id 0x16d4c093 -irlen 8

I generated the svf file using xilinx impact, adding the three devices to
the chain, specifying an irlen of 4 for the cpu, and 8 for the coolrunner
II cpld.
I took the irlen of the cpu from the lpc1768 config file, and the irlen of
the coolrunner from its bsdl file.

I clicked on output->svf->generate svf file, and then went on "erasing" the
device, and stopping the generation.

What I came up with is the attached svf file. I modified the "FREQUENCY"
command to be slow enough for the lpc1768 to handle (it has 4MHz internal
oscillator, so 666Khz max, I am using 10Khz instead of the generated 1MHz)

I tried to play it with
svf <path_to_file.svf>
I also tried to play using
svf -tap cpld1.tap <path_to_file.svf>, but that gives a segfault.

My debug output is also attached, and here is what I get on the terminal:

***@fm12bq:~/projects/Xilinx/cpldtest$ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
svf /home/akos/projects/Xilinx/cpldtest/program.svf
svf processing file: "/home/akos/projects/Xilinx/cpldtest/program.svf"
TRST OFF;
ENDIR IDLE;
ENDDR IDLE;
STATE RESET;
STATE IDLE;
FREQUENCY 1E4 HZ;
10 kHz
TIR 0 ;
HIR 0 ;
TDR 0 ;
HDR 0 ;
TIR 4 TDI (0f) SMASK (0f) ;
HIR 8 TDI (ff) SMASK (ff) ;
HDR 1 TDI (00) SMASK (01) ;
TDR 1 TDI (00) SMASK (01) ;
SIR 8 TDI (fe) SMASK (ff) ;
SDR 32 TDI (00000000) SMASK (ffffffff) TDO (f9604093) MASK (0fffffff) ;
tdo check error at line 22
read = 0x0, want = 0xF2C08126, mask = 0x1FFFFFFE
fail to run command at line 22
tdo check error at line 22
read = 0x0, want = 0xF2C08126, mask = 0x1FFFFFFE

Time used: 0m0s13ms
svf file programmed failed
in procedure 'svf'
exit
Connection closed by foreign host.




Has anyone done this before? I've no idea what I am doing wrong.

Regards,
Ákos Vandra
Andrew Leech
2012-11-26 09:58:53 UTC
Permalink
Post by Akos Vandra
Hi guys!
- lpc1768 (cortex-m3)
- xc9572XL cpld (xilinx 9500 series)
- XC2C256 cpld (xilinx coolrunner II)
debug_level 3
source [find interface/vsllink.cfg]
transport select jtag
adapter_khz 100
source [find target/lpc1768.cfg]
jtag newtap cpld1 tap -expected-id 0x49604093 -irlen 8
jtag newtap cpld2 tap -expected-id 0x16d4c093 -irlen 8
I generated the svf file using xilinx impact, adding the three devices
to the chain, specifying an irlen of 4 for the cpu, and 8 for the
coolrunner II cpld.
I took the irlen of the cpu from the lpc1768 config file, and the
irlen of the coolrunner from its bsdl file.
I clicked on output->svf->generate svf file, and then went on
"erasing" the device, and stopping the generation.
What I came up with is the attached svf file. I modified the
"FREQUENCY" command to be slow enough for the lpc1768 to handle (it
has 4MHz internal oscillator, so 666Khz max, I am using 10Khz instead
of the generated 1MHz)
I tried to play it with
svf <path_to_file.svf>
I also tried to play using
svf -tap cpld1.tap <path_to_file.svf>, but that gives a segfault.
<snip>
Post by Akos Vandra
Has anyone done this before? I've no idea what I am doing wrong.
I am not sure why openocd needs the -tap parameter. Aren't the svf
files describing transfers to the chain as a whole, and not a device in
a chain? And if they are directed at a device and not the chain, why do
I have to set up the chain (from my cpld programmer) before I can
generate the SVF files?
Post by Akos Vandra
Regards,
Ákos Vandra
I'm not using the svf in production anymore, I use the onboard arm to do
the programming - I have it wired such that it can take the actel's jtag
lines away from the chain and run a programmer on it directly.
However when I used it, I'm pretty sure I generated my svf files as if
it was the only device on the chain, and then openocd just handles the
chaining. The actual svf files were generated with actel designer,
although the design is all done in Altium.
I'm not sure if it would be any help at all but I've attached one of my
archived svf files that handles the erase, which was run using the svf
player routine in my previous config file. The tap is set up to handle
any one of three alternate parts that can be loaded on the board.
<in config file>
# FPGA Tap:
jtag newtap fpga tap -irlen 8 -expected-id 0x1b9521cf -expected-id
0x129121cf -expected-id 0x1b9121cf

<snip>

# Loads a SVF file into the FPGA
#
proc a3p_svf_play {SVF_FILE} {
svf -tap fpga.tap $SVF_FILE quiet progress
}
<end config file>

and from the batch file I used to use to program using openocd:
openocd.exe -f a3p060_lpc3131_icdi.cfg -c "a3p_svf_play
../FPGA-A3P060/%FILE%" -c "exit"


If you're getting a segfault on using -tap something is seriously wrong,
openocd really shouldn't segfault on anything in normal operation, it
should throw a sanitised error if it's a config problem of any kind. I'm
not sure if enabling extra debug flags on openocd would give you more
information or not, I haven't been involved in debugging openocd on that
level before.

Best Regards,
Andrew Leech

Loading...