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

Eclipse compiling to wrong RAM space

Altera_Forum
Honored Contributor II
1,207 Views

Hi All, 

 

Having built a NIOS system with 32kB internal RAM and 32MB external SDRAM there seems to be an issue with the binary created by Eclipse / GCC loading into the wrong space. 

 

Initially the application is built using the default Board Support Package, then a memory init file is made using 'make mem_init_install'. Before adding the SDRAM, this has been used many times to create simple apps that boots after the FPGA image has been loaded. 

 

Having compiled the new FPGA (with the SDRAM present) along with this memory init (hex) file the new application does not run at FPGA boot time. 

 

However, if the app is loaded from Eclipse using Run As -> NIOS II Hardware everything works fine. One of the final messages from Eclipse is something like "running application at 0x02000000" which is located in SDRAM. 

 

The .sopc file has been checked and the NIOS II processor should be booting from internal RAM. 

 

Just checked the final console messages from Eclipse and found "32764 KBytes free for stack + heap", so it is compiling to SDRAM, I was expecting to see 32k free... 

 

So, how to persuade Eclipse to build for the correct RAM ?? 

 

Thoughts please. 

 

-Mark
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
288 Views

Check the "Linker Script" tab in the NIOS2 BSP Editor GUI. It sounds like you've got one or more sections pointing to your SDRAM device.

0 Kudos
Altera_Forum
Honored Contributor II
288 Views

cor bloody hell, well done, thank you ! 

 

All sections were in SDRAM as you predicted. 

 

-Mark
0 Kudos
Reply