Programming Basys2 Using OpenOCD and FTDI-Based JTAG Adapter

As a continuation of series of experiments with Basys2 board and FT232H-based JTAG adapter, I provide an easy way to generate SVF files for their further use in OpenOCD to program the board. No GUI interaction is needed, so it is saves a lot of time.

Programming the FPGA Chip

Suppose that you have generated a *.bit file for the xc3s100e chip. Converting it to SVF can be done in iMPACT's batch mode with the following script:

Actual generation of the SVF file is done in BASH with two lines:

Generated Project_FPGA.svf file can be used in OpenOCD to program the FPGA chip.

Programming the PROM

For the xcf02s flash PROM, firstly we need to generate a PROM image:

The size of the *.bit file for the xc3s100e 72.8 kB, so the smallest size which is power of two should be 128 kB. The iMPACT script for generation of SVF, capable of programming xcf02s PROM chip:

Actual generation of the SVF file is done in BASH with two lines:

Now let's program both of the chips. Start OpenOCD server:

Login as a client and run SVF files:

Looks good but dealing with two iMPACT scripts clutters the directory with unnecessary files. Let's automate the building process and the iMPACT file generation. Here is a Makefile which does all of the work:

Building SVFs is a one-line command now: