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.

CC256x M3 Stack Size Reduction



Hi team,

I would like to check two things with you:

1) Can the size of current M3 Stack be further reduced? My customer is using Tiva-C + CC2564B but they ran out of Flash after they added the application code. 

2) Is the size of RAM consumed will be increased at run-time? Customer worries that if the stack will use something like malloc to get more RAM.

Thanks,


best regards,

Richard

  • Hi,

    What application is the user running?
    How much memory does it take?

    The stack memory varies depending on the user application.

    For example with the demo apps,

    A2DPDemo IAR DBG TM4C129X NoOS : 150,672 (Flash) & 17,579 (RAM).
    ANPDemo IAR DBG TM4C129X NoOS : 103,283 (Flash) & 17,788(RAM)
    HFPDemo IAR DBG TM4C129X NoOS : 100,329 (Flash) & 17,567(RAM)
    HIDDemo IAR DBG TM4C129X NoOS : 91,905 (Flash) & 17,551 (RAM)
    etc.

    I don' think it can be further reduced...

    Regards,
    Gigi Joseph.
  • Hi Joseph,

    Thanks for your answer. Customer is making a system that monitors power supply of a communication base station, allowing it to be connected by tablets and phones through BT or BLE to read the history data and current status.

    Currently their application + bootloader + BT stack has taken 260KB+ flash which exceeds the total 256KB flash of Tiva-C 123 series. As a consequence, they are trying to find a way to further reduce the size of the code.

    Another concern is that we are not sure about if the BT stack will dynamically allocate memory and use more than 18KB RAM under certain circumstances. Could you please confirm this?

    Thanks,

    Best regards,
    Richard

  • Richard,

    The Tiva SDK is packaged with helper scripts known as the Flexible Build Library system. They can be found in Cortex_M4\Bluetopia\lib_fbl\. Using these scripts you can specify which specific features are needed and the scripts will create a Bluetopia library that is tailored for the needs of the application. This is one option for reducing the code size.

    Which app are they using as a starting point? All of the apps have a command line interface to handle user interaction with the stack. All of this code can be removed for a final application. It's hard to say exactly how much code this will save, but the SPPLEDemo/IAR/Debug/NoOS/TM4C123G app uses approximately 24K of code and 20K of constant data. I believe you could reduce these numbers significantly after stripping out the code that is responsible for user interaction.

    In regards to the RAM usage, you would need to test stack usage in the worst case scenarios. Worst case scenario in this case would be the maximum number of connections the application needs to support with all connections actively sending and receiving. The stack can be filled with a specific data value before the test, and after the test you can check to see how much of the stack was used.

    Thanks,
    Samuel