Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17268 Discussions

NIOSII *** Stand-alone*** flash programmer

Altera_Forum
Honored Contributor II
3,221 Views

Hi, I am trying to get "nios ii stand-alone flash programmer" work in Windows. 

 

I follow the Altera "NiosII flash programmer guide" :  

--- Quote Start ---  

nstalling the Nios II Stand-Alone Flash Programmer 

To install the Nios II Flash Programmer in stand-alone mode, perform the following 

steps: 

1. install the quartus ii stand-alone programmer from the Quartus II CD. the 

nios2-flash-programmer utility requires the quartus ii stand-aloneprogrammer 

to access the jtag chain on the board. 

--- Quote End ---  

 

OK. We can also download 123MB from Altera website. 

I notice that installer first decompress the files and then copy them to destination. So, 200% disk space needed 

installation quartus ii stand alone flash programmer (version 12.0sp1) takes 860 mo (not well mentioned in documents). 

 

 

--- Quote Start ---  

 

2. On a computer which has the Nios II EDS fully installed, find the executable file 

<Nios II EDS install path>/bin/nios2-flash-programmer.exe. 

3. On the stand-alone computer, copy nios2-flash-programmer.exe to the directory 

<quartus ii stand-alone programmer path>/bin

--- Quote End ---  

 

WELL, I just copy nios2-flash-programmer.exe to my standalone directory (of the stand-alone computer) 

 

 

--- Quote Start ---  

4. On the computer with the full Nios II EDS installation, find the Windows library 

file c:/cygwin/bin/cygwin1.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 cygwin1.dll into c:/cygwin/bin (or the 

equivalent path, based on the cygwin installation)

--- Quote End ---  

 

cygwin installation ? not found 

WELL I just copy cygwin1.dll to my standalone directory (of the stand-alone computer) 

 

 

If all files (my_SW_project.flash, nios2-flash-programmer.exe, cygwin1.dll) are located in <Quartus II Stand-Alone Programmer Path>/bin. Nios2-flash-programmer seems to work fine. But it is an ugly solution. 

 

To make nios2-flash-progammer work fine, I have to :  

* manually append <quartus ii stand-alone programmer path>/bin to path environment  

* OR search by hand <not_automatically_known_Quartus II Stand-Alone Programmer Path>/bin and pass my_SW_project.flash by using "d:\complicated_path_to_my_SW_flash\.....

 

I also use nio2-flash-programmer for other purpose. So It will be greatfull if Quartus II Stand-Alone Programmer installer updates the PATH environment (or equivalent) 

 

Have you experienced Nios II standalone flash programmer ?
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
2,134 Views

Hi, I am also trying to get "Nios II stand-alone flash programmer" work in Windows. 

But I cannot be successful. 

 

I do same thing as you about 5 intalling steps. And then I do not know how to do about next Run 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 thenios2-flash-programmerutility as described inChapter 3, Using the Flash 

Programmer from the Command Line. 

 

My qestion: 

a. How to open "a command prompt"? 

 

b. Is "a command prompt" the Nios II Command Shell? if yes, where is it ? 

 

Thanks.
0 Kudos
Altera_Forum
Honored Contributor II
2,134 Views

Hi 

a) How to open "a command prompt"? 

In Windows, Do Start menu > execute > "cmd". 

 

b) Is "a command prompt" the Nios II Command Shell? if yes, where is it ? 

In a stand alone installation, I think NO. 

ELSE it would be something like "C:\altera\12.0sp1\nios2eds\Nios II Command Shell.bat" 

 

EDIT :  

For Nios II programmer, you need to copy  

cygwin1.dll 

nios2-flash-programmer.exe 

 

from a full quartus + nios installation 

 

 

It is complex and the whole takes over 800 MBytes ! for a standalone.
0 Kudos
Altera_Forum
Honored Contributor II
2,134 Views

Thanks, it can work well. 

 

After open the cmd.exe, I run 3 commands to program to EPCS on a stand-alone computer.  

1.//Location of nios2-flash-programmer.exe 

cd "C:\altera\91sp2\qprogrammer\bin

 

 

2.//program .flash of sof2flash. 

nios2-flash-programmer "D:/C_epcs.flash" --base=0x81800 --epcs --id=0x1C53A879 --timestamp=1395209813 --device=1 --program --verbose 

 

 

3.//program .flash of elf2flash. 

nios2-flash-programmer "D:/C_SOPC_epcs.flash" --base=0x81800 --epcs --id=0x1C53A879 --timestamp=1395209813 --device=1 --program --verbose 

 

Some picture as follow: 

https://www.alteraforum.com/forum/attachment.php?attachmentid=8677  

And I find some errors like: 

Initial values: ......... 

Not here: reserved fields are non-zero. 

 

I donot kown why.
0 Kudos
Altera_Forum
Honored Contributor II
2,134 Views

You say you have 2 files to download to EPCS, don't you ? 

C_epcs.flash to configure the FPGA 

and C_SOPC_epcs.flash is your embedded NIOS II program. 

 

BUT you try to write the both at the same address in EPCS. 

 

Your FPGA configuration C_epcs.flash whould be at address 0x00 

Your embedded software should be located after the FPGA configuration. 

 

look at documentation of nios2-programmer, flash to epcs converter, generation of .pof file (specially to epcs)... They describe how to insert software program after the FPGA configuration.
0 Kudos
Altera_Forum
Honored Contributor II
2,134 Views

 

--- Quote Start ---  

 

 

Hi, I know what you say. Embedded software should be located after the FPGA configuration. 

 

The 2 files downloaded to EPCS is from the directory "You nois profect\flash" and they are generated when downloading to EPCS by flash programmer in Nios II SBT for Eclipse. 

 

The first file is generated by the command "$SOPC_KIT_NIOS2/bin/sof2flash --input="D:/.../C.sof" --output="D:/.../flash/c.flash" --epcs --verbose". 

The second file is generated by the command "$SOPC_KIT_NIOS2/bin/elf2flash --input="D:/.../software/C_SOPC/C_SOPC.elf" --output="D:/.../flash/c_sopc.flash" --epcs --after="D:/.../flash/C.flash" --verbose ". 

Refer to the description of "flash_programmer.sh" for the two commands above, paragraph 4 in page 3-1 of documentation "Nios II Flash Programmer User Guide.pdf (2010)".  

 

You can see "--after="D:/.../flash/c.flash"". So it is OK when downloading the "c_sopc.flash" after downloading "c.flash". 

 

The way I used is not convenient, I must make sure the directory of two .flash files. My workmate suggest editing the tree commands to a bat file, but I know few about bat file. 

 

My qestion: 

My operation about CMD is in# 4 floor. Please share your operation about CMD. Do you just program 1 file by CMD? what is your file programmed&#65311; where is it?
0 Kudos
Altera_Forum
Honored Contributor II
2,134 Views

I don't understand you question. 

 

bat files are files written in batch. they are script files for ms dos and windows similar to .sh .bash .dash for Linux, but a little reduced. 

CMD files are very similar to BATCH. 

 

After you can double clic on it to launch the script. 

 

rem : the "tree" commands :-) 

 

You have to generate the .flash (and/or .pof) only once on the development computer. 

On the standalone computer, just use this flash file. 

 

 

to resume at minimum, the batch files are a sequence of commands 

keep in mind that there are differnences from the nios shell :  

in directory paths change "/" to "\" 

replace "$xxxx" by "%xxxx%" 

 

 

 

To make the world easy, put the .flash and the .bat in the same directory. 

For you, the bat file could be : 

 

REM This line is a comment REM Be ware about the dir separator, it must be "\" (antislash) on Windows nios2-flash-programmer "C_SOPC_epcs.flash" --base=0x81800 --epcs --id=0x1C53A879 --timestamp=1395209813 --device=1 --program --verbose REM Make a pause so as the user to check if all is OK pause  

 

Your antivirus/Windows may warn you when you try to launch the bat.
0 Kudos
Reply