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

NIOS II Call Stack

Altera_Forum
Honored Contributor II
1,036 Views

Hi. 

Earlier I compiled and ran the memory tester example program and during testing the program consistently deviated into a function trying to recieve a character from the UART. 

 

I suspected stack corruption and sure enough when I start the debugger and check the SP register, its sitting just inside the boundary of the SDRAM which is about to be overwritten. 

 

My question is, how is it decided where the stack will begin, and how do I ensure the stack starts in the on chip RAM I created for this test?
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
278 Views

Depending on the flow you're using, it's either an option available via the command line (SBT flow), in the System Library options (legacy IDE flow) or in the BSP settings editor (SBT/SBT GUI flow). Using any of these methods, you can choose where your stack, heap and a variety of other code sections will reside.

0 Kudos
Altera_Forum
Honored Contributor II
278 Views

Found it. Thanks alot Slacker! I was having horrible images of having to rejig my address mapping in SOPC for bit then.

0 Kudos
Reply