beautypg.com

Sof2flash command-line examples, Elf2flash, Sof2flash command-line examples –6 – Altera Nios II User Manual

Page 20: Elf2flash –6

background image

3–6

Chapter 3: Using the Flash Programmer from the Command Line

elf2flash

Nios II Flash Programmer User Guide

© March 2014

Altera Corporation

sof2flash Command-Line Examples

sof2flash --offset=0x0 --input=standard.sof \
--output=standard_cfi.flash

Converts standard.sof to an S-record file named standard_cfi.flash intended for a CFI
flash memory. The S-record offset begins at 0x0.

sof2flash --epcs --input=standard.sof --output=standard_epcs.flash

Converts standard.sof to an S-record file named standard_epcs.flash intended for an
EPCS device.

sof2flash --epcq --input=standard.sof --output=standard_epcq.flash

Converts standard.sof to an S-record file named standard_epcq.flash intended for an
EPCQ device.

sof2flash --optionbit=0x18000 --pfl --input=standard.sof \

--output=standard.flash --offset=0x640000

Converts standard.sof to an S-record file named standard.flash for use with the
parallel flash loader, and generates an option-bits overwrite file standard.map.flash
for option bits at offset 0x18000 on the flash memory device.

1

Altera recommends that you not use the standard.map.flash file even if you generate

it. The --optionbit command-line option is required for correct functioning of the
--pfl

option, but the resulting overwrite file should be ignored.

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.

Table 3–4

lists the typical parameters used with elf2flash.

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

Name

Required

Description

General Parameters

--input=

<file>

Required.

The name of the input Executable and Linking Format File.

--output=

<file>

Required.

The name of the output file.