Page 1
Nios II Flash Programmer User Guide Preliminary Information 101 Innovation Drive San Jose, CA 95134 (408) 544-7000 http://www.altera.com...
Page 2
Altera Corporation in the U.S. and other countries. All other product or service names are the property of their respective holders. Al- tera products are protected under numerous U.S.
Contents About This User Guide ................v Chapter 1. Overview of the Nios II Flash Programmer Introduction ............................1–1 Prerequisites ............................1–2 How the Flash Programmer Works ....................1–2 IDE and Command-Line Modes ......................1–3 Flash Programmer Target Design ....................... 1–3 Minimum Component Set .......................
Page 4
Contents Probable Cause ..........................D–1 Suggested Actions ........................... D–1 "No Nios II processors available" Error ..................... D–1 Probable Cause ..........................D–1 Suggested Actions ........................... D–1 "No CFI table found" Error ........................D–2 Probable Cause ..........................D–2 Suggested Actions ........................... D–2 "No EPCS registers found"...
Updates for the Nios II version 5.1 release. Includes major changes to the flash programmer target design. December 2004 Updates for the Nios II version 1.1 release. May 2004 First release of the flash programmer user guide for the Nios II development boards. Altera Corporation...
Page 6
Product literature www.altera.com/literature/ Altera literature services literature@altera.com FTP site ftp.altera.com Note to table: You can also contact your local Altera sales office or sales representative. Typographic This document uses the following typographic conventions: Conventions Visual Cue Meaning Bold Type with Initial...
Page 7
A warning calls attention to a condition or possible situation that can cause injury to the user. The angled arrow indicates you should press the Enter key. The feet direct you to more information on a particular topic. Altera Corporation...
Page 8
Typographic Conventions Nios II Flash Programmer User Guide viii Altera Corporation...
Nios II processor also incorporate flash memory on the board to store FPGA configuration data or Nios II program data. The Nios II flash programmer is part of the Nios II development tools, and is a convenient method of programming this memory.
In this document, the term "flash memory" refers to both CFI and EPCS memory devices, unless otherwise noted. Prerequisites This user guide assumes that you are familiar with the Nios II hardware and software development flow. You need to be familiar with the contents of the following tutorials: ■...
Overview of the Nios II Flash Programmer IDE and You can run the Nios II flash programmer in either of two modes: Command-Line ■ IDE Mode – The Nios II IDE provides an easy-to-use interface to the flash programmer features. The IDE mode is suitable for most flash Modes programming needs.
CFI flash memory and an EPCS serial configuration device. The system also includes other components which relate to the purpose of the system, not the flash programmer. 1–4 Altera Corporation Nios II Flash Programmer User Guide May 2007...
Page 13
The full_featured or standard hardware example designs included with Nios development tools are ready-made target designs that work with Altera development boards. If you are developing for a custom board, consider using one of these example designs as a starting point in creating your first target design.
Page 14
Flash Programmer Target Design 1–6 Altera Corporation Nios II Flash Programmer User Guide May 2007...
Chapter 3, Using the Flash Programmer in Command-Line Mode. The Flash To open the Nios II flash programmer in the Nios II IDE, first highlight the software project for which you wish to program flash, then from the Programmer Tools menu, click Flash Programmer. The Flash Programmer dialog box appears.
Page 16
If you have previously programmed the project to flash, and you selected special options, you might wish to reuse the flash configuration. 2–2 Altera Corporation Nios II Flash Programmer User Guide May 2007...
Page 17
3–2. To burn flash using a flash configuration, carry out the following steps: If you wish to program flash with software from your Nios II IDE project, or a read-only zip file system associated with your Nios II IDE project, check the box titled Program software project into flash memory.
Page 18
Click Program Flash. The IDE performs the sequence of operations required to program all the specified files into flash memory. Refer to the Nios II IDE help system for an explanation of controls in the Flash Programmer dialog box. Click Help in the upper right hand corner of the Flash Programmer dialog box to open the help system.
Converts an SRAM object file to an S-record file. elf2flash Converts a Nios II executable and linking format file (.elf) to an S-record file. bin2flash Converts an arbitrary data file to an S-record file.
S-record file as an input, provided that the addresses specified in the S-record file represent offsets from the beginning of flash memory. The Nios II IDE creates flash programmer files with a .flash extension.
Page 21
Turning this parameter on is the same as turning off the Validate Nios II System ID before software download checkbox in the Nios II IDE. --erase= <start>,<size> Optional; defaults off. Erases a range of bytes in the flash memory.
Page 22
Specifies that the target flash memory an EPCS serial configuration is an EPCS serial configuration device. device; defaults off. --debug Optional; defaults off. Prints debug information about the physical memory inside the EPCS device. 3–4 Altera Corporation Nios II Flash Programmer User Guide May 2007...
ID. To determine the JTAG device index, run jtagconfig. There are two ways to find the correct value of the instance ID for a processor. The easiest is to use the Nios II IDE to create a sample flash programmer script. See Chapter 2, Using the Flash Programmer in IDE Mode details.
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: 3–6 Altera Corporation Nios II Flash Programmer User Guide May 2007...
Page 25
--reset= Required. The processor reset address, which is specified in SOPC <addr> --base Builder. elf2flash uses this parameter with --end to determine whether the system requires a boot copier. Altera Corporation 3–7 May 2007 Nios II Flash Programmer User Guide...
EPCS 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 device, the --after parameter lets you position the software executable directly after the FPGA configuration data.
Depending on your application, you might find it more convenient to use the Read-Only Zip Filing System, which serves the same purpose. For details, see the Zip Read-Only File System topic in the Nios II IDE help system. Do not use bin2flash to convert executable software files or FPGA configuration files.
--location=0x40000 --input=data.bin --output=data.flash Converts data.bin to an S-record file named data.flash. Addresses in the S-record file place the data starting at offset 0x40000 from the beginning of flash memory. 3–10 Altera Corporation Nios II Flash Programmer User Guide May 2007...
CFI aspects of the device. Some CFI flash memory devices contain missing or incorrect CFI table information. In this case, the Nios II flash programmer might fail based on the erroneous information in the CFI table. For these devices, the...
How to Use the Flash Override File There are two ways to deploy flash override files: Place the override file in <Nios II EDS install path>/bin. The flash programmer searches this directory for all filenames matching the pattern nios2-flash-override*. The flash programmer loads all these files as override files.
Page 31
This parameter is known to be necessary for only two flash memory devices: the ST Micro ST29W800 and ST29W640. Unless you are using these devices, you are unlikely to require this parameter. Altera Corporation A–3 May 2007 Nios II Flash Programmer User Guide...
Page 32
Width Mode Override Parameter A–4 Altera Corporation Nios II Flash Programmer User Guide May 2007...
1, 2, or 3, and with all Altera EPCS serial configuration devices. Not all flash memory devices have been tested with the Nios II flash programmer. All the flash memory devices that Altera has verified in hardware with the Nios II development tools are listed in this chapter.
Page 34
B–2 Altera Corporation Nios II Flash Programmer User Guide May 2007...
Mode While developing hardware or software, you use the Nios II flash programmer on a computer with the Quartus II software and the Nios II development tools installed. However, in a production or service environment you might want to set up a computer to program flash memory without installing the full set of Altera development tools.
Running the Nios II Stand-Alone Flash Programmer Running the To run the flash programmer in stand-alone mode, perform the following steps: Nios II Stand- Open a command prompt on the stand-alone computer. Change Alone Flash directories to the location of the files you wish to program into flash Programmer memory.
Each section in this chapter describes a common issue you might run into when using the Nios II flash programmer. Program Flash In the Flash Programmer dialog box in the Nios II IDE, the Program Flash button appears grayed out. Button Grayed...
"No CFI table found at address <base address>" found" Error Probable Cause The flash programmer can connect with a Nios II JTAG debug module in the FPGA, but it can not successfully execute a query to a flash memory at the base address specified.
Ensure that the EPCS device is correctly connected to the FPGA on the board. Verify the EPCS connection by running the "Test EPCS" routine in the "Memory Test" software template in Nios II IDE. If the test fails, there is a problem with your memory connection. There are...
Base address not aligned on size of device Suggested Actions Use the Quartus II Programmer to download the correct FPGA configuration file to the FPGA, then try using the Nios II flash programmer again. Base address When you run the flash programmer, you get the error message Base address not aligned on size of device.
Need help?
Do you have a question about the Nios II and is the answer not in the manual?
Questions and answers