Forum Discussion
Altera_Forum
Honored Contributor
11 years agoPut a pattern in memory at the lowest address you think the stack should use and check it hasn't been overwritten at various places.
Limit the heap to stop it allocating above that address. Or, maybe, arrange the memory map so that the stack is at the bottom of the physical memory area and arrange for accesses below that base addres to fault. There is an options somewhere to cause a fault if the nios accesses a non-existant avalon address. (It might be in the hidden menu with all the other useful options.) Or just limit the size of the heap - you might just be allocating too much memory.