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

How to load program to SSRAM

Altera_Forum
Honored Contributor II
985 Views

Hello ! 

 

I have a custom NIOS II system with STRATIX II and SSRAM. 

 

I am doing this steps for load and start my system: 

( All program sections placed in SSRAM) 

 

1. Nios2 compilator create *.elf  

2. I convert *.elf to *.bin with  

"nios2-elf-objcopy.exe 1.elf -O binary --set-start 0 1.bin" 

 

3. I init SSRAM with my *.bin 

 

4. I reset NIOS. 

 

In this case working only simple program ( printing constant string to LCD for example). 

System crash when i writing C-code with variables. 

 

How must I load *.elf to SSRAM correctly?  

 

 

Thanks. 

Sorry for my English
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
299 Views

I'd start by trying out the Nios II IDE. Here's a document about how to use it (download/debug your code using it) 

 

http://www.altera.com/literature/hb/nios2/n2sw_nii52002.pdf (http://www.altera.com/literature/hb/nios2/n2sw_nii52002.pdf)
0 Kudos
Altera_Forum
Honored Contributor II
299 Views

Hi Jools, 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

3. I init SSRAM with my *.bin[/b] 

--- Quote End ---  

 

 

How do you init SSRAM with *.bin? 

I mean from which address. 

And after initing SSRAM, how do you set your PC register? 

 

In my system, my SDRAM_BASED = 0x1000000 

Also,all my sectors exist in SDRAM 

And I copy *.bin to SDRAM from address 0x1000020. 

After booting, I set PC = 0x10001C8 

Then everything work correctly. 

 

Note:  

exception sector occupied the following address: 

0x1000020 -- 0x10001C7 http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/tongue.gif  

 

FYI. 

David
0 Kudos
Reply