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++

EPCS BOOT

Altera_Forum
Honored Contributor II
1,003 Views

I have read carefully about nios2_flash_programmer but I still can not make the EPCS boot. Following is the programmer.sh which flash_programmer generate automaticly: 

 

==================================== 

$SOPC_KIT_NIOS2/bin/sof2flash --flash=U59 --offset=0x0 --epcs --input=E:/backup/standard_e/standard.sof --output=standard.flash 

 

$SOPC_KIT_NIOS2/bin/nios2-flash-programmer --input=standard.flash --sof=$SOPC_KIT_NIOS2/components/altera_nios_dev_board_cyclone_1c20/system/altera_nios_dev_board_cyclone_1c20.sof --epcs 

 

$SOPC_KIT_NIOS2/bin/elf2flash --flash=U59 --epcs --base=0x0 --end=0x7fffffff --input=hello_led_2.elf --output=epcs_controller.flash --boot=$SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_epcs.srec 

 

$SOPC_KIT_NIOS2/bin/nios2-flash-programmer --input=epcs_controller.flash --sof=__NO_SOF_PLEASE__ --epcs 

 

$SOPC_KIT_NIOS2/bin/elf2flash --flash=U5 --base=0x00000000 --end=0x800000 --reset=0x2100000 --input=hello_led_2.elf --output=ext_flash.flash --boot=$SOPC_KIT_NIOS2/components/altera_nios2/boot_loader_cfi.srec 

 

$SOPC_KIT_NIOS2/bin/nios2-flash-programmer --input=ext_flash.flash --sof=__NO_SOF_PLEASE__ --base=0x00800000 

======================================= 

 

My questions are: 

 

1. The first two commands put the hardware(nios core) into EPCS at address 0 and it can really configure FPGA after reset. Since bootloader code is resided on on-chip memory inside FPGA, I think we need only put the software (firmware) into EPCS behind FPGA configuration data. Why there are four commands to realize it? 

 

2. The last two commands seems to put something to FLASH instead of EPCS, is there any need to program the flash? I only want to boot from EPCS! I think it has nothing to do with FLASH. 

 

3. Most strange of all, the last two commands never suceed. It displays "INPUTFILE=EMPTY, EXITING". The result is: it can not boot from EPCS. 

 

Thanks in advance.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
261 Views

Hi Seu, 

 

Is your reset address set correctly? It should be set for the epcs controller. 

 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
261 Views

From what i can see that sequence is almost correct, apart from... 

you are telling it to use a boot loader located in EPCS which will look for and find the main application also located in the epcs. HOWEVER, your main application is being programmed into the system flash at location 0 rather than into the EPCS. 

 

So what are you actually trying to do?  

Put the application into EPCS (i think this is what you're after) 

OR 

Boot from EPCS but copy the main application from FLASH, 

 

The sequence of commands is lsightly different for each and I can provide you both.. let me know. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gif
0 Kudos
Altera_Forum
Honored Contributor II
261 Views

Hi all, 

 

I want to store both hardware (FPGA configuration data) and software image into EPCS. 

 

There is nothing wrong with me and you. The error is due to a bug of Nios II version 1.1. You&#39;ll find infos at Altera.com->support->intellectual property->NIOS II->NIOS II Development Kits Errata. A patch is needed to correct that problem. 

 

Now I have downloaded the patch and I can boot from EPCS now. The patch can be obtained from ftp://ftp.altera.com/outgoing/download/ni...oader_patch.zip (ftp://ftp.altera.com/outgoing/download/nios/nios2_1.1_epcs_boot_loader_patch.zip). 

 

There are many bugs inside Nios II 1.1. So if any question, you can first go to see errata info at altera.com. Perhaps nios II 5.0 can avoid these mistakes. Quartus II 5.0 and Nios II 5.0 will be released recently. 

 

Especially thanks to Mike for his help! 

 

Seu_xugh
0 Kudos
Reply