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/LAUNCHXL-CC26X2R1: Setting the Stack Size

Part Number: LAUNCHXL-CC26X2R1

Tool/software: Code Composer Studio

Hello All,

I am using the ble_multi_role project for devleopment of my custom project, and I wanted to adjust the stack size.

Within the code I saw a stack size setting for the multi_role Task as " #define MR_TASK_STACK_SIZE                   1024"

Also there is a stack size setting under Project->Properties->Linker->Basic Options-> Set C System Stack Size; which has been set to 256.

I am a bit confused. What is the difference between the two of them ? Also if I wanted to increase the stack size, which one should I be actually changing ? I understand that the tasks use their own stacks and share the heap. If so then is it that the stack size setting at the Linker-> Basic Options does not have any significance in this code ?

Also where do you set the heap memory for the tasks ? I see the setting at Project->Properties->Linker->Basice Options as 0. But in the ble_release.cfg file it is set to  "var HEAPMGR_SIZE   = 30000; " So is the heap size setting by default 30000 ?

Regards,

Shyam

  • Hi Shyam,

    The System C stack is, I think, irrelevant. Please configure stack size either in the .cfg file (for default stack size and idle stack size) or directly in the code as you saw, for each task individually.

    Which one you should increase depends on which stack you wish to increase. I'm guessing you want to change the user task stack size, which would be MR_TASK_STACK_SIZE.

    Yes, the heap size is defined in the cfg file. By default it is "auto-size" (HEAPMGR_CONFIG = 0x80) meaning it uses whatever isn't used by other things.

    Please see the software developer's guide: dev.ti.com/.../ and also SimpleLink Academy: dev.ti.com/.../

    Best regards,
    Aslak
  • Thank you for the reply, Aslak.