beautypg.com

Altera Nios II User Manual

Page 21

background image

Chapter 3: Using the Flash Programmer from the Command Line

3–7

elf2flash

© March 2014

Altera Corporation

Nios II Flash Programmer User Guide

f

For additional parameters, type elf2flash --help at a command line.

Programming Both Hardware and Software into an EPCS/EPCQ Device

The --base parameter is not available for EPCS/EPCQ devices, because in
EPCS/EPCQ devices, FPGA configuration data must start at address 0x0. However, if
you are programming both an FPGA configuration and a Nios II software executable
in the EPCS/EPCQ device, the --after parameter lets you position the software
executable directly after the FPGA configuration data.

CFI Parameters

--base=

<addr>

Required.

The base address of the flash memory component. elf2flash uses this
parameter with --end and --reset to determine whether the system
requires a boot copier.

--end=

<addr>

Required.

The end address of the flash memory component. elf2flash uses this
parameter with --base and --reset to determine whether the system
requires a boot copier.

--reset=

<addr>

Required.

The processor reset address, which is specified in Qsys. elf2flash uses
this parameter with --base and --end to determine whether the
system requires a boot copier.

--boot=

<file>

Required 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.

Specifies the boot copier object code file. Ignored if the boot copier is not
required. If elf2flash determines that a boot copier is required, but the
--boot

parameter is absent, elf2flash displays an error message. The

Altera-provided boot copier resides at path>/components/altera_nios2/boot_loader_cfi.srec.

EPCS Parameters

--epcs

Required when
creating files for an
EPCS/EPCQ device;
defaults off.

Specifies that the output is intended for an EPCS/EPCQ device.

--after=

<file>

Required when
programming both
hardware and
software into an
EPCS/EPCQ device

elf2flash uses this parameter to position a Nios II executable in an
EPCS/EPCQ device along with an FPGA configuration. For further details,
see

“Programming Both Hardware and Software into an EPCS/EPCQ

Device”

.

Table 3–4. elf2flash Parameters (Part 2 of 2)

Name

Required

Description