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.

Compiler/CC1310: Do I need malloc?

Part Number: CC1310

Tool/software: TI C/C++ Compiler

I'm using a CC1310 with SDK 1.5 and I am tight for RAM space.

My code below required me to change the size of this buffer

//#define BUFF_SIZE 200 //when RCM was added
#define BUFF_SIZE 1050 //fwu

char input[BUFF_SIZE]; //UART buffer

I'd like to be able to change the array size of "input" on the fly, how does TI-RTOS support this?

Also, besides obvious application code practices, are there ways to conserve RAM via the RTOS using switches, or something I am overlooking?

I only have about 2K out of 20K left.

Thanks in advance,

  • Hello Saycoda,

    I would first recommend you upgrade to our latest SDK 2.30 which will include the latest TIRTOS with all the best memory and power optimizations.

    If you have taken in to consideration all C coding better practices, and you want change the size of arrays on the fly. I recommend you allocate and free memory when you need to. You can use the system Heap, which is the one used by default, or you can have a dedicated heap for this type of application.

    Refer to page 159 of www.ti.com/.../spruex3u.pdf

    For more detailed information on how to do this. This will help you only use what you need when you need it, and also be able to use that heap for any other type of data you want to save during run time and delete/free when you are done. Managing the memory using these tools might be the best way to conserve ram.

    Regards,
    AB