How to Program an FPGA.
In the previous article I described how to install Quartus, but that was only a step toward the goal. To make sure the FPGA and the programmer worked, the FPGA had to be programmed.
It turned out this can be done in two ways. The first is via the JTAG interface; in this case the configuration data is loaded directly into the FPGA. The drawback of this method is that the FPGA memory is volatile, and the firmware has to be loaded into the FPGA every time power is applied.
The way out of this situation suggests itself: place a memory chip next to the FPGA and load the firmware from it every time power is applied. The only thing worth adding is that the firmware is stored not in an ordinary flash chip but in a special chip, a serial configuration ROM. For Altera these are the EPCS or EPCQ series chips, programmed via the Active Serial interface. This is the second method: program the serial configuration ROM chip, and after power-up the FPGA reads the firmware from it.
But here another question arises: does that mean a separate connector is needed to program the serial configuration ROM?
It turns out the FPGA designers took care of this, and the FPGA can act as a bridge between the JTAG and Active Serial interfaces. That is, it receives the firmware via the JTAG interface and writes it to the ROM using Active Serial. That covers the theory, and we can move on to practice.
Loading firmware into the FPGA via the jtag interface.
At my request, the seller emailed me the schematic of the development board and several simple projects. In one of the projects I found a file with the .sof extension, which is needed for programming.
To program the FPGA via jtag, you need to:
Loading firmware into the Active Serial ROM via jtag.
In the same folder where the .sof file came from, I found a file with the .pof. extension. Files with this extension must be written by connecting directly to the ROM, but I wanted to program the board via jtag without extra hassle. For that, a file with the .jic extension had to be produced from the .sof file.
To convert a .sof file to .jic, you need to:
Now the prepared file can be fed to the FPGA, and it will update the ROM firmware.
It turned out this can be done in two ways. The first is via the JTAG interface; in this case the configuration data is loaded directly into the FPGA. The drawback of this method is that the FPGA memory is volatile, and the firmware has to be loaded into the FPGA every time power is applied.
The way out of this situation suggests itself: place a memory chip next to the FPGA and load the firmware from it every time power is applied. The only thing worth adding is that the firmware is stored not in an ordinary flash chip but in a special chip, a serial configuration ROM. For Altera these are the EPCS or EPCQ series chips, programmed via the Active Serial interface. This is the second method: program the serial configuration ROM chip, and after power-up the FPGA reads the firmware from it.
But here another question arises: does that mean a separate connector is needed to program the serial configuration ROM?
It turns out the FPGA designers took care of this, and the FPGA can act as a bridge between the JTAG and Active Serial interfaces. That is, it receives the firmware via the JTAG interface and writes it to the ROM using Active Serial. That covers the theory, and we can move on to practice.
Loading firmware into the FPGA via the jtag interface.
At my request, the seller emailed me the schematic of the development board and several simple projects. In one of the projects I found a file with the .sof extension, which is needed for programming.
To program the FPGA via jtag, you need to:
- launch Quartus
- select Programmer in the Tools tab
- specify the firmware file
- program the FPGA by clicking the Start button, having first checked the required boxes
- if programming is successful, you'll see 100% Successful in the upper right corner
Loading firmware into the Active Serial ROM via jtag.
In the same folder where the .sof file came from, I found a file with the .pof. extension. Files with this extension must be written by connecting directly to the ROM, but I wanted to program the board via jtag without extra hassle. For that, a file with the .jic extension had to be produced from the .sof file.
To convert a .sof file to .jic, you need to:
- select Convert Programming Files in the File menu
- in the menu that opens, select JTAG Indirect in the Programming file type field
Configuration File (.jic) - in the Configuration device field, select the type of ROM on the board
- in the Mode field, select the programming mode
- in the File name field, set the name and directory of the output file
- in the Inputs File to Convert field, click on SOF Data; an Add File button appears on the right, which lets you select the file to convert
- once the file is selected, click on Flash Loader; an Add Device button appears on the right; click it and select our chip
- start the conversion with the Generate button
Now the prepared file can be fed to the FPGA, and it will update the ROM firmware.










