-
Notifications
You must be signed in to change notification settings - Fork 57
/
README
146 lines (94 loc) · 4.46 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
Spartan3, XCF and CPLD JTAG programmer and other utilities
Copyright (C) 2004 Andrew Rogers
(C) 2005-2011 Uwe Bonnes bon@elektron.ikp.physik.tu-darmstadt.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Please also read the file "COPYING" which is a copy of the GNU General
Public License
Thanks to
- nahitafu@nifty.com (naxjp, XC95X algorithm example),
- zoltan_csizmadia at yahoo dot (xilprg)
- Benedikt Heinz <Zn000h@googlemail.com> for the XC3SAN ISF
- and many others
This program should run without installation. For accessing USB cables, libusb0
is required as runtime dynamic linked libray.
To compile, you need CMAKE, the static libftdi library and usb.h.
$ mkdir build; cd build; cmake ..; make
To crosscompile for Win32 with mingw:
$ mkdir build-win32; cd build-win32;
$ cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-mingw32.cmake ..
Get a description with
$ ./xc3sprog -h
This will also list the supported cables.
Get a chain description:
$ ./xcs3prog -j
Device descrption is searched in the file pointed to by the XCDB environment
variable, or when not found the built-in list is used
Test the chain integrity
$ ./xc3sprog -T -j
Here "-j" stops xc3sprog from entering the program/verify/read the part. If
things go wrong, an endless loop is entered to facilitate hardware degugging
with the scope.
Stop with ^C.
The Platform Flash PROM of the Xilinx Spartan3 Starter Kit can be programmed
by specifying it's location in the JTAG chain. Example command line below.
$ ./xc3sprog -c pp -p 1 <bitfile.bit>
Program the flash of an XC3S50AN by loading the bscan_spi bitfile
first. Aassume the XC3S50AN as single part in the jtag chain
$ ./xc3sprog ../bscan_spi/xc3s50an.bit
Now program the flash
$ ./xc3sprog -I <your_bitfile.bit>
Verify the flash content against a file
$ ./xc3sprog -I -C <your_bitfile.bit>
You can readout XCF/ISF flash and CPLD
ISF flash probably mean Incircuit Serial Flash, as internal to XC3SAN or
external connected to XC3SA/XC3SA or XC6S
First load an appropriate bitfile. Some bitfiles are in bscan_spi. Otherwise
use the appropriate HDL file from bscan_spi and a fitting UCF file to create
a ISE Project and run the Xilinx tools to generate the bitfile.
Load the bitfile, like
$ ./xc3sprog bscan_spi/xc6s_cs324.ucf
After loading the ISF Bitfile, you can now talk to the ISF Flash. When
writing to the ISF, at the end the FPGA tries to reconfigure from flash
and the ISF Bitfile is lost.
$ ./xc3sprog -r (-I) <file to store>
xc3sprog handles XC3, XCF0x and XC95xxxXx. XC4 should work but is untested.
There is also a utility program included that parses and prints the header
of a Xilinx .bit file.
$ ./bitparse echo_out.bit
Jedecfiles for CPLD programming can be parsed with
$ ./jedecparse <jedecfile.jed>
When using a FT2232D|L programmer, speed is noticely enhance with a USB-2.0
Hub between the adapter and the PC. Some effort has been made to concatenate
as many JTAG actions as possible.
Example fallback multi boot setup on XC6S
Load intermediate BSCAN_SPI bitfile
$ ./xc3sprog -I <package specific bscan_spi bitfile>
Eventually erase (not really needed)
$ ./xc3sprog -I -e
Prepare the Multiboot header from the Template. Adapt GENERAL2 and GENERAL4 for
your setup. Here a 32 MiBit Flash and a XC6SLX45 is used. The Bitstream length
is about 1484404 = 0x16a674 bytes, so with placing the golden image at 0x10000
the golden image ends at 0x17a674 and with placing the normal image at 0x190000,
there should be enough spacing between both. Double check that GENERAL2 and
GENERAL4 match the offsets.
Write the header
$ ./xc3sprog -I<boot_header_only_SPI_x1.hex>
Write golden image
$ ./xc3sprog -I <golden image>:w:0x10000
Write normal image
$ ./xc3sprog -I <normal image>:w:0x190000
Reboot
$ ./xc3sprog -R
All all in one
$ ./xc3sprog -R -I<boot_header_only_SPI_x1.hex> <golden image>:w:0x10000 \
<normal image>:w:0x190000