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.

RTOS/CC2640R2F: ICall Task Stack Size

Part Number: CC2640R2F

Tool/software: TI-RTOS

Like a lot of people on this forum, I am always looking for more RAM for our simple peripheral-based application. One place where I see a big chunk is the 1000 byte stack for the ICall task, which is created with stack size defined in icall_addrs.h:

#define ICALL_TASK_STACK_SIZES { 1000 }

Since Task_create() is used to instantiate this task, I am assuming/guessing that the 1000 bytes are then allocated from the RTOS heap in app_ble.cfg:

/*

 * Specify default heap size for BIOS.

 */

if (typeof NO_ROM == 'undefined' || (typeof NO_ROM != 'undefined' && NO_ROM == 0))

{

//  BIOS.heapSize = 1668;

}

When I check stack utilization with ROV, I can see that the ICall task stack peak seems to be around 528. Our application is a pretty basic peripheral with only a single connection and a couple of services with a few characteristics. We are using the stack library. Under what circumstances does ICall's stack usage increase? Do you think I can safely reduce the size of the stack (and also BIOS.heapSize)? Obviously I can try it as is and it will probably work, but I would like to know what the risks are.

Thanks for your help!

dave

  • Hi Dave,

    You got it! I believe SWIs and HWIs also draw from that pool as well, so keep that in mind as well.

    To profile, perhaps you could just have as many interrupts as possible fire (theoretically, as per your application) and see how much the peak changes.

    And you're right, it probably will work - just note, if you're using IAR, you actually need to use the linker file to set the BIOS heap, rather than the RTOS config file

    Regards,
    Rebel
  • Thanks, Rebel. I'll try it and see if it works.

    dave