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

EPCS : update FPGA config data and NIOS software

Altera_Forum
Honored Contributor II
2,029 Views

Hi, 

 

I currently use NIOS II v5.0 and I want to update the FPGA configuration Data and the NIOS sofware ( 

which are twice stored in the EPCS memory) with an Ethernet network. 

 

 

Anybody has already update all EPCS data (FPGA + NIOS II sofware). 

 

Anybody has a little piece of code to do that ? 

 

I thank you a lot.  

 

Etienne
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
493 Views

If I understood this correctly you want to put the FPGA configuration and Nios II application software into the EPCS? 

 

The flash programmmer can do this assuming the following: 

 

1) You have an EPCS controller in your hardware design 

2) You have the reset location set to the EPCS controller (it has a bootloader inside it) 

3) You have some other memory in your design to use as main memory (so you compile your application for this main memory not the EPCS device itself). 

 

So you have your compiled code, the EPCS controller is targetted as the reset location so that the bootloader in it will copy your compiled application that was stored in the EPCS device into your main memory. Now if you were asking if you can run code directly out of the EPCS device .......... that's going to be very slow so I don't recommend it (that and you will not have an interface provided by Altera to do that). 

 

These should help: 

http://www.altera.com/literature/hb/nios2/...pu_nii51012.pdf (http://www.altera.com/literature/hb/nios2/n2cpu_nii51012.pdf

http://www.altera.com/literature/ug/ug_nio..._programmer.pdf (http://www.altera.com/literature/ug/ug_nios2_flash_programmer.pdf)
0 Kudos
Altera_Forum
Honored Contributor II
493 Views

Hi Etienne, 

 

> I want to update the FPGA configuration Data and the NIOS sofware 

> (which are twice stored in the EPCS memory) with an Ethernet network. 

 

You can use u-boot to this via tftp and its epcs read/write/verify commands. 

You will need to convert your flash files to binary though. 

 

> Anybody has a little piece of code to do that ? 

 

That depends on what you mean by 'little' ;-) 

 

Regards, 

--Scott
0 Kudos
Altera_Forum
Honored Contributor II
493 Views

Etienne, 

 

do I understand you right: Your problem is, how to manage a complete reprogramming of your EPCS by the running NIOS system ? 

You'll get an image file via ethernet which has to be stored into the EPCS, so next time you apply power, a new FPGA configuration is loaded and then your new firmware is booting, all from EPCS. 

If so, we had a similar discussion in ... another topic (http://www.niosforum.com/forum/index.php?act=st&f=2&t=1386&hl=). 

I can send you a short ANSI-C programme to combine the two files into one binary image. 

EPCS can be programmed using HAL functions 'alt_erase_flash_block' and 'alt_write_flash'. 

 

Mike
0 Kudos
Altera_Forum
Honored Contributor II
493 Views

Mir,  

I'm interested by your piece of c code  

 

I thank you a lot, 

 

Etienne 

 

I thank all people that have provided to me some help about my problem ! 

 

Thank you everybody,
0 Kudos
Altera_Forum
Honored Contributor II
493 Views

I am also interested in this little C program. Can anyone send it to me per e-mail or post a link? I want to program FPGA configuration and NIOS 2 Software over AS. Thats why I need a single file. 

 

Thank you
0 Kudos
Reply