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

How to flash Nios II program (C code) permanently?

Altera_Forum
Honored Contributor II
3,150 Views

Hi everyone, 

 

I am beginner in NIOS programming, i have made my own design of my NIOS processor with platform designer. every single step are running smoothly. But the problem came from when i want to flash my C code (in the NIOS II software build tool) into my NIOS processor. I want my program stick permanently into my NIOS processor. every time i do reset in my board, then the program (my c code) are gone. How to do flash the chip permanently with my C code? any reference are expected. Thank you everyone.
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
885 Views
0 Kudos
Altera_Forum
Honored Contributor II
885 Views

 

--- Quote Start ---  

I want my program stick permanently into my NIOS processor 

--- Quote End ---  

What non-volatile memory are you intending to use to store your program? The Nios core itself won't (necessarily) store anything. 

 

Is this a development board or your own design? 

 

Cheers, 

Alex
0 Kudos
Altera_Forum
Honored Contributor II
885 Views

 

--- Quote Start ---  

What non-volatile memory are you intending to use to store your program? The Nios core itself won't (necessarily) store anything. 

 

Is this a development board or your own design? 

 

Cheers, 

Alex 

--- Quote End ---  

 

 

Hi Alex, 

 

Thank for your reply. I used my own design development board. Is it possible if i use OnChip Memory on IP Catalog? Or please give me advise for the best solution. I have plan to deploy my NIOS design to end user. So the customer only program the C code without to know anything about my processor design. i am beginner about this, really expect for you advice. Thank you 

 

best regards 

 

indra
0 Kudos
Altera_Forum
Honored Contributor II
885 Views

 

--- Quote Start ---  

Hi, 

 

1.Generation of memory initialization file and combining elf executable into hardware project sof. 

https://www.bing.com/videos/search?q=integrate+elf+and+sof+altera&ru=%2fsearch%3fq%3dintegrate%2belf%2band%2bsof%2baltera%26form%3die8src%26src%3die-searchbox&mmscn=vwrc&view=detail&mid=505ceef0fd21f95475a6505ceef0fd21f95475a6&rvsmid=beb396dfec4a20c04fd9beb396dfec4a20c04fd9&form=vdqvap 

and convert sof to pof based on configuration scheme  

2.https://www.altera.com/support/training/course/ocnfgsch.html 

3.http://www.alterawiki.com/wiki/configuration_walk-through 

 

Best Regards, 

Anand Raj Shankar 

(This message was posted on behalf of Intel Corporation) 

--- Quote End ---  

 

 

Hi Anand, 

 

I have find the clue of your solution. I combine the elf file (converted to hex file) and sof file and then the chip worked successfully. But, i have a further question. Is it possible if we put the hex file to separate non-volatile memory? so i can freely change my C code without combining my sof file and the elf file? thank you 

 

 

best regards 

 

Indra
0 Kudos
Altera_Forum
Honored Contributor II
885 Views

What device family are you using? MAX 10? 

 

The 'generic nios ii booting methods user guide (https://www.altera.com/en_us/pdfs/literature/ug/niosii_generic_booting_methods.pdf)' covers all you need to know. Depending on your FPGA family you'll be booting from UFM (MAX 10) or OCRAM. 

 

Also have a read through the 'nios ii processor booting from on-chip memory (ocram) (https://www.altera.com/documentation/iga1446487888057.html#nio1505517080158)' section of the 'Embedded Design Handbook'. This takes you through more specific design examples. 

 

Cheers, 

Alex
0 Kudos
Altera_Forum
Honored Contributor II
885 Views

 

--- Quote Start ---  

What device family are you using? MAX 10? 

 

The 'generic nios ii booting methods user guide (https://www.altera.com/en_us/pdfs/literature/ug/niosii_generic_booting_methods.pdf)' covers all you need to know. Depending on your FPGA family you'll be booting from UFM (MAX 10) or OCRAM. 

 

Also have a read through the 'nios ii processor booting from on-chip memory (ocram) (https://www.altera.com/documentation/iga1446487888057.html#nio1505517080158)' section of the 'Embedded Design Handbook'. This takes you through more specific design examples. 

 

Cheers, 

Alex 

--- Quote End ---  

 

 

Hi alex, 

 

i used altera cyclone IV familiy. Thanks for your clues.  

 

Best regards 

 

indra
0 Kudos
Reply