The stack pointer for stack 'CSTACK' is outside the stack range

Rakesh Awanti picture Rakesh Awanti · Aug 22, 2014 · Viewed 10.6k times · Source

I am trying to execute some simple code on the IAR embedded workbench using a simulator. I've complied the code with no warnings or errors but during debugging I get this warning "The stack pointer for stack 'CSTACK' (currently 0x00000000) is outside the stack range (0x20000000 to 0x20001000)". My code fails to do even simple increment operations which I am finding really weird and hard to understand. I could find any proper solution for this problem Google or on IAR. Any thoughts??

Answer

Fiddling Bits picture Fiddling Bits · Aug 22, 2014

In Options -> Linker -> Config -> Linker configuration file you should have file that has a defines such as this:

define symbol ICFEDIT_region_RAM_start = 0x20000000;
define symbol ICFEDIT_size_cstack = 0x1200;

In my project my file is named:

STM32F2xx_FLASH.icf