Nios® II Flash Programmer User Guide

ID 683118
Date 11/06/2017
Document Table of Contents

3.3. elf2flash

The elf2flash utility takes an Executable and Linking Format File, and translates it to an S-record file suitable for programming into flash memory.
elf2flash also inserts a boot copier into the flash file, if needed. elf2flash inserts the boot copier code before the application code under the following conditions:
  • The processor’s reset address falls within the address range of the flash memory being programmed.
  • The executable code is linked to a memory location outside of the flash memory being programmed.

If elf2flash inserts a boot copier, it also translates the application executable and linking format file to a boot record for use by the boot copier. This boot record contains all of the application code, but is not executable. After reset, the boot copier reads the boot record from flash memory and copies the application code to the correct linked address, and then branches to the newly-copied application code.