beautypg.com

Nios2-flash-programmer command-line examples, Nios2-flash-programmer command-line examples –4 – Altera Nios II User Manual

Page 18

background image

3–4

Chapter 3: Using the Flash Programmer from the Command Line

nios2-flash-programmer

Nios II Flash Programmer User Guide

© March 2014

Altera Corporation

f

For additional parameters, type nios2-flash-programmer --help at a
command line.

nios2-flash-programmer Command-Line Examples

nios2-flash-programmer --cable="Usb-blaster [USB-0]" --base=0x200000\

--program ext_flash.flash

Programs CFI flash memory based at address 0x200000 with input file ext_flash.flash
using a cable named "Usb-blaster [USB-0]"

nios2-flash-programmer --epcs --base=0x02100000 epcs_controller.flash

Programs an EPCS/EPCQ device based at address 0x02100000 with input file
epcs_controller.flash

.

nios2-flash-programmer --base=0x200000 --read=current.srec \
--read-bytes=0,0x10000

Reads 0x10000 bytes from CFI flash memory based at address 0x200000 and writes the
contents to a file named current.srec

nios2-flash-programmer --base=0x200000 --erase=0x8000,0x10000

Erases address range 0x8000 to 0x10000 in CFI flash memory based at address
0x200000

nios2-flash-programmer --base=0x200000 --debug

--base=

Required

Specifies the base address of the CFI flash memory.
This parameter is the absolute address in the target
design's address space. nios2-flash-programmer
treats addresses in the S-record files as offsets to
the base address.

EPCS Parameters

--epcs

Required when
programming an
EPCS/EPCQ serial
configuration device;
defaults off

Specifies that the target flash memory is an
EPCS/EPCQ serial configuration device.

--debug

Optional; defaults off

Prints debug information about the physical memory
inside the EPCS/EPCQ device.

--base=

Required

Specifies the base address of the EPCS/EPCQ device.

Notes to

Table 3–2

:

(1) The --cable parameter is only needed if there are multiple download cables connected to the host computer. To determine the cable names,

run jtagconfig.

(2) The --device parameter is only needed if there are two or more processors in different devices with the same instance ID. To determine the

JTAG device index, run jtagconfig.

(3) There are two ways to find the correct value of the instance ID for a processor. The easiest is to use the Nios II Flash Programmer GUI to create

a sample flash programmer script. Refer to

Chapter 2, Using the Flash Programmer GUI

for details. Alternatively, open

name>.jdi, in the Quartus II project directory. Locate the Nios II processor node by finding a value of hpath containing name>=. The instance ID is specified as instance_id.

(4) In system.h and in your board support package (BSP), the system ID base address is specified by SYSID_BASE.

(5) In system.h and in your BSP the system ID value is specified by SYSID_ID.

(6) In system.h and in your BSP, the system ID time stamp is specified by SYSID_TIMESTAMP.

Table 3–2. nios2-flash-programmer Parameters (Part 3 of 3)

Name

Required

Description