Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12600 Discussions

nios2-flash-programmer and Version 4.2

Altera_Forum
Honored Contributor II
1,721 Views

Hello  

 

I have troubles flashing a file with nios2-flash-programmer. The installed versions are:  

 

- Quartus Version 4.2 with service pack 1 installed 

- Altera SOPC Builder 4.2 Build 178 

 

I have developed a Nios-Board myself. All the things seems to work. I work with legacy mode. Unfortunately I have flashed a programm with GERMS. After each power up or reset the program runs. I can't interrupt it or download a new one with debugger or GERMS. I tried to flash another programm with nios2-flash-programmer but can't do it. I did make the steps like shown in ug_nios2_flash_programer.pdf. I'm running out of ideas... 

 

--Begin Printed Messages from Shell-- 

 

31.01.2006 07:47:05 com.altera.commandApplication.CmdApp fine 

FEIN: nios2-flash-programmer: nios2-flash-programmer starting 

31.01.2006 07:47:06 com.altera.commandApplication.CmdApp info 

INFO: nios2-flash-programmer: args = --log=Aufzeichung.txt --verbose --base=0x0 --erase --cable=usb-blaster --sof=D:/Projekte/Altera/Quartus_II/FPGA_Nios/FPGA_Nios_Board/system/FPGA_Nios_Board.sof 

31.01.2006 07:47:06 com.altera.commandApplication.CmdApp info 

INFO: nios2-flash-programmer: Launching Quartus Programmer to download: 

D:/Projekte/Altera/Quartus_II/FPGA_Nios/FPGA_Nios_Board/system/FPGA_Nios_Board.sof 

31.01.2006 07:47:06 com.altera.commandApplication.CmdApp fine 

FEIN: nios2-flash-programmer: Quartus Pgm launched 

31.01.2006 07:47:08 com.altera.commandApplication.CmdApp fine 

FEIN: nios2-flash-programmer: SOF programming done. exit code = 0x0000 

31.01.2006 07:47:11 com.altera.commandApplication.CmdApp severe 

SCHWERWIEGEND: nios2-flash-programmer: Error opening target hardware 

31.01.2006 07:47:11 com.altera.commandApplication.CmdApp severe 

SCHWERWIEGEND: nios2-flash-programmer: Unable to open flash-device after successfully communicating  

with target. 

It is likely that you are using a flash-programming FPGA design which 

was not created for your target board. 

 

In order to program flash, you must first create a purpose-built 

flash-programming design (i.e. FPGA configuration) and associate it with 

your particular board. The Nios development kit is delivered with purpose-built 

flash-programming designs pre-built for several development boards. If you wish 

to program flash on your own board, you must first create a flash-programming 

design. 

 

The process of creating a flash-programming design for your board is mostly 

automated. From a bash-shell, execute this script: 

 

mk_target_board --help 

 

The help-message includes references to other documentation on programming 

flash and targeting Nios systems to custom board designs. 

- exiting. 

 

--End Printed Messages from Shell-- 

 

Best regards 

 

Minu
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
336 Views

i assume that you have created a target board with mk_target_board utility if  

not refer to ug_nios2_flash_programmer.pdf paragraph 2 "creating a target board 

 

but from the massage it seems like you have done that  

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

nios2-flash-programmer:    Unable to open flash-device after successfully communicating with target.[/b] 

--- Quote End ---  

 

 

The system recognize your flash device. and can communicate with it over the controls line , but not over the address and data lines of the flash. 

this is could be because: 

1. hw problem (lines are not connected) 

2. the flash device is not working or is not CFI compliant 

3. OR THE just because the address line are not align as should be. 

 

i believe this is option 3.  

when you work with 32 data bit and your flash device support also 8 bit data the sopc will generate address according to the 8 bit data configuration. 

and you should ignore the 2 LSB. 

 

for example let say you have a flash that can hold only 2 word of 32 bits 

for that you will need 2 address, address 1 refer to word 1 , address 2 refer to word 2 

to access 2 address you need an address bus with size of 1 

but the sopc will generate a bus of size 3  

this is because it treat your flash as an 8 bit data meaning it have 8 (2*32/8=8) words of 8 bits instaed of 2 and so he think that you need 8 address  

what you should do is use only the MSB and ignore the 2 LSB
0 Kudos
Altera_Forum
Honored Contributor II
336 Views

Thank you for your answers. 

 

Like you assumed I made my target board with mk_target_board utility. After that I added a default Flash (AMD29LV065D-120R like on the cyclon eval. boards) and after assigned the pins in Quartus SOPC builder. I made all the steps like described in the ug_nios2_flash_programmer.pdf. 

 

Now I did test your suggestion. Based on the default Flash (AMD29LV065D-120R) I had to define 2 more address lines to get a[24..0] (so the flash have 64MB instead 8MB). After I connected the address lines a[24..2] to the flash. But the messages were the same.  

 

Do you know if the versions 4.2 works? 

 

Do you have any other idea?
0 Kudos
Altera_Forum
Honored Contributor II
336 Views

version 4.2 have lots of problem with the flash programmer. 

it&#39;s better to move to 5.1 

 

i&#39;m sorry if i was miss understood but i didn&#39;t ment that you should create 2 more lines. i ment that you should ignore 2 lines.  

 

but any way AMD29LV065D-120R is an 8MB with 8 bit data and so there shouldn&#39;t be a problem of miss alignmnet. have you made any changes to its settings??? 

what is your data width????? 

 

if you would have used AMD29LV128M-123R you would have seen this problem.  

 

 

if you have made any changes to the AMD29LV065D-120R then i&#39;m sorry , no more idea
0 Kudos
Altera_Forum
Honored Contributor II
336 Views

The 2 lines I had to create because of not leave floating 2 lines of the flash. But if it would have worked I would have been very surprised. Normally the Avalon bus handels this. 

 

I work with Version 4.2 because of using the plugs library of Altera (SDK support).  

 

As soon as there is a TCP/IP stack running without RTOS I will make a change to the new versions and work with Nios II IDE.  

 

I did not make any changes to the AMD29LV065D-120R.  

 

If the nios2-flash-programmer does not work with the version 4.2 I have to use the old tools to flash a program.
0 Kudos
Reply