Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

Create sof file with software inside

Altera_Forum
Honored Contributor II
1,382 Views

Hello there, 

 

I've just migrated from Xilinx to Altera. Using the NIOS IDE I've created a system with working SW. 

I would like to program the on-board EPCS flash so on power up the FPGA is programed with the right HW and SW. 

 

I read that I need to convert the sof file to jic. OK, but what about the software - as I noticed the sof only contains the HW. 

 

what to do? how do I create a sof file that contains both the HW and SW? 

 

thanks alot. 

 

Guy
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
689 Views

You don't want to use the JIC method in this case. Use the NIOS2 flash programmer accessible from within the Eclipse IDE. Select the option for programming your software project into flash and for programming an FPGA image into flash (you will have to browse to the compiled SOF file for your project). The NIOS2 flash programmer will program the FPGA image into the lowest address space of the EPCS flash and will program the software image immediately after the firmware FPGA image. The EPCS flash controller that you've placed in your SOPC system contains a bootloader that will automatically determine the size of the FPGA image, jump to the beginning of the software image and load the program into the RAM sections you've specified. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
689 Views

Jake, 

why not use the JIC option in this case? 

We have used that method for years and that plays out well? 

 

As long as one boots from internal ram and you have a jtag connection the jic is a nice way to lock an image? 

 

Or am I missing something here? 

 

It is after all alot easier to use the jic in field operations that instead of the flash programmer stuff? 

 

Sorry, I just had to ask.. 

 

Apus
0 Kudos
Altera_Forum
Honored Contributor II
689 Views

The question in point is how to program a NIOS2 software image into the EPCS flash. The easiest and fastest way to do this is with the NIOS2 flash programmer.  

Because of the way NIOS boots from EPCS flash, the flash programmer must program both the FPGA image and software image at the same time. 

 

Actually, we use the nios2-flash-programmer in field/manufacturing environments all the time because of it's speed advantage over the JIC method. The nios2-flash-programmer can be run from the command line for advanced users just as the quartus programmer can. 

 

Jake
0 Kudos
Altera_Forum
Honored Contributor II
689 Views

Ok, 

so what you are saying is that if one is using the flashprogrammer method the system reallocates the nios code from the internal mem it normally resides in, and moves it to the end of the fpga config data in the epcs? 

And then inserts a bootloader into the place of internal ram(in the config image) instead? 

 

For advanced users, yes the flash programmer is certainly more powerful. 

But for a standard techie, with no knowledge of altera the jic method is easier. 

Anyway, thanks. 

 

Apus
0 Kudos
Altera_Forum
Honored Contributor II
689 Views

 

--- Quote Start ---  

The question in point is how to program a NIOS2 software image into the EPCS flash. The easiest and fastest way to do this is with the NIOS2 flash programmer.  

Because of the way NIOS boots from EPCS flash, the flash programmer must program both the FPGA image and software image at the same time. 

 

Actually, we use the nios2-flash-programmer in field/manufacturing environments all the time because of it's speed advantage over the JIC method. The nios2-flash-programmer can be run from the command line for advanced users just as the quartus programmer can. 

 

Jake 

--- Quote End ---  

 

 

Hi Jake 

Recently,I used NiosII Command Shell to build the advanced bootcopier, when typing the code " nios2-flash-programmer --base=0x00000000 \--epcs hello_world.flash " , an error appears "No EPCS registers found ,tried looking at 0x00000200,0x00000300,0x00000400". 

I have ensured the jtag-module-reset output from the NiosII processor connected to the epcs flash controller reset input. 

can you give some help? Thank you very much! 

Sincerely Luke.
0 Kudos
Reply