To configure the flash memory of some modules with Intel FPGA(/SoCs from Trenz Electronic, a .jic file is needed. This file is built from the .sof file from the Quartus project and optionally the .hex file from the software application.
This is a short tutorial on how to create the .jic file.

More detailed instructions can be found directly on the Intel website:

Prepare file conversion


Generate a .jic file only from the .sof file (without .hex file)

  1. Compile the quartus project to generate a .sof file
  2. Go to Convert .sof with .hex file (optional) to .jic file and ignore the steps to add the .hex file

Generate a .jic file from the .sof file with .hex file

Prepare Quartus Project:

  1. Compile the quartus project to generate a .sof file
  2. Make following changes in platform desginer:
    1.  Serial Flash Controller II Intel FPGA IP or Generic QUAD SPI Controller II Intel FPGA IP (depending on the configuration flash memory) is needed to load the software application from the configuration flash memory
    2. Nios II:
      1. set Nios II Processor → Vectors → Reset vector memory to the selected flash memory controller
      2. set Nios II Processor → Vectors → Reset vector offset to an address after the .sof file (minimum address: start address + file size of the .sof file)
    3. Nios V:
      1. set Nios V Processor → Vectors → Reset Agent to the selected flash memory controller
      2. set Nios V Processor → Vectors → Reset Offset to an address after the .sof file (minimum address: start address + file size of the .sof file)
  3. Recompile the whole quartus project


Prepare Nios II software project:

  1. Open the software application in Nios II SBT for Eclipse
  2. Recompile the software project
  3. Right-click on project folder and select Make Targets -> Build
  4. In the opened Make Targets window select mem_init_generate and click Build
    1. the .hex file is created in the mem_init folder in the software project directory

Prepare Nios V software project:

  1. Recompile the software project
  2. Open the Nios V Command Shell
  3. Run following commands to generate the .hex file
    elf2flash --input path/to/sw_example.elf --output path/to/sw_example.srec \
    --reset  <flash memory controller base address + CPU reset offset> \
    --base <flash memory controller base address> --end <flash memory controller end address> \
    --boot <quartus_installation_path>/niosv/components/bootloader/niosv_bootloader.srec //check directory for correct bootloader file name
    
    riscv32-unknown-elf-objcopy --input-target srec --output-target ihex path/to/sw_example.srec path/to/sw_example.hex

Convert .sof with .hex file (optional) to .jic file


Do following steps to convert the .sof + .hex file to a .jic file:

  1. Select File → Convert Programming files from the quartus top menu
  2. Make the following settings in the Convert Programming File window

                  

    1. Programming file type: JTAG Indirect Configuration File (.jic)
    2. Configuration device: depending on the configuration flash memory used on the module
      (if the memory device is not listed click "..." button next to the dropdown menu, select correct Device family and in the Configuration Device section the correct memory device)
    3. Mode: Active Serial
    4. File name: specify the target directory and the output file name

    5. Highlight Flash Loader in Input files to convert window

    6. Click Add Device..., select correct Device family and Device name and click OK

    7. Highlight SOF Data in Input files to convert window

    8. Click Add File..., browse to the .sof file you want to convert and click open

    9. Highlight selected .sof file

    10. Click Properties, enable Compression and click OK
    11. Click Add Hex Data to open then Add Hex Data window:
      1. set Addressing mode to Absolute addressing
      2. set Bit-level endianness to Big endian
      3. click "...", browse to the .hex file location and click open
      4. click OK to add the .hex file
  3. Click Generate to start converting the .sof file and .hex file to a .jic file

You can use the Quartus Programmer to program the flash configuration device with the .jic file.

References






<style>
.wiki-content .columnLayout .cell.aside {
width: 0%;
}</style>




Table of contents