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

Boot up NIOS II

Altera_Forum
Honored Contributor II
1,210 Views

Hello, 

 

I want to boot up a NIOS II - System from on-chip memory. I use a stratix 1s10. This device has enough on-chip-memory for my program. How can I tell the system that it has to boot up from on-chip? What initialization-files do I need? For a NIOS I I could build in the *.srec in the RAM. Could I do so in a NIOS 2 too? 

 

Thanks 

JG.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
462 Views

I was able to boot a NIOS2 from a program residing in on chip RAM on a Cyclone 1C3. Heres what I did: 

 

1) Use Legacy On-Chip RAM in the SOPC builder. 

2) Select SDK. Don't know if you had to do this or not. The IDE/HAL probably works. 

3) In SOPC: have the Reset Vector pointing to your RAM device. I used the defaults that SOPC gave me and it worked fine. If you select SDK, have the program and data memory pointed correctly. 

4) The first time you build SOPC, have the on-chip RAM blank. 

5) After SOPC, write your program. 

6) Heres the biggie: When you compile, use the -b option and use the base address of your on-chip RAM. 

For example: nios2-build -b 0x1000 -Os -o main main.c etime.c. Don't know why, but the -b is important. If you are using IDE/HAL, don't know what you need to do to set the -b option. 

7) Once you have your .srec, go back to SOPC and under the contents tab, select the build option and point to your .srec (not .c). 

8) Finish your design with Quartus. 

 

I know this looks clunky, but I found that it has worked quite well over the past month. 

 

Hope this helps, 

Rick
0 Kudos
Altera_Forum
Honored Contributor II
462 Views

 

--- Quote Start ---  

originally posted by rppolicy@Sep 23 2004, 12:21 PM 

i was able to boot a nios2 from a program residing in on chip ram on a cyclone 1c3.  heres what i did: 

 

1) use legacy on-chip ram in the sopc builder. 

2) select sdk.  don't know if you had to do this or not.  the ide/hal probably works. 

3) in sopc: have the reset vector pointing to your ram device.  i used the defaults that sopc gave me and it worked fine.  if you select sdk, have the program and data memory pointed correctly. 

4) the first time you build sopc, have the on-chip ram blank. 

5) after sopc, write your program. 

6) heres the biggie: when you compile, use the -b option and use the base address of your on-chip ram. 

for example: nios2-build -b 0x1000 -os -o main main.c etime.c.  don't know why, but the -b is important.  if you are using ide/hal, don't know what you need to do to set the -b option. 

7) once you have your .srec, go back to sopc and under the contents tab, select the build option and point to your .srec (not .c). 

8) finish your design with quartus. 

 

i know this looks clunky, but i found that it has worked quite well over the past month. 

 

hope this helps, 

rick 

--- Quote End ---  

 

Hi Rick, 

 

thanks for your reply. 

I tried your way. But I have one big problem. Because of the length of my program I have to use the M-RAM-Block in my Stratix. So far so good. 

Now tells me Quartus/SPOC-Builder that I have to leave the memory blank. Don&#39;t know why. How should I initialize the memory when I must leave it blank???? http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/unsure.gif  

 

Regards  

Jens 

 

PS: Sorry for my bad english.
0 Kudos
Altera_Forum
Honored Contributor II
462 Views

Hello, 

 

It is not possible to initialize MRAM Blocks with a default value at boot up. In Stratix devices default values are only supported for M4K and M512 Ram Blocks. 

 

When you have enough M4Ks free, set the implementation of the on-chip memory to M4K RAM blocks. Otherwise you will need an external Memory where you can store your program and a little bootloader can copy the program on start up to a m-ram block or you use the external memory as program memory. 

 

Hope this Helps 

Chris
0 Kudos
Reply