Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

5.11.3.3.1. alt-file-convert (BETA)

Description

alt-file-convert (BETA): General file conversion tool. For Nios® II, it is primarily used for generating a Nios II application image for Max Onchip Flash and EPCQ.

Usage

alt-file-convert -I <input_type> -O <output_type> [option(s)] --input=<input_file> --output=<output_file>
For Nios® II, the BETA version is limited to the following uses:
  • Convert between Intel HEX (byte addressed) and Quartus HEX (word addressed)
  • Convert between Quartus HEX files of various widths
  • Covert an .elf file to a HEX file and append a bootcopier (used for application flash image for Max On-chip Flash and EPCQ

Options

-h, --help - prints usage
-I - input type
-O - output type
--base - base address (in hex) f target memory (default 0x0)
--end - end address (in hex) of target memory (default 0xFFFFFFFF)
--reset - reset address (in hex) of target memory (default None)
--input - path to input file
--output - path to output file
--in-data-width - data width of inputfile [8, 16, 32, 64, 128, 256] (default 8)
--out-data-width - data width of target memory [8, 16, 32, 64, 128, 256] (default None)
--boot - location of boot file to be appended (srec format)

Examples

Converting from Intel Hex (IHEX) to a Quartus Hex (HEX) for a memory with a 32-bit data width:
alt-file-convert –I ihex –O
          hex out-data-width 32 in.ihex out.hex
Converting from an .elf file to a flash and appending a bootcopier given as a srec file:
alt-file-convert –I elf32-littlenios2 –O flash in.elf out.flash –-have-boot-copier –-boot boot.elf