Generic Nios II Booting Methods User Guide

ID 683820
Date 5/24/2016

1.6.3. Elf2flash Utility

The elf2flash utility generates SREC image (*.flash extension) by extracting ELF loadable sections. The SREC image can then be programmed into flash devices supported by Nios II Flash Programmer.

For CFI flash devices, both the optional CFI bootcopier and ELF loadable sections are stored in the device. When the CFI bootcopier is not used, the SREC image only contains loadable section data. When the CFI bootcopier is used, the SREC image contains a CFI bootcopier and the ELF payload, where the bootcopier is precompiled to assume the payload is linked immediately after it.

For EPCS/EPCQ flash devices, only the ELF payload is stored in the device. EPCS bootcopier is always required, but is stored within the EPCS controller boot ROM initialized after POF configuration, and thus the SREC image only contains the ELF payload.

When either CFI and EPCS bootcopier is used, elf2flash extracts ELF loadable sections as the bootcopier’s payload in the form of payload header (4 bytes load address + 4 bytes section size) and payload data (n-bytes section data) for each loadable sections .Elf2flash also generates a last, extra section for storing the .text section load address to allow bootcopier to transfer control to the program.

This elf2flash utility is an important element for Nios II Flash Programming flow method.