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.

CC2640R2F: Available SRAM in Simple_peripheral

Part Number: CC2640R2F
Other Parts Discussed in Thread: BLE-STACK

I was trying to implement custom logic on top of the Simple_peripheral blestack example.  I needed a somewhat large SRAM staging area.  The `Memory Allocation' view in CCS shows over 6kbytes left but either allocating an array on stack or using ICall_malloc(), I can get only about 2kbytes reliably.  I need over 4kbytes.  I'd like to ask, from experience, what is a reasonable amount of free SRAM that I can expect in Simple-peripheral case?  And if I do need 4kbytes array, is there a way to get it?

  • Hi Yuan,

    Assigning an expert to comment.

  • Hi Yuan,

    Please note that the Memory Allocation view does not show memory that has been allocated at runtime as occupied. This means the ICall heap is not counted as occupied by the Memory Allocation view. 

    In general I would recommend the following chapter in the User's Guide for characterizing/debugging the heap:

     

    You can read the following app note for general tips on RAM:

  • Thanks.  The heapEnd - heapStart and HeapStats really helped me to gain sufficient insights.

    One remaining question though: as far as I understand at least a big part of the BLE stack and TIRTOS should be in the ROM, yet, the Simple_peripherial example occupies so much FLASH.  Is it intended by design?

  • Hi Yuan,

    Yes, most of TIRTOS and the BLE-Stack are in ROM. However any function we have changed or fixed since the ROM was written are patched in flash.