Nios® V Processor Software Developer Handbook

ID 743810
Date 7/08/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

16.2.2.2. elf2flash

Synopsis

elf2flash [OPTIONS] <ELF FILE> <SREC FILE>

Description

The elf2flash utility converts the software and data within an ELF file in the address range [base, end] into a SREC file that can be programmed into the flash memory connected to an Intel FPGA.

This utility can also optionally insert a boot copier into the SREC file to copy the software from flash memory to RAM before running it.

Usage

#Generate SREC file
elf2flash --input <user application>.elf --output flash.srec --program_record_format –-offset 0x0

#Insert boot copier into the SREC file
elf2flash --boot <boot_copier> --input <user application>.elf 
--output flash.srec --reset <reset offset> --base <base address of flash memory> --end <end address of flash memory

Options

Options Description
--after <file> Start output at address immediately following data in specified SREC file
-b,--base <addr> ELF base address
--boot <file> Boot copier SREC file
--debug Debug mode
-e,--end <addr> ELF end address
--epcs Quad SPI flash mode
-h,--help Print this message
-i,--input <file> Input ELF file to process
--log <file> File for logging progress
-o,--output <file> Output SREC file
--offset <offset> SREC offset
--program_record_format Use program record format, synonymous to --epcs
-q,--quiet Only print errors
-r,--reset <addr> CPU reset address
-s,--silent Silent mode - same as quiet
--save Save intermediate files
--sim_optimize <value> Optimize for simulation
-v,--verbose Lots of interesting information