Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

Eclipse compiling to wrong RAM space

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

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    cor bloody hell, well done, thank you !

    All sections were in SDRAM as you predicted.

    -Mark