Home
Nios II Flash Programmer User Guide
Contents
1. Project 2 New Component E System K4 OX 3 Si Isi s C4 Ca reset n data master heme Memory Mapped Master instruction master valon Memory Mapped Master jtag debug module r Reset Output jtag debug module Avalon Memory Mapped Slave Custom instruction m Custom Instruction Master epcs flash controlle EPCS EPCQx 1 Serial Flash Controller dk Clock Input reset Reset Input epcs control port Avalon Memory Mapped Slave Ej onchip memory2 0 On Chip Memory RAM or ROM dki Clock Input si Avalon Memory Mapped Slave reseti Reset Input jtag uart 0 JTAG UART dk Clock Input reset Reset Input avalon_jtag_siave Avalon Memory Mapped Slave E dk o Clock Source dk in Clock Input ck jn reset Reset Input dk Output ck reset t Output Ej sysid qsys 0 System ID Peripheral dk IClock Input reset Reset Input control slave Avalon Memory Mapped Slave B leds PIO Parallel 1 0 dk Clock Input reset Reset Input si lavaion Memory Mapped Slave extemal connection Conduit Reset Input m lg I ck1 dk 0 ck idk dd 0x0002 1800 0x0002 1000 0x0001 0000 0x0002 2008 0x0002 2000 0x0000_0000 Hardware example designs capable of programming the flash memory are provided with Altera develop ment boards If you are developing for a custom board consider using one of these example designs as a starting point for your fl
2. C 3 Reading System ID at Address Ox lt address gt FAIL Brrr a ue aeter tette rtr een db C 3 Probable CS ir M C 4 S ggest d Turre e C 4 Base Address Not Aligned on Size of Device EMrOt s cisssssasccssasstanississssssosvsasionssinisasssunssinncasivaceostonnivis C 4 Probable US asses M C 4 SURO SSL MUTI oss cede optic C 4 Document Revision History for Nios II Flash Programmer User Guide D 1 Altera Corporation Overview of the Nios Il Flash Programmer 1 2015 07 01 UG NIOSIIFLSHPROG GX subscribe C_ Send Feedback Introduction Many hardware designs that include the 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 Embedded Design Suite EDS Its purpose is to program data into a flash memory device connected to an Altera FPGA The Nios II Flash Programmer sends file contents over an Altera download cable such as the USB Blaster to a Nios II system running on the FPGA and instructs the Nios II system to write the data to flash memory The Nios II Flash Programmer can program three types of content to flash memory e Nios II software executable files Many systems use flash memory to store non volatile program code or firmware Nios II systems can boot from flash memory e FP
3. 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 Not Aligned on Size of Device Error When you run the flash programmer you get the error message Base address not aligned on size of device Probable Cause The flash device base address being passed to the Flash Programmer is not a multiple of the flash device s size Suggested Actions e Ensure that the flash device is mapped to a base address in Qsys that is a multiple of the flash size listed in its CFI table e Ifin command line mode ensure that the base parameter you are passing to nios2 flash programmer is the correct base address of the flash device in your Qsys system Altera Corporation Troubleshooting C Send Feedback Document Revision History for Nios II Flash Programmer User Guide D 2015 07 01 UG NIOSIIFLSHPROG GX subscribe C send Feedback e T vesen T caas NN July 2015 2015 07 01 Added info for how to build a bootable pof file including Nios II code for boot from EPCS and or device eram March 2014 2 2 e In chapter 1 added cross reference to the Quad Serial Configura tion EPCQ Devices Datasheet e Inchapter 1 updated the Minimum Component Set for the Flash Programmer Target Design table and updated the table notes e Inchapter 1 updated the Example Target Design Containing the Minimum Component Set figure e In chap
4. Click Start The Nios II Flash Programmer performs the actions specified by the commands storing the generated flash files to the specified flash directory and capturing the commands it runs to the flash programmer sh bash shell script in the specified script directory Note You can use this script to duplicate the same actions again in the future and to learn about the command line utilities Related Information Nios II Gen2 Software Developer s Handbook For information about the Altera Zip Read Only File System refer to the Read Only Zip File System chapter in the Nios II Gen2 Software Developer s Handbook 9 Relevant only if you turn on Program Files Altera Corporation Using the Flash Programmer GUI C Send Feedback Using the Flash Programmer from the Command Line 2015 07 01 UG NIOSIIFLSHPROG GX subscribe C send Feedback The Nios II development tools provide command line utilities which give you complete control of the Nios II Flash Programmer features You can create a custom script file to automate a flash programming task Alternatively you can use the flash programmer GUI For more information about the flash programmer GUI refer to the Using the Flash Programmer GUI chapter The Nios II Flash Programmer GUI programs flash memory by creating a script based on the command line utilities The script is well formed customized to your project and human readable You can use it as a reference for fla
5. Flash Programmer GUI and Command Line Utilities You can run the Nios II Flash Programmer from a GUI or from the command line The GUI displays the command line equivalents of the actions you direct it to perform For more information about the flash programmer GUI refer to Using the Flash Programmer GUI chapter For more information about using the flash programmer command line utilities refer to Using the Flash Programmer from the Command Line chapter Altera Corporation Overview of the Nios II Flash Programmer LJ Send Feedback UG NIOSIIFLSHPROG 2015 07 01 How the Flash Programmer Works 1 3 The following tools allow you to run the Nios II Flash Programmer e Nios II Software Build Tools for Eclipse The Nios II Software Build Tools SBT for Eclipse provides easy access to the Nios II Flash Programmer GUI The flash programmer GUI is an easy to use interface that allows you to control the flash programmer features using settings you can store and reuse This access method is suitable for most flash programming needs e Nios II Command Shell The Nios II Command Shell provides commands that control the flash programmer features You might have to calculate some parameters manually You can also start the Nios II Flash Programmer GUI from the command line Related Information e Using the Flash Programmer GUI on page 2 1 e Using the Flash Programmer from the Command Line on page 3 1 How the Flash Programmer Works The N
6. ID base address is specified by sys1D_ BASE In system h and in your BSP the system ID value is specified by svs1p ip Using the Flash Programmer from the Command Line Altera Corporation C Send Feedback 3 4 General Parameters UG NIOSIIFLSHPROG 2015 07 01 name KNEE CI NN timestamp time Optional required for system timestamp validation Contains the timestamp value programmed into the System ID component in your system Qsys sets this value based on the time of system generation This value is in unsigned decimal format for example 1177105077u Turning this parameter on is the same as turning off the Ignore mismatched system timestamp check box in the Nios II Flash Programmer GUI Hardware Connections dialog box accept bad sysid Optional defaults off Used to bypass the system ID validation Forces the flash programmer to download a flash image Turning this parameter on is the same as turning on the Ignore mismatched system ID check box in the Nios II Flash Programmer GUI Hardware Connections dialog box erase start size Optional defaults off Erases a range of bytes in the flash memory erase all Optional defaults off Erases the entire flash memory The erase operation occurs before programming if an input file is provided for programming program Optional defaults on if an input file is specified no keep nearby Optional defaults off Programs flash
7. USB Blaster USB 0 Device EP2C35 Device ID 1 CPU Instance ID 1 CPUName cpul CPU Archite Hardware Connections Flash epcs controller Flash ext flash Base address 6423600 Master CPU cpul Files for flash conversion File Name Information Problems Processing No files have been added for conversion to target flash files Working with Flash Programmer Settings Files The Nios II Flash Programmer GUI is a powerful tool with many options Altera recommends saving your flash programmer settings in a Nios II Flash Programmer Settings File flash settings for future use Using the Flash Programmer GUI Altera Corporation C Send Feedback z UG NIOSIIFLSHPROG 2 4 Setting the Hardware Connection 2015 07 01 The flash settings file includes the settings described in the following sections such as the script and flash files directory paths whether to perform system ID and system timestamp checking and whether to generate flash files or program flash memory To save your current flash programmer settings on the File menu click Save or SaveAs to update or create a flash settings file After you save the file you can continue to edit it in the Nios II Flash Programmer GUI To open a pre existing flash programmer settings file on the File menu click Open and navigate to the location of the existing flash settings file Setting the Hardware Connection This section describes how to select the correc
8. found at CFI table address 0x2C is overridden to 0x1 Note This example is for illustration only nios2 flash programmer recognizes the SST 39VF800 asa nonstandard CFI device and overrides its CFI table You do not need to create an override file for this particular part How to Use the Flash Override File There are two ways to deploy flash override files e Place the override file in Nios II EDS install path gt bin The Nios II Flash Programmer searches this directory for all filenames matching the pattern nios2 flash override The flash programmer loads all these files as override files e Pass the override file to the flash programmer with the override parameter The following example illustrates this parameter nios2 flash programmer base 0x0 override my override txt sw flash Width Mode Override Parameter The override procedure described in the Flash Override Files chapter assumes the Nios II Flash Programmer detects the correct data width mode from the CFI query table In some cases a 16 bit CFI flash memory device wired in 8 bit mode might return a query table indicating 16 bit mode This condition prevents the flash programmer from correctly interpreting the remainder of the query table The flash programmer cannot detect this situation because the device type is unreadable If your flash memory device has this problem you must program it from the command line In this case override the data widt
9. 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 e The processor s reset address falls within the address range of the flash memory being programmed e 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 applica tion code to the correct linked address and then branches to the newly copied application code elf2flash Parameters The following tables contain the General CFI and EPCS parameters for elf2flash For additional parameters type e1 2 1ash helpata command line General Parameters END NENNEN ORE ON input file Required The name of the input Executable and Linking Format File output file Required The name of the output file Altera Corporation Using the Flash Programmer from the Command Line C Send Feedback UG NIOSIIFLSHPROG 2015 07 01 CFI Parameters NINE NNNM NEUE O NEN base addr Required CFI Parameters 3 9 Description The base address of the flash memory com
10. with the Quartus II Software Using the Flash Programmer from the Command Line Altera Corporation C Send Feedback UG NIOSIIFLSHPROG 3 8 sof2flash Command Line Examples 2015 07 01 sof2flash Command Line Examples e 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 offset 0x0 input standard sof output standard_cfi flash e Converts standard sof to an S record file named standard_epcs flash intended for an EPCS device sof2flash pcs input standard sof output standard epcs flash e Converts standard sof to an S record file named standard epcq flash intended for an EPCQ device sof2flash pcg input standard sof output standard epcq flash e 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 sof2flash optionbit 0x18000 pfl input standard sof output standard flash offset 0x640000 Note Altera recommends that you not use the standard map flash file even if you generate it The opt ionbit 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
11. writing by Altera Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services JANOS RYA 101 Innovation Drive San Jose CA 95134 UG NIOSIIFLSHPROG A 2 Flash Override File Format 2015 07 01 Before creating an override file run nios2 flash programmer from the command line with the debug parameter which lists the CFI table found in the device Compare the debug output with the device s data sheet Flash Override File Format Flash override files contain two sections for each flash memory they override The first section declares the flash memory type The second section is the CFI table override data The flash override file can contain comments preceded by a character For example the SST 39VF800 flash memory contains three incorrect entries in its CFI table at location 0x13 0x14 and 0x2c The following example demonstrates how to override the values at those addresses FLASH 00BF 2781 4 Keyword FLASH followed by the Mfgr ID and Device ID These ID values can be found in three ways by consulting the flash memory device s data sheet by using the autoselect command by running nios2 flash programmer debug CFI 0x13 0x02 The primary command set found at CFI table CFI 0x14 0x00 4 addresses 0x13 and 0x14 are overridden to 0x02 0x00 CFI 0x2C 0x01 The number of CFI Erase block regions
12. 1 2 Updates for the Nios II version 5 1 release Includes major changes to the flash programmer target design December 2004 1 1 Updates for the Nios II version 1 1 release May 2004 1 0 Initial release Altera Corporation Document Revision History for Nios Il Flash Programmer User Guide C Send Feedback
13. Devices Datasheet and the EPCS Device Controller Core chapter in Volume 5 Embedded Peripherals of the Quartus II Handbook O 2015 Altera Corporation All rights reserved ALTERA ARRIA CYCLONE ENPIRION MAX MEGACORE NIOS QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U S Patent and Trademark Office and in other countries All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www altera com common legal html Altera warrants performance ISO of its semiconductor products to current specifications in accordance with Altera s standard warranty but reserves the right to make changes to any 9001 2008 products and services at any time without notice Altera assumes no responsibility or liability arising out of the application or use of any information Registered product or service described herein except as expressly agreed to in writing by Altera Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services JANOS RYA 101 Innovation Drive San Jose CA 95134 T UG NIOSIIFLSHPROG 1 2 Prerequisites 20150701 The Nios II processor supports the following two boot options using Altera Serial Flash e The Nios II processor application executes in place from EPCQ flash The Nios II processor applicatio
14. GA configuration data At system power up the FPGA configuration controller on the board can read FPGA configuration data from the flash memory Depending on the design of the configuration controller it might be able to choose between multiple FPGA configuration files stored in flash memory e Other arbitrary data files The Nios II Flash Programmer can program a binary file to an arbitrary offset in a flash memory for any purpose For example a Nios II program might use this data as a coefficient table or a sine lookup table The Nios II Flash Programmer can be used to program the following types of memory Common flash interface CFI compliant flash memory CFI is an industry standard that provides a common vendor independent interface to flash memory devices For more information about the CFI specification refer to the JEDEC Common Flash Interface standard JESD68 01 and JEDEC publications JEP137x available on the JEDEC Solid State Technology Association standards organization website www jedec org e Altera erasable programmable configurable serial EPCS or quad serial configuration EPCQ device Altera EPCS serial configuration devices store FPGA configuration data and Nios II executable software For more information about EPCS devices refer to the Serial Configuration Devices EPCS1 EPCS4 EPCS16 EPCS64 and EPCS128 Data Sheet chapter in Volume 2 Altera Configuration Handbook the Quad Serial Configuration EPCQ
15. Nios Il Flash Programmer User Guide SX subscribe UG NIOSIIFLSHPROG 2015 07 01 LJ Send Feedback 101 Innovation Drive mm San Jose CA 95134 JAN OTS RYA www altera com TOC 2 Contents Overview of the Nios II Flash Programmer eere eene eene 1 1 IM ROGIC HON MN E M 1 1 locuni 1 2 Nios II Flash Programmer GUI and Command Line Utilities sss 1 2 How the Flash Programmer WOtls eio oipetes i Datei eter ice ini deg esas ui E o ibn d etti s 1 3 Flash Programmer Target DESI n as deca dae mn oet es ceiistencdicidit dodge m ep ird die 1 3 Using th Flash Programmer GU eor bto tti ra ntu PER a REPE y REX ERE EME epe E RUE 2 1 liyscesiiruu oU 2 1 Starting the Flash Programmer GU Lusia eee encisdesta inp Geop bat os Maius tait ani aA Aa AAKE E AS ud 2 1 Specifying your Flash Programmer Sepa eere oie EAR bti ba o RH HANE I S URU RtUge E IM ri 2 2 Working with Flash Programmer Settings Files eo tror tret intr thdb opo Raph rine RUE 2 3 Setting the Hardware COonnsctlobiusu usas tired VIP REESE RE YER NNI UNAM EN IHNEN TERR FIVE EUR 2 4 Checking System ID and System Timestamp siosssssassscasnscnssvsnssnsessnivacvonssveassnssseasensienscnsnsenssnsnsetavsatiesden 2 5 Generating Flash Files and Programming Flash Memory ites ccisctcsssssssssvstssesatinnsensassuctuscvsssnesssssue
16. Patent and Trademark Office and in other countries All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www altera com common legal html Altera warrants performance of its semiconductor products to current specifications in accordance with Altera s standard warranty but reserves the right to make changes to any products and services at any time without notice Altera assumes no responsibility or liability arising out of the application or use of any information product or service described herein except as expressly agreed to in writing by Altera Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services 101 Innovation Drive San Jose CA 95134 Iso 9001 2008 Registered JA DTE RYA UG NIOSIIFLSHPROG B 2 Running the Nios II Stand Alone Flash Programmer 2015 07 01 Related Information Using the Flash Programmer from the Command Line on page 3 1 Altera Corporation Stand Alone Mode C Send Feedback Troubleshooting 2015 07 01 UG NIOSIIFLSHPROG GX subscribe C_ Send Feedback Overview This chapter lists troubleshooting tips for the Nios II Flash Programmer Each section in this chapter describes a common issue you might run into when using the Nios II Flash Programmer Start Button Grayed Out in the Flash Programmer GUI In the Nio
17. X MEGACORE NIOS QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U S Patent and Trademark Office and in other countries All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www altera com common legal html Altera warrants performance ISO of its semiconductor products to current specifications in accordance with Altera s standard warranty but reserves the right to make changes to any 9001 2008 products and services at any time without notice Altera assumes no responsibility or liability arising out of the application or use of any information Registered product or service described herein except as expressly agreed to in writing by Altera Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services JAN DO fs S AN 101 Innovation Drive San Jose CA 95134 UG NIOSIIFLSHPROG 3 2 nios2 flash programmer 2015 07 01 For more information about the Nios II Command Shell refer to the Getting Started from the Command Line chapter of the Nios II Software Developer s Handbook The following sections list the utilities and their functions Related Information Using the Flash Programmer GUI on page 2 1 e Nios II Gen2 Software Developer s Handbook For more information about the Nios II Command Shell
18. ansssasastoniansoss A 2 Stand Alone MO B 1 Altera Corporation Installing the Nios II Stand Alone Flash PrOSEAIWHWBt ecinciiin cr eon eni tre ibn rtt aco eR ea tete UR B 1 Running the Nios II Stand Alone Flash Program met ssssssssssssessssessossorssesssscsssscsscessassasensooeanens B 1 TG WUT prime sages ets cede ase eee C 1 OVER VIC C 1 Start Button Grayed Out in the Flash Programmer GUT a eene tnter tesserae ipta s C 1 coc figni C 1 SURO SLE Treo MP ND C 1 No Nios II Processors Available EEOR an aaceinn inten pe n Min iac t qvis Lar PR REFUS a C 1 iungi e P C 1 S ggested Act Ons MH C 2 No CFI Table Found te OL sctusasinss C 2 Probable CUS T C 2 Suggested PCL ING cado tiv ep Raf gta wave since apap pol pad ARAS aah C 2 No EPCS Registers Pound BIFOF unge ciescnestice n puis ned od pena pem adi cn Crane vie emp C 2 Probable CAUSE e C 3 Suggested PT UA COINS stasis vans son eget aas C 3 system Does Not Have Any Flash Memory EQron sissssisccssssansossianessocssessecasancsasssancoaasinsvesteascasipnascoasssann C 3 I CCISCur e C 3 Suggested Treo NM
19. ash programmer target design Overview of the Nios II Flash Programmer CJ Send Feedback Altera Corporation Using the Flash Programmer GUI 2015 07 01 UG NIOSIIFLSHPROG GX subscribe C_ Send Feedback Introduction The Nios II Flash Programmer GUI is an easy to use graphical interface that automates the process of programming flash memory and enables you to control the programming parameters easily The Nios II Flash Programmer GUI lets you program any combination of software hardware and binary data in flash memory in one operation The flash programmer GUI can also generate flash files for your future use and store them without programming the flash memory Generating flash files or programming flash memory from the flash programmer GUI generates a script for future use from the command line You start the Nios II Flash Programmer GUI from the Nios II SBT for Eclipse or from the command line Alternatively you can use the flash programmer from the command line Using the Flash Programmer from the Command Line chapter describes the flash programmer command line utilities Note Altera recommends that you use the Nios II Flash Programmer GUI to generate automated scripts and use the scripts to automate the Nios II flash programming process Related Information Using the Flash Programmer from the Command Line on page 3 1 Starting the Flash Programmer GUI There are two ways to start the Nios II Flash Programmer GUI e From th
20. both The flash programmer can generate flash files from the following different file types e SRAM Object File sof Contains FPGA configuration data e Executable and Linking Format File elf Contains your executable application software e Altera Zip Read Only File System File zip Contains a read only zip file system associated with your Nios II software application project e An arbitrary binary file The Nios II EDS provides the Altera Zip Read Only File System software component which is an easy to use tool for storing and accessing data in flash memory Depending on your application you might find it Using the Flash Programmer GUI Altera Corporation C Send Feedback UG NIOSIIFLSHPROG 2 6 Generating Flash Files and Programming Flash Memory 2015 07 01 more convenient to use the Zip Read Only File System rather than storing raw binary data in flash memory For information about the Altera Zip Read Only File System refer to the Read Only Zip File System chapter in the Nios II Gen2 Software Developer s Handbook To generate flash files or to write to flash memory using your flash programmer settings perform the following steps 1 On the Options menu turn on the actions you wish to perform The following actions are available e Generate Files Generates flash files Program Files Programs flash memory with the generated flash files e Erase Flash Before Programming Erases the entire flash mem
21. d Line on page 3 1 No CFI Table Found Error When you run the flash programmer to program CFI flash memory you get the error No CFI table found at address base address gt 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 Suggested Actions e Ifyou are using nios2 flash programmer from the command line you must specify the correct base address for the CFI device You can find the flash memory s base address in Qsys e Run nios2 flash programmer from the command line with the debug parameter This command dumps the flash memory s query table Compare the output with the flash memory device s data sheet For more information refer to the Using the Flash Programmer from the Command Line e Ensure your flash memory hardware is correctly connected to place it at the base address specified in Osys Verify the base address by running the Test Flash routine in the Memory Test software template provided in the Nios II EDS If the test fails there is a problem with your memory connection There are two places to look for the problem e The physical connection on your target board The pin assignments on the top level FPGA design e Ifall else fails make sure the flash memory device you are using does not require an override file For more information refer to Appendix A Non Standard Flash Memori
22. e Nios II Command Shell type nios2 flash programmer gui r e From the Nios II SBT for Eclipse e On the Nios II menu click Flash Programmer and the Flash Programmer dialog box appears O 2015 Altera Corporation All rights reserved ALTERA ARRIA CYCLONE ENPIRION MAX MEGACORE NIOS QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U S Patent and Trademark Office and in other countries All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www altera com common legal html Altera warrants performance ISO of its semiconductor products to current specifications in accordance with Altera s standard warranty but reserves the right to make changes to any 9001 2008 products and services at any time without notice Altera assumes no responsibility or liability arising out of the application or use of any information Registered product or service described herein except as expressly agreed to in writing by Altera Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services JANOS RYA 101 Innovation Drive San Jose CA 95134 eos UG NIOSIIFLSHPROG 2 2 Specifying your Flash Programmer Settings 2015 07 01 Figure 2 1 Flash Programmer Dialog Box FB Nios II Flash Programmer Fie Options Help Targe
23. equired 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 EN CRNENNEEE CORN EE OK NN epes Required when programming _ Specifies that the target flash memory is an an EPCS EPCQ serial configu EPCS EPCQ serial configuration device ration device defaults off debug Optional defaults off Prints debug information about the physical memory inside the EPCS EPCQ device base address Required Specifies the base address of the EPCS EPCQ device Using the Flash Programmer from the Command Line LJ Send Feedback Altera Corporation UG NIOSIIFLSHPROG 3 6 nios2 flash programmer Command Line Examples 2015 07 01 nios2 flash programmer Command Line Examples e 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 cable Usb blaster USB 0 base 0x200000 program ext flash flash e Programs an EPCS EPCQ device based at address 0x02100000 with input file epcs controller flash nios2 flash programmer pcs base 0x02100000 epcs controller flash e Reads 0x10000 bytes from CFI flash memory based at address 0x200000 and writes the contents to a file named current srec nios2 flash p
24. es Related Information e Using the Flash Programmer from the Command Line on page 3 1 Non Standard Flash Memories on page 4 1 No EPCS Registers Found Error When you run the flash programmer to program an EPCS device you get the error No EPCS registers found tried looking at addresses Altera Corporation Troubleshooting C Send Feedback S Probable Cause C 3 Probable Cause The flash programmer can connect with a Nios II JTAG debug module in the FPGA but it cannot successfully find an EPCS device located at the specified base address Suggested Actions e Reconfigure the FPGA with a valid target design via JTAG using the Quartus II programmer If the FPGA is configured by another method such as by a configuration controller the pins that connect to the EPCS device might be disabled e Ifyou are using nios2 flash programmer from the command line make sure you specified the correct base address for your EPCS device You can find the flash memory s base address in Qsys e 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 provided by the Nios II EDS If the test fails there is a problem with your memory connection There are two places to look for the problem e The physical connection on your target board e The pin assignments on the top level FPGA design e Use the Quartus II Programmer to
25. get Design chapter Related Information e Using the Flash Programmer GUI on page 2 1 e Flash Programmer Target Design on page 1 3 Quartus II Handbook Volume 3 Verification For instructions on how to configure the FPGA refer to the Quartus II Programmer chapter in volume 3 of the Quartus II Handbook nios2 flash programmer Parameters The following tables contain the General CFI and EPCS parameters for nios2 flash programmer For additional parameters type nios2 flash programmer help at a command line Altera Corporation Using the Flash Programmer from the Command Line C Send Feedback UG NIOSIIFLSHPROG 2015 07 01 General Parameters 3 3 General Parameters ENENLCRNENNEEE CK EE 7 ON cable cable name Required if there are multiple Specifies which download cable to use download cables connected to the host computer device devic Required if there are multiple Specifies the FPGA s device number in the index devices in the JTAG chain JTAG chain The device index specifies the device where the flash programmer looks for the Nios II JTAG debug module JTAG devices are numbered relative to the JTAG chain starting at 1 instance instance Required if there are multiple Specifies which Nios II JTAG debug Nios II processors with JTAG module to look at in the FPGA The debug modules in the target instance ID specifies the JTAG debug design on the FPGA module that is used fo
26. h on the command line with the hidden parameter width s 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 Non Standard Flash Memories C Send Feedback UG NIOSIIFLSHPROG 2015 07 01 Width Mode Override Parameter A 3 Related Information Flash Override Files on page 4 1 Non Standard Flash Memories Altera Corporation LJ Send Feedback Stand Alone Mode 2015 07 01 UG NIOSIIFLSHPROG GX subscribe Send Feedback B While developing hardware or software you use the Nios II Flash Programmer on a computer with the Quartus II software and the Nios II EDS 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 A stand alone version of the Nios II Flash Programmer is available for this purpose In stand alone mode the flash programmer has limited functionality You can program any type of CFI or EPCS flash memory However the elf2flash sof2flash and bin2flash utilities are not available You must create input files for the flash programmer on a computer which has the Nios II development tools fully installed Installing the Nios Il Stand Alone Flash Programmer To install the Nios II Flash Programmer in stand alone mode perform the following s
27. he Nios II Flash Programmer GUI populates with your processor selection if relevant and the information from the bsp or sopcinfo file Altera Corporation Using the Flash Programmer GUI C Send Feedback UG NIOSIIFLSHPROG 2015 07 01 Working with Flash Programmer Settings Files 2 3 Depending on your selection in step 2 your flash programmer settings may not include information about a BSP settings file A new set of flash programmer settings based on a BSP settings file includes the sopcinfo file name but a new set of flash programmer settings based on a sopcinfo file does not have information about a BSP settings file to which it corresponds In that case you must identify the bsp file explicitly The bsp file contains the information about your processor selection for example whereas the sopcinfo file knows about the available processors but not which one you selected Figure 2 2 Flash Programmer Dialog Box with Flash Programmer Settings This figure shows the flash programmer with a new set of flash programmer settings based on the sopcinfo file for a design with multiple processors and two flash memory components Flash Programmer C N2muttitutorialistandard n 2multitutorial flash settings Fie Options Help Target hardware information BSP Settings File name SOPC Information File name C N2multitutorial standard MosiI_cyclonell_2c3S_standard_sop lt sopxinfo CPU to program flash cpul Hardware connection Connection
28. his device is built in Related Information Using the Flash Programmer from the Command Line on page 3 1 For more information on using the flash programmer from the command line refer to Chapter 3 Using the Flash Programmer from the Command Line Flash Override Files To support newly released flash memory devices which might have problems in the CFI table the Nios II Flash Programmer provides the ability to override CFI table entries with flash override files A flash override file lets you manually override erroneous information in the CFI table which enables the Nios II Flash Programmer to function correctly O 2015 Altera Corporation All rights reserved ALTERA ARRIA CYCLONE ENPIRION MAX MEGACORE NIOS QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U S Patent and Trademark Office and in other countries All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www altera com common legal html Altera warrants performance ISO of its semiconductor products to current specifications in accordance with Altera s standard warranty but reserves the right to make changes to any 9001 2008 products and services at any time without notice Altera assumes no responsibility or liability arising out of the application or use of any information Registered product or service described herein except as expressly agreed to in
29. his parameter to position a Nios II executable in an EPCS EPCQ device along with an FPGA configuration For more information refer to the Program ming Both Hardware and Software into an EPCS EPCQ Device Programming Both Hardware and Software into an EPCS EPCQ Device The 5ase 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 configura tion 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 Using the Flash Programmer from the Command Line C Send Feedback Altera Corporation UG NIOSIIFLSHPROG 3 10 elf2flash Command Line Examples 2015 07 01 Convert the FPGA configuration file first using sof2flash When converting the Nios II software executable use the after parameter and specify the FPGA configuration S record file The S record output for the software executable starts at the first address unused by the FPGA configuration Refer to the second example under the elf2flash Command Line Examples chapter Note elf2flash does not insert the FPGA configuration into the output file It simply leaves space starting at offset 0x0 that is large enough for the configuration data Note In Quartus II software version 13 1 and onwards the epcs epca option in sof2flash generates flash fi
30. holders as described at www altera com common legal html Altera warrants performance ISO of its semiconductor products to current specifications in accordance with Altera s standard warranty but reserves the right to make changes to any 9001 2008 products and services at any time without notice Altera assumes no responsibility or liability arising out of the application or use of any information Registered product or service described herein except as expressly agreed to in writing by Altera Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services JANOS RYA 101 Innovation Drive San Jose CA 95134 i UG NIOSIIFLSHPROG C 2 Suggested Actions 2015 07 01 Suggested Actions e Make sure that the FPGA is running a valid flash programmer target design If not you need to configure the FPGA using the Quartus II programmer For more information refer to the Flash Programmer Target Design chapter e Ifusing the flash programmer from the command line ensure you have specified the proper aevice cable and instance parameter values Refer to Chapter 3 Using the Flash Programmer from the Command Line for details For more information refer to the Using the Flash Programmer from the Command Line chapter Related Information e Flash Programmer Target Design on page 1 3 e Using the Flash Programmer from the Comman
31. ing System which serves the same purpose Note Do not use bin2flash to convert executable software files or FPGA configuration files To convert Nios II software executable files use elf2flash To convert FPGA configuration files use sof2flash Related Information e Nios II Classic Software Developer s Handbook For more information about the Altera Zip Read Only File System refer to the Read Only Zip File System chapter in the Nios II Classic Software Developer s Handbook e Nios II Gen2 Software Developer s Handbook For more information about the Altera Zip Read Only File System refer to the Read Only Zip File System chapter in the Nios II Gen2 Software Developer s Handbook Altera Corporation Using the Flash Programmer from the Command Line C Send Feedback UG NIOSIIFLSHPROG 2015 07 01 bin2flash Parameters 3 11 bin2flash Parameters The following tables contain the General CFI EPCS and Device specific parameters for bin2flash For additional parameters type bin2flash helpata command line eem Required Offset within the flash memory location addr where the data is to be programmed input file Required Name of the input binary file being converted output file Required Name of the output file bin2flash Command Line Example 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 begin
32. ing each kind of flash memory Table 1 1 Minimum Component Set for the Flash Programmer Target Design Component CFI Only Nios II processor with JTAG debug module levell or greater Required Flash Memory to Program EPCS Only Required CFI and EPCS Required System ID peripheral Flash Memory Common Flash Interface Recommended Required Recommended Recommended Required Tristate Conduit Bridge Required Required EPCS Serial Flash Controller Required Required 0 f present a System ID Peripheral component allows the Nios II Flash Programmer to validate the target design before programming the flash memory 9 A Nios II system can interface with more than one CFI flash memory device The system must contain one Flash Memory Common Flash Interface component for each flash memory device on the board 99 Tri state Conduit Bridge is needed to drive the CFI flash memory signals Altera Corporation Overview of the Nios II Flash Programmer CJ Send Feedback UG NIOSIIFLSHPROG 2015 07 01 Figure 1 2 Example Target Design Containing the Minimum Component Set Flash Programmer Target Design 1 5 This is an example of a Qsys system with the minimum component set for a system composed of one CFI flash memory and an EPCS serial configuration device The system also includes other components which relate to the purpose of the system not to the flash programmer
33. ion is accurate 4 If your design has multiple download cables select the appropriate cable 5 If your design has multiple processors select the Nios II processor that corresponds to the CPU to program flash value under Target hardware information in the Nios II Flash Programmer dialog box 6 Click Close Related Information e Quartus II Handbook Volume 3 Verification For more information refer to the Quartus II Programmer chapter in volume 3 of the Quartus II Handbook e Flash Programmer Target Design on page 1 3 e Flash Programmer Target Design on page 1 3 Altera Corporation Using the Flash Programmer GUI C Send Feedback UG NIOSIIFLSHPROG 2015 07 01 Checking System ID and System Timestamp 2 5 Checking System ID and System Timestamp Before you begin If your flash programmer target design includes a System ID component the Nios II Flash Programmer can perform system ID and system timestamp checking before programming flash memory If the flash programmer performs system ID checking system timestamp checking or both and the expected system is not configured in the FPGA the flash programmer does not program the flash memory Note The system ID and system timestamp checking are enabled by default Altera recommends that you keep these settings and that your FPGA target design include a system ID component To disable checking for system ID or system timestamp perform the following steps 1 Click Hardware Connec
34. ios II Flash Programmer has two parts the host and the target as shown in the following figure The host portion runs on your computer It sends flash programming files and programming instructions over a download cable to the target The target portion is a hardware design running in the FPGA It accepts the programming data flash content and required information about the target flash memory device sent by the host and follows the instructions to write data to the flash memory device Figure 1 1 How the Nios Il Flash Programmer Works Host Computer Flash Flash 4 Cdntent d Download Cable e g USB Blaster Target Flash Design Memory Device Flash Programmer Target Design To use the Nios II Flash Programmer you must have a valid flash programmer target design downloaded to your board A valid target design contains a Qsys system with at least the Qsys components shown in the Minimum Component Set for the Flash Programmer Target Design table The minimum component set provides facilities for the target design to communicate with the host and to write to flash memory The minimum component set depends on the type of flash memory you intend to Overview of the Nios II Flash Programmer Altera Corporation CJ Send Feedback 1 4 Flash Programmer Target Design UG NIOSIIFLSHPROG 2015 07 01 program Minimum Component Set for the Flash Programmer Target Design lists the minimum component set for programm
35. is to be programmed epeq Required for EPCQ devices Specifies that the output is intended for an EPCQ device Device Specific Parameters e CORN NE ON activeparallel Optional Creates parallel flash contents compatible with active parallel configuration mode Only available on FPGAs which support active parallel configuration pfl Required if your FPGA Specifies that the flash programmer use the configuration uses the PFL parallel flash loader Required if your FPGA configuration uses the parallel flash loader PEL optionbit lt optionbi Required if your FPGA Specifies the option bit address in your flash taddr gt configuration uses the PFL memory device When you use this option the sof2flash command generates both a flash file and a map flash file When you program the flash memory with the map flash file it overwrites the default option bits In almost all cases the default option bits are appropriate and you should not program this file to flash Related Information AN386 Using the Parallel Flash Loader with the Quartus II 0D From Nios II EDS 13 1 onwards the epcq option is required for V series devices and above to program an EPCQ device 02 Using the pf1 and optionbits command line options slows down sof2flash generation noticeably For more information about when to use the pf1 and optionbits command line options refer to AN386 Using the Parallel Flash Loader
36. le with a SOF header which contains the SOF length This change is required for V series devices and above for new SOF format and to allow for future SOF format variations The Nios II bootcopier loads the Nios II software executable from EPCS EPCQ devices based on the SOF length For more information about how to program EPCS EPCQ devices refer to the KDB Solution rd11192013 118 webpage Related Information e elf2flash Command Line Examples on page 3 10 e KDB Solution rd11192013 118 elf2flash Command Line Examples e Converts myapp elf to an S record file named myapp flash intended for a CFI flash memory based at 0x0 Includes a boot copier from boot loader cfi srec which is required in this example because base and reset are equal elf2flash base 0x0 reset 0x0 boot boot_loader_cfi srec input myapp elf output myapp flash e Converts myapp elf to an S record file named myapp flash intended for an EPCS device The S record output starts at the first address unused by standard flash elf2flash pcs after standard flash input myapp elf output myapp flash bin2flash The bin2flash utility converts an arbitrary file to an S record file suitable for use by the flash programmer You can use bin2flash to convert read only binary data needed by a Nios II program such as software configuration tables Depending on your application you might find it more convenient to use the Altera Read Only Zip Fil
37. memory from the input files Throws away partial sector data If the data to program does not completely fill the first or last sector the flash programmer normally preserves and reprograms the original data in those sectors The no keep nearby parameter disables this feature This option speeds up the program ming process but is only appropriate if the existing flash memory contents are unimportant verify Optional defaults off Verifies that contents of flash memory match input files file Optional Specifies the name s of the input file s to program or verify Separate multiple file names with spaces read file Optional defaults off Reads flash memory contents into the specified file read bytes start Optional if read is specified size defaults off Specifies which address range to read byte addresses 19 In system h and in your BSP the system ID time stamp is specified by SYSID TIMESTAMP Altera Corporation Using the Flash Programmer from the Command Line C Send Feedback UG NIOSIIFLSHPROG 2015 07 01 Required Optional defaults off CFI Parameters 3 5 Description Runs the processor from its reset vector after flash memory programming is complete CFI Parameters ENERO CK EE 7 OR NN Prints debug information including the debug Optional defaults off flash memory s query table base address R
38. n is copied from EPCQ flash to RAM using a boot copier For more information about how to build a bootable system from EPCS and device eram for a Nios II processor application refer to AN736 Nios II Processor Booting From Altera Serial Flash EPCQ Note In this document the term flash memory refers to both CFI and EPCS memory devices unless otherwise noted Related Information AN736 Nios II Processor Booting From Altera Serial Flash EPCQ 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 documents e Nios II Hardware Development Tutorial e Getting Started with the Graphical User Interface chapter of the Nios II Gen2 Software Developer s Handbook If you use the Nios II Flash Programmer to program FPGA configuration data to flash memory you also must understand the configuration method used on the board For more information refer to AN346 Using the Nios II Configuration Controller Reference Designs or to the reference manual for your specific Altera development board Related Information e Nios II Gen2 Hardware Development Tutorial e Nios II Gen2 Software Developer s Handbook For more information refer to the Getting Started with the Graphical User Interface chapter of the Nios II Gen2 Software Developer s Handbook Using the Nios II Configuration Controller Reference Designs Nios Il
39. ncvannes 2 5 Using the Flash Programmer from the Command Line 3 1 io 2 flash program ro ONU 3 2 nios2 flash programmer Parameters o oit tntia paint De ul se dala o onn deo ada 3 2 nios2 flash programmer Command Line Examples eee 3 6 SI PATENT cT TRIN 3 6 sof2flash PAL AGO jr D 3 6 sof2flash Command Line Examples eni teen nt qa dp cR EUH LEM EX o te 3 8 IIVAICT MTM T 3 8 BE flash Paramete tS aoo decedente edu ed eral od Puts cri erp dicnnt pee 3 8 Programming Both Hardware and Software into an EPCS EPCQ Deevice 3 9 eli flash Command Line Examples enar prete a oca uta lc er nd ee Mo qct 3 10 pL M 3 10 Din2flash Parameters d dao mede niacin tan dna dando NOR Da A EES 3 11 bin2flash Command Line Bxariple us uieue ak Vera S RT ORIU EDEN ENS Evip i Semmens 3 11 Non Stanidard Flash Memories isscsisesssssissicenssessiecssiatecuusctvcsuseusoucdeessistudieveaddaves A 1 Built in Recognition and Ovetrida iu sodas en t ek Eni ilie agb ARR nap ist sak riks rss iR E Ku A 1 Fl sh Override ui C are dunes ER E a E T aa A 1 Flash yerride File funu ri asiain iaae TAEAE iS A 2 Howto Use the Flash Override Pile useu ot RU DIU a DI GI EM MEDIE A 2 Width Mode Override Parameter sissiasistsasssssssssnscussssusavensdeiestnivansadtovhaacsnietsnsusasesasnsssestsvensdadav
40. ning of flash memory bin2flash location 0x40000 input data bin output data flash Using the Flash Programmer from the Command Line Altera Corporation LJ Send Feedback Non Standard Flash Memories 2015 07 01 UG NIOSIIFLSHPROG GX subscribe C Send Feedback This section covers advanced topics to support non standard CFI flash memory To use the procedures in this section you need the data sheet for the flash memory device you are using Make sure you fully understand the CFI aspects of the device Some CFI flash memory devices contain missing or incorrect CFI table information In such cases the Nios II Flash Programmer might fail based on the erroneous information in the CFI table For these devices the Nios II Flash Programmer provides the following methods to override the CFI table and successfully program flash memory e Built in recognition and override e Flash override files e Width mode override Built in Recognition and Override The Nios II Flash Programmer contains code to recognize some devices with known CFI table problems On these devices it overrides the incorrect table entries Always try using built in recognition and override before trying to create an override file To determine whether the flash programmer recognizes the device run the flash programmer from the command line with the debug option If the flash programmer overrides the CFI table the flash programmer displays a message Override data for t
41. ommon legal html Altera warrants performance ISO of its semiconductor products to current specifications in accordance with Altera s standard warranty but reserves the right to make changes to any 9001 2008 products and services at any time without notice Altera assumes no responsibility or liability arising out of the application or use of any information Registered product or service described herein except as expressly agreed to in writing by Altera Altera customers are advised to obtain the latest version of device specifications before relying on any published information and before placing orders for products or services JANOS RYA 101 Innovation Drive San Jose CA 95134 UG NIOSIIFLSHPROG D 2 Document Revision History for Nios Il Flash Programmer User Guide 2015 07 01 ENLIENNER REM cH May 2007 November 2006 1 4 1 3 In chapter 1 removed mention of board description files no longer implemented In chapter 1 corrected and updated discussion of instance and device command line parameters In chapter 1 updated SOPC Builder screen shot In chapter 3 added descriptions of nios2 flash programmer options sidp id timestamp accept bad sysid In appendix C corrected missing installation step In appendix C removed mention of board description files no longer implemented Updates for the Nios II version 6 1 release Includes improvements to the flash programmer user interface October 2005
42. ory before writing each flash file to it e Run From Reset After Programming Runs the processor from its reset vector after flash memory programming is complete 2 To specify the directories where you want the flash programmer to store the generated flash files and script click Staging Directories in the Options menu and specify the script and flash files directory paths 3 On the tab for the flash memory device you wish to target under Files for flash conversion click Add The Nios II Flash Programmer adds the file to the Files for flash conversion list and derives the flash offset from the file Depending on your current Options settings the File generation command and File programming command boxes populate with the command line commands that generate the flash file and program it to your flash memory respectively providing a convenient way to learn about the command line utilities 4 If you wish to pass any additional arguments to the file generation command under File generation command click Properties 5 If necessary edit the Conversion Type settings for the files listed in the Files for flash conversion table by clicking the relevant table cells Allowed conversion types are ELF SOF and BINARY 6 If necessary edit the Flash Offset settings for the files listed in the Files for flash conversion table by double clicking the relevant table cells Note Do not specify a flash offset for files of conversion type ELF 7
43. ponent elf2flash uses this parameter with end and reset to determine whether the system requires a boot copier end lt addr gt 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 e The processor s reset address falls within the address range of the flash memory being programmed e 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 lt Nios II EDS install path gt components altera nios2 boot loader cfi srec EPCS Parameters EE CREER CK EE 7 CON 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 t
44. program the EPCS device directly via a JTAG download cable and verify that the EPCS device successfully configures the FPGA e Run nios2 flash programmer from the command line with the epcs parameter This command displays information about the flash memory in the EPCS device For more information refer to the Using the Flash Programmer from the Command Line chapter Related Information Using the Flash Programmer from the Command Line on page 3 1 System Does Not Have Any Flash Memory Error When you run the flash programmer you get the error The Qsys system does not have any flash memory Probable Cause The FPGA is not currently configured with a valid flash programmer target design Suggested Actions If practical upgrade your FPGA design to meet the criteria for a flash programmer target design For more information refer to the Flash Programmer Target Design chapter Related Information Flash Programmer Target Design on page 1 3 Reading System ID at Address Ox address FAIL Error When you run the Nios II Flash Programmer GUI you get the error Reading System ID at address Ox address FAIL Troubleshooting Altera Corporation LJ Send Feedback UG NIOSIIFLSHPROG C 4 Probable Cause 2015 07 01 Probable Cause The FPGA is not currently configured with the target design that corresponds to the BSP project for the software application in the Nios II Software Build Tools for Eclipse Suggested Actions
45. r programming flash memory sidp address Optional required for system Contains the base address of the System ID ID validation component in your system This value is in hexadecimal format for example 0x01000000 id id Optional required for system Contains the ID value programmed into the ID validation System ID component in your system This value is randomly selected each time you regenerate your Qsys system This value is in unsigned decimal format for example 2056847728u 5 6 7 8 9 T m The cable parameter is only needed if there are multiple download cables connected to the host computer To determine the cable names run jtagconfig The aevice 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 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 For more information refer to the Using the Flash Programmer GUI chapter Alternatively open Quartus II project name gt jdi in the Quartus II project directory Locate the Nios II processor node by finding a value of hpath containing lt processor module name gt The instance ID is specified as instance id In system h and in your board support package BSP the system
46. refer to the Getting Started from the Command Line chapter in the Nios II Gen2 Software Developer s Handbook nios2 flash programmer The nios2 flash programmer utility programs a preformatted file into a specified flash memory The input is an industry standard S record file normally created by one of the conversion utilities sof2flash elf2flash or bin2flash nios2 flash programmer can use any 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 Flash Programmer GUI creates flash programmer files with a flash extension The nios2 flash programmer utility is capable of programming erasing or reading from any CF compatible flash memory or EPCS EPCQ serial configuration device in the hardware target design The nios2 flash programmer command line syntax is as follows nios2 flash programmer help cable lt cablename gt device device index gt instance lt instance gt sidp lt address gt id lt id gt timestamp lt time gt accept bad sysid base lt address gt pcs lt file gt go Note Before you can program flash memory on your board you must configure your FPGA with a flash programmer target design that contains at least the minimum component set specified in the Minimum Component Set for the Flash Programmer Target Design table located in the Flash Programmer Tar
47. rogrammer base 0x200000 read current srec read bytes 0 0x10000 e Erases address range 0x8000 to 0x10000 in CFI flash memory based at address 0x200000 nios2 flash programmer base 0x200000 erase 0x8000 0x10000 e Queries CFI flash memory based at address 0x200000 and reports the result This command dumps the flash memory s query table nios2 flash programmer base 0x200000 debug sof2flash The sof2flash utility takes an SRAM Object File and translates it to an S record file suitable for programming into flash memory sof2flash Parameters The following tables contain the General CFI EPCS and Device specific parameters for sof2flash For additional parameters type so 2 1ash helpata command line General Parameters P me reaa pec compress Optional Turns on compression Available for Cyclone II Cyclone III Stratix II and Stratix III devices input file Required Name of the input SRAM Object File output file Required Name of the output file CFI Parameters a OHNE ON offset addr Required Offset within the flash memory device where the FPGA configuration is to be programmed Altera Corporation Using the Flash Programmer from the Command Line C Send Feedback UG NIOSIIFLSHPROG 2015 07 01 EPCS Parameters 3 7 EPCS Parameters SO EE C NN epcs Required for EPCS devices Offset within the flash memory device defaults off where the FPGA configuration
48. s II Flash Programmer GUI even after a flash programmer configuration is opened the Start button appears grayed out Probable Cause You have not fully specified the required parameters for programming flash memory Suggested Actions e Check the Problems tab for any information about what may be missing or incorrect e Make sure that your JTAG cable settings are correct Specify the connection in the Hardware Connections dialog box by clicking Refresh Connections and Resolve Names and selecting the Nios II processor that matches the value in CPU to program flash e Make sure that you have selected a file to program to the flash memory and that it appears with the correct Conversion Type and Flash Offset values No Nios II Processors Available Error When you run the flash programmer you get the error There are no Nios II processors available which match the values specified Please check that your PLD is correctly configured downloading a new sof file if necessary Probable Cause The flash programmer is unable to connect with a Nios II JTAG debug module inside the FPGA O 2015 Altera Corporation All rights reserved ALTERA ARRIA CYCLONE ENPIRION MAX MEGACORE NIOS QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U S Patent and Trademark Office and in other countries All other words and logos identified as trademarks or service marks are the property of their respective
49. sh programmer command line syntax The GUI generated script is particularly helpful if you need to use the instance parameter listed in the xref table After you successfully program flash memory using the Nios II Flash Programmer GUI you can find the flash programmer script in the directory you specified in the Staging Directories dialog box available on the Options menu The flash programmer script is a file named flash programmer sh Table 3 1 Flash Programmer Command Line Utilities nios2 flash programmer Programs an S record file into flash memory Can also read back data verify data provide debug information about the flash chip and more sof2flash Converts an SRAM Object File sof 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 The main utility for programming flash memory from the command line is nios2 flash programmer It requires industry standard S record input files These utilities ensure that the input is compatible with the Nios II Flash Programmer Input file names for all utilities must include an explicit extension such as elf or flash When you launch the Nios II Command Shell in a Windows operating system the flash programmer utilities are available in your default search path O 2015 Altera Corporation All rights reserved ALTERA ARRIA CYCLONE ENPIRION MA
50. t download cable device and processor to program flash memory If your system has only a single download cable and a single processor the process is simple This section describes all the steps for a system with multiple download cables processors and devices Before you can program flash memory on your board you must configure your FPGA with a flash programmer target design that contains at least the minimum component set specified in the Minimum Component Set for the Flash Programmer Target Design table in the Flash Programmer Target Design chapter Note For instructions to configure the FPGA refer to the Quartus II Programmer chapter in volume 3 of the Quartus II Handbook After you load the target design on your FPGA you can set the hardware connection for programming flash memory To set the Hardware Connection perform the following steps 1 Click Hardware Connections The Hardware Connections dialog box appears 2 In the Hardware Connections dialog box click Refresh Connections 3 If you are reusing an flash settings file and the Quartus II project has been recompiled since the flash settings file was created or the Name column entries in the Processors list are blank perform the following steps a Under JTAG Debugging Information File name browse to locate your project JTAG Debugging Information File jdi b Click Resolve Names The flash programmer uses the jdi file to ensure the available connection informat
51. t hardware information BSP Settings File name SOPC Information File name CPU to program flash Hardware connection Nios Il Flash Programmer This tool is the GUI version of the command line tool nios2 flash programmer generate It parses a SOPC Information File or Board Support Package BSP Settings File and dynamically creates a tab for each flash device found Each Flash tab allows multiple files to be added to a list for eventual conversion to flash and programming to its target flash device Use the File gt New menu item from the top level menu bar to create a new flash settings project or open an existing project using the File gt Open menu item M Information Problems Processing Specifying your Flash Programmer Settings Before you begin Before writing data to flash memory you must determine the flash programmer settings To create a new set of flash programmer settings complete the following steps 1 On the File menu click New The New Flash Programmer Settings File dialog box appears 2 Select Get flash programmer system details from BSP Settings File or Get flash programmer system details from SOPC Information File 3 Browse to locate your BSP Settings File bsp or SOPC Information File sopcinfo 4 For a multiprocessor system select the processor If you specify a bsp file the processor is already specified 5 Click OK The New Flash Programmer Settings File dialog box closes and t
52. teps 1 Install the Quartus II Stand Alone Programmer from the Quartus II CD The nios2 flash programmer utility requires the Quartus II Stand Alone Programmer to access the JTAG chain on the board 2 Ona computer which has the Nios II EDS fully installed find the executable file lt Nios II EDS install path gt bin nios2 flash programmer exe 3 On the stand alone computer copy nios2 flash programmer exe to the directory lt Quartus II Stand Alone Programmer Path gt bin 4 On the computer with the full Nios II EDS installation find the Windows library file c cygwin bin cygwinl dll If you install cygwin separately from the Nios II EDS your cygwin DLLs might reside in a different directory 5 On the stand alone computer copy cygwinl dll into c cygwin bin or the equivalent path based on the cygwin installation Running the Nios Il Stand Alone Flash Programmer To run the Nios II Flash Programmer in stand alone mode perform the following steps 1 Open a command prompt on the stand alone computer Change directories to the location of the files you wish to program into flash memory 2 Run the nios2 flash programmer utility as described in the Using the Flash Programmer from the Command Line chapter O 2015 Altera Corporation All rights reserved ALTERA ARRIA CYCLONE ENPIRION MAX MEGACORE NIOS QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U S
53. ter 3 updated the sof2flash Parameters table e In chapter 3 added the EPCQ command line example e Inchapter 3 updated the elf2flash Parameters table e Inchapter 3 added a note about how to program EPCS EPCQ devices e Replaced SOPC Builder with Qsys e Replaced EPCS with EPCS EPCQ February 2010 2 1 Documented the two sof2flash options p 1 and optionbit January 2010 2 0 e Documented the new Nios II Flash Programmer GUI e Revised entire document to use Nios II Software Build Tools for Eclipse instead of Nios II IDE e Removed out of date list of tested flash memory devices May 2008 1 6 In chapter 3 corrected error in the sof2flash Parameters table The default mode for the compression parameter is on Compression is available for Cyclone II Cyclone III Stratix II and Stratix III devices November 2007 1 5 e In chapter 1 added note that Hardcopy II devices also support programming CFI Flash using Nios II Flash programmer e In chapter 3 documented command line support for active parallel configuration 2015 Altera Corporation All rights reserved ALTERA ARRIA CYCLONE ENPIRION MAX MEGACORE NIOS QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U S Patent and Trademark Office and in other countries All other words and logos identified as trademarks or service marks are the property of their respective holders as described at www altera com c
54. tions The Hardware Connections dialog box appears 2 To disable system ID checking turn on Ignore mismatched system ID 3 To disable system timestamp checking turn on Ignore mismatched system timestamp 4 Click Close After the hardware connections are set you can confirm system ID and system timestamp matching by performing the following steps 1 Click Hardware Connections 2 In the Hardware Connections dialog box click System ID Properties 3 Check that the Expected system ID and Actual system ID values match and that the Expected system timestamp and Actual system timestamp values match 4 In the System ID Properties dialog box click Close 5 In the Hardware Connections dialog box click Close For additional information about the system ID and system timestamp refer to the General Parameters table in the nios2 flash programmer Parameters chapter Regardless of the System ID component values you cannot program flash memory if the hardware design configured in the FPGA is not a valid flash programmer target design that contains at least the minimum component set specified in the Minimum Component Set for the Flash Programmer Target Design table in the Flash Programmer Target Design chapter Related Information nios2 flash programmer Parameters on page 3 2 Generating Flash Files and Programming Flash Memory The Nios II Flash Programmer can generate flash files program the flash memory with a flash file or
Download Pdf Manuals
Related Search
Related Contents
方也工己免 日月 由 Met One 6000 Partikelzähler P20 WIN User Manual: Agency Administrator (Data Steward) User Manual - TPC Advanced Technology User Manual Provision-ISR DX-372CS Samsung DVD-C550 Manuel de l'utilisateur CFW500 - Manual de Programação Origin Storage Dell Notebook KBD - PWS4300 Sanyo DS27530 User's Manual Copyright © All rights reserved.
Failed to retrieve file