cancel
Showing results for 
Search instead for 
Did you mean: 

Stack Problem

ayhan_kucukmanisa
Associate II
Posted on January 06, 2012 at 15:31

Hi,

I have stm32f103rb6 chip. Im trying to implement PolarSSL Crypto Library. But when i try to use library functions, this error occurs ''The stack pointer for stack 'CSTACK' (currently 0x1FFF7E60) is outside the stack range (0x20000758 to 0x20000F58) ''.

Iam not sure but I think this is a stack owerflow problem. Can i solve this problem by using FreeRTOS. Is anyone has a advice?

Thanks.

#freertos #stack-problem #stack #stm32
4 REPLIES 4
Posted on January 06, 2012 at 16:00

It looks like you have a 2048 byte stack. You are using >32KB

Just how much memory do you need for this library, and how much space are you using with local/automatic variables? If you don't know how much you are using you'll need to examine your code, as there is insufficient detail in your post to make a diagnosis.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Manjunatha S
Associate II
Posted on August 22, 2012 at 18:44

I'm not sure why this wasn't started as a new thread?

It's probably complaining about the stack because it's looking at the constraints of one piece of code, but using the settings from another. If you have stack-checking on this might complicate IAP code.

Perhaps review the .MAP files to confirm linker placement for each. There's no objects attached for review.

You'd need to step into the code, and perhaps have a proper Hard Fault handler to identify why/where the code is failing.

You should check to see what System_Init() is doing in the secondary code, as setting up clocks/plls assuming reset conditions is problematic. Check that the vector table is correctly assigned to the new address.

Please use complete English words, you are not texting, ST does not charge by the character.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
amin23
Associate II
Posted on August 23, 2012 at 10:37

Hi,

PolarSSL stack has been ported on STM32F2 and STM32F4 devices, have a look at the following Application notes:

AN3365 for STM32F2

http://www.st.com/internet/mcu/product/250172.jsp

and AN3967 for STM32F4

http://www.st.com/internet/mcu/product/252139.jsp

.

Just you need to know the amount of memory used by the stack, and how much space are available in STM32F103. If the memory used by the stack exceeds the memory available in STM32F103, in this case you can use a part of stack like some crypto algorithms.