Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
2,313 Views

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

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
Highlighted
Valued Contributor III
48 Views

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

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)
0 Kudos
Highlighted
Valued Contributor III
48 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
Highlighted
Valued Contributor III
48 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
Highlighted
Valued Contributor III
48 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... 

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
Highlighted
Valued Contributor III
48 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
Valued Contributor III
48 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