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++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Custom Linker Script

Altera_Forum
Honored Contributor II
1,250 Views

I'd like to carve out a section in sdram normally used for the heap and reserve it.  

 

The sdram sits at 0- 0x01800000, and I want my user logic to have sole write access to 0-0x1000. So to keep it simple, I assign only the heap to the sdram, and slightly modify the ide generated, "generated.x".. but is it enough to change just the following: 

 

from: 

PROVIDE( __alt_heap_start = end ); 

PROVIDE( __alt_heap_limit = 0x01800000 ); 

 

to: 

PROVIDE( __alt_heap_start = end ); 

PROVIDE( __alt_heap_limit = 0x017FF000 ); 

 

My logic outside of the nios could then write to the memory at 0-0x1000, but the nios will only be able read (never write) to that area. 

 

 

There's so much more in the generated.x file that I'm not sure if anything else needs to change... I read the bootlader normally changes whenever you modify the linker script but I don't think that applies in this case, right?
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
508 Views

I think the change you suggest will reserve the top of sdram - not the bottom. 

If the heap start is at 'end', this will normally be the address following the code and static data. So the '0' address actually contains something else (probably code). 

It might be easier to use a chunk of high sdram for the fixed address buffer. 

Alternatively, if you only have a small program, write an ldscript that assigns all the sections to appropraite memory areas. If you don't use any stdio functions, you may not even need a heap!
0 Kudos
Reply