Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
21608 Discussions

NIOS II flash programmer

Altera_Forum
Honored Contributor II
2,200 Views

Hi, 

I have build a custom board with EP3C16Q240 having M25P16 [Nymonix 16Mb] serial flash device to store my FPGA configuration data & Program data. 

 

After building the .sof and .elf when I tried to program the device through NIOS II IDE flash programmer, I am getting the following error. 

 

 

 

# !/bin/sh 

#  

# This file was automatically generated by the Nios II IDE Flash Programmer. 

#  

# It will be overwritten when the flash programmer options change. 

#  

 

cd C:/DVC_BOOT_HW/dvc_final_jan12/jan3_sdram_onchip/jan3_sdram_onchip/software/dvc_boot_sw/Debug 

 

# Creating .flash file for the FPGA configuration 

"$SOPC_KIT_NIOS2/bin/sof2flash" --epcs --input="C:/jaga_test_jan13_night/dvc_final_jan12/dvc_final_jan12/jan3_sdram_onchip/jan3_sdram_onchip/nios_sdram_onchip.sof" --output="nios_sdram_onchip.flash"  

Info: ******************************************************************* 

Info: Running Quartus II Convert_programming_file 

Info: Command: quartus_cpf --no_banner --convert --device=EPCS128 --option=nios_sdram_onchip.opt C:/jaga_test_jan13_night/dvc_final_jan12/dvc_final_jan12/jan3_sdram_onchip/jan3_sdram_onchip/nios_sdram_onchip.sof nios_sdram_onchip.pof 

Info: Quartus II Convert_programming_file was successful. 0 errors, 0 warnings 

Info: Peak virtual memory: 70 megabytes 

Info: Processing ended: Wed Jan 13 20:50:06 2010 

Info: Elapsed time: 00:00:03 

Info: Total CPU time (on all processors): 00:00:02 

Info: ******************************************************************* 

Info: Running Quartus II Convert_programming_file 

Info: Command: quartus_cpf --no_banner --convert nios_sdram_onchip.pof nios_sdram_onchip.rpd 

Info: Quartus II Convert_programming_file was successful. 0 errors, 0 warnings 

Info: Peak virtual memory: 68 megabytes 

Info: Processing ended: Wed Jan 13 20:50:10 2010 

Info: Elapsed time: 00:00:04 

Info: Total CPU time (on all processors): 00:00:03 

 

# Programming flash with the FPGA configuration 

"$SOPC_KIT_NIOS2/bin/nios2-flash-programmer" --epcs --base=0x04001800 --cable='USB-Blaster [USB-0]' --instance=0 "nios_sdram_onchip.flash" 

Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 

Resetting and pausing target processor: OK 

No EPCS layout data - looking for section [EPCS-FF] 

Unable to use EPCS device 

Leaving target processor paused 

 

# Creating .flash file for the datafile 

"$SOPC_KIT_NIOS2/bin/bin2flash" --base=0x04001800 --location=0x80000 --input="dvc_boot_sw.elf" --output="dvc_boot_sw.flash" 

 

# Programming flash with the datafile 

"$SOPC_KIT_NIOS2/bin/nios2-flash-programmer" --epcs --base=0x04001800 --cable='USB-Blaster [USB-0]' --instance=0 "dvc_boot_sw.flash" 

Using cable "USB-Blaster [USB-0]", device 1, instance 0x00 

Resetting and pausing target processor: OK 

No EPCS layout data - looking for section [EPCS-FF] 

Unable to use EPCS device 

Leaving target processor paused 

 

 

Please help me in fixing this issue
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
1,246 Views

Well I'm trying to find it on the forum but it seems to me there is a file that you have to add somewhere that specifies the structure of your flash device so the nios2-flash-programmer knows what to do with it. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
1,246 Views

you will need to create a text file that includes the missing informations. 

 

<nios2_install>/bin/nios2-flash-override.txt 

 

and inside this file you include the informations like this example 

 

 

--- Quote Start ---  

[EPCS-010216]# EPCS64N (Spansion-lead-free) S25FL064A0LMFI001 

sector_size = 65536 

sector_count = 128 

--- Quote End ---  

 

 

The Spansion datasheet for this device says 

Manufacture Identification 01h 

Memory Type 02h 

Memory Capacity 16h 

 

putting all these informations together delivers 010216 

 

so you will need to look into the datasheet of your device and find the require informations and created the file. 

 

BTW: too bad that the nios forum has lost so many postings, there was a realy complete override file and i remember that epcs device was already listed ...
0 Kudos
Altera_Forum
Honored Contributor II
1,245 Views

Hi, 

 

I have added the following in nios2-flash-override.txt to the directory C:\altera\90\nios2eds\bin 

 

[EPCS-202015]# NUMONYX (Numonyx-lead-free) M25P16-VP 

sector_size = 65536 

sector_count = 32 

 

I am getting the same error. 

 

I have attached the data sheet of M25P16. Am I missing something ?  

 

Regards, 

Jagadeesh.B
0 Kudos
Altera_Forum
Honored Contributor II
1,245 Views

your entry seems to be correct. 

 

if you run the nios2-flash-programmer, does it print out that it is reading / using this file ?  

maybe you need to add the --debug oder --verbose option, see the help dialog what option it is i can't remember right out of my head. 

 

if you still get the same message, check your epcs <-> fpga connection. 

do you have the chance to verify with an altera epcs device ? just to see that everything else is correct and the source of this problem is related to your device and or the override file.
0 Kudos
Altera_Forum
Honored Contributor II
1,245 Views

Hi, 

 

I have set the MSEL pin to JTAG mode while programming the serial flash,So I got the above mentioned error. 

When I set MSEL to AS configuration and program the serial flash,I could program it with NIOS II flash programmer.
0 Kudos
Reply