Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
1,457 Views

Programming epcs without Nios tools

Hi all. 

I'm sure this is in the documentation and it was discussed here before but I really can't find the answer any more. Please help. 

 

I have a design which boots both fpga and Nios from epcs. 

I have no problems programming epcs with my main PC with Nios tools installed: I use sof2flash and elf2flash to generate programming files and then flash them with nios2-configure-sof and nios2-flash-programmer commands. 

Now I want to generate a programming file for the production PC, where they don't have Quartus nor Nios tools, whereas only Quartus programmer is installed. 

What's the procedure for generating and programming the required files into epcs?
0 Kudos
6 Replies
Altera_Forum
Honored Contributor I
29 Views

hello Seilaser, 

 

Could you try this : 

At first, with nios2 tool, create an .hex file containing both vhdl and nios program : 

 

sof2flash --epcs --compress --input=VHDL.sof --output=firmware.flash elf2flash --epcs --after=firmware.flash --input=nios.elf --output=software.flash nios2-elf-objcopy -I srec -O binary firmware.flash firmware.bin nios2-elf-objcopy -I srec -O binary software.flash software.bin cat firmware.bin software.bin > app_image.bin nios2-elf-objcopy -I binary -O ihex app_image.bin app_image.hex 

 

Then with the "convert programming files..." tool from quartus, create a (*.jic) file. 

- select your EPCS device 

- select your FPGA device for the flash loader 

- remove the "SOF Data" 

- clic "add hex data", keep absolute addressing and choose your app_image.hex file. 

- Generate! 

 

Finally, download the *.jic file with quartus 2 programmer on the production PC. 

Regards
Altera_Forum
Honored Contributor I
29 Views

Perfect! It works fine. 

Thank you 

 

One additional question. 

I automated the first part with a bsh script in the Nios command shell. 

Do you know how can I also automate the "convert programming files" step? 

Is possible to include everything in a single script?
Altera_Forum
Honored Contributor I
29 Views

Yes you can. Just manually start convert programming file utility manual and set it up like you are converting your file. Save the configuration file. Then you can do something like this in your script: quartus_cpf -c <your file>.cof 

 

Please note that the .cof file is all txt file and you can change it manually. I had to remove the absolute path names to relative ones, but then it worked just fine.  

 

hope that helped 

 

/Boris
Altera_Forum
Honored Contributor I
29 Views

Hello lethenstrom, 

 

Could you help me with the steps how to program the epcs-flash directly without any interference of the NIOS II processor. I want to use "Active Serial Programming"-mode for programming the EPCS64-device. Is it possible to generate one file (fpga-configuration and NIOS II program) and program this into the Cyclone III 3C25 chip. 

 

Thank you and best regards, 

 

Wamor
Altera_Forum
Honored Contributor I
29 Views

Wamor,  

 

Yes you can do what you want. By using the "Convert Programming Files" tool under the File menu in Quartus you can join SOF and HEX files. Just convert the elf file from the NIOS compile to HEX file and then run this tool. You can make .jic files for indirect programming or pof or other output formats that contain any number of data sections. Check out the help for the "Convert programming files"  

 

Hope that helped 

 

/Boris
Altera_Forum
Honored Contributor I
29 Views

Please note. 

We did not succeed to implement this in Quartus 13.1 only in 13.0. 

Then we found this on the Altera site (2/3/2015): 

http://www.altera.com/support/kdb/solutions/rd11192013_118.html 

 

I recommend to try first Quartus 13.0 see that all is working, and then go to a higher version.  

 

Reuven