This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/CC3200: Changes in the stack size is not reflecting

Part Number: CC3200

Tool/software: Code Composer Studio

Hello everyone,

I am facing some issues related to the stack size. First, I am explaining my environment:-

  1. CCSv8
  2. Non-OS platform
  3. CC3200 controller
  4. Stack size = 0x2000, Heap size = 0x2000

I am doing file operations on SD card and sFlash in my application, there are 9 files in SD card and 2 files apart from binary in sfLash. So while doing file operations on SD card, i am getting an error (-2) which is  Assertion failed error. So i read about the possible cause of this error and found it may be due to stack overflow, then i checked my stack usage and found some issues like:-

  1. Stack is used 100%.
  2. In the below image, how it calculated 15856 bytes? There is no document explaining about stack usage.
  3. Also i am not able to change the stack size under project properties ---> CCS Build ----> ARM Linker ----> Basic Options

  • I think you have the same issue discussed in this forum thread.

    Thanks and regards,

    -George

  • Hi George,

    Before posting here i went through the post you referred, things are not clear for the following points:-

    • It is not clear why stack size is not increasing when i change in the properties?
    • How it is calculating 15856 bytes in my example if my stack size is 8192 bytes only?

    Thanks 

    Shubham

  • Regarding these stack numbers ... They are two different numbers which are computed separately.  A change in one has no influence on the other.

    Regarding the number in the stack usage view ... Each function requires a certain amount of memory on the stack.  Suppose, as a simplification, the entire system is two functions AAA and BBB.  AAA calls BBB.  BBB calls nothing.  AAA uses 10 words of stack, and BBB uses 20 words of stack.  While AAA is running, 10 words of stack are being used.  When AAA calls BBB, 30 (10+20) words of stack are being used.  Thus, the overall stack usage of the system is 30 words.  The number in the stack usage view is computed in this manner.  The function _c_int00_noargs is the first function called in the system.  The inclusive size shown for that function is a low estimate of how much stack your system needs.

    Regarding the number passed to the linker with the option --stack_size ... This is how much memory the linker sets aside for the stack.  It is based on the value supplied to this option, and nothing else.  In particular, the number computed for the stack usage view is not used.

    If the numbers shown in the first post are accurate, then you overflow the stack by a lot.  Make the --stack_size argument much larger.  Or, consider investigating the functions in the stack usage view and see if one or two functions are using up most of the stack.  You might be able to change those functions to use much less stack.

    Thanks and regards,

    -George