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.

CC2340R5: basic_ble example consume 33KB of RAM

Part Number: CC2340R5
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I compiled the basic_ble example using IAR version 9.32 and FreeRTOS v202104.00. The RAM usage of this example is 33 KB out of the 36 KB available on the chip. This leaves me with only 3 KB of RAM, which is not enough for my application.

I was planning to use the basic_ble example as a starting point for my project, but it seems that I will need to reduce the RAM usage in order to make it work.

Do you have any suggestions for how I can reduce the RAM usage of the basic_ble example, or maybe to use a different example?

Thanks

Yigal

  • Hi Yigal,

    I think the basic_ble example is a great point to start.

    20 kb are blocked by FreeRTOS for the heap. So as long as you are running your applications within FreeRTOS you can use this. 

    If you need more RAM for non RTOS functions, you  can reduce the heap size with in Sysconfig as shown below.

    Regards,

    Alex

  • Hi Alex,

    Could you please help with defining the minimum heap size that is required for the simple_ble to work as designed. I have searched the documentation, but I have not been able to find a definitive answer.

    Regards,

    Yigal

  • Hi Yigal, 

    for now I would not recommend you to do so if you are running everything using FreeRTOS.

    The devices will run fine with the predefined heap and you a can allocate up up to 25 kb of heap for peripheral applications.

    The system will take ~8kb and each connection will take ~0.8 kb from the available heap.

    The heap is the RAM that is available for your applications running in FreeRTOS!!!!! 

    Regards, 

    Alex

  • Hi Alex,

    Looks like I'm lack of knowledge with freeRTOS.

    Could you please share a simple example for defining a 16 bytes array that will be allocated in the heap.

    Thanks

    Yigal

  • Hi Yigal,

    If you generate it within a FreerTOS task it should be allocated. 

    As the FreeRTOS academy is not available for CC2340 yet, I would like to point you to SimpleLink Academy for CC13xx CC26xx (ti.com)

    and the RTOS section there

    And to BLE5-Stack User's Guide (ti.com) where you can find additional information on FreeRTOS.

    In this chase depending on how you use it it might not always be stored in heap. However if you can safely reduce heap size depending on the amount of RAM you need.

    Regards,

    Alex