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.

How do I measure free RAM on CC3200

Other Parts Discussed in Thread: CC3200, CC3200MOD, UNIFLASH

I would like to measure the free RAM on the CC3200 microcontroller while it is running. Is there a function or general methodology to do this? May I execute out of SPI flash?

  • Hi , The total space occupied in RAM will be equal to the .bin size of your application . Will this change during run time ?
  • Hi Andrew,

    Unfortunately there are not straight forward way to get this information while running an application.
    You can check out the generated map for the application you are using for the memory consumed but please note this will not accommodate the memory allocated during runtime.

    Regards,
    Ankur
  • What if I were to just use variables on the stack? Then could I make a variable, see what its memory address is, and subtract that from the highest memory address? For example

    uint32 freeRam(){
        int i = 0;
        const int MAX_MEMORY_ADDRESS = 0x40000; /* CC3200 has 256k RAM. Byte addressable? */
        return MAX_MEMORY_ADDRESS - &i;
    }

  • Hi Andrew,

    This is not the correct approach.
    The memory allocation depends upon the linker file. The different sections are placed at different regions defined in linked file.
    Lets assume that the stack is placed at the end of the memory region and with above logic you can't be get the available memory as the size of the application section can be less that the total memory assigned for the that section.

    Regards,
    Ankur
  • What about SPI flash on CC3200mod? we would like to evaluate how many free size in SPI flash we can use except service pack, system configuration and etc. while running an application.
  • Then if the memory is pre-allocated into specific sections for the program and data, can we just open the map file and use the equation Free_RAM = (SRAM_DATA origin+length) - (stack pointer)? assuming no dynamic memory allocation.
  • Hi Andrew,

    Thanks for your reply.

    Based on filesystem on CC3200mod we have programmed multi-images(service pack, system configuration, web pages, application image and etc.) into internal SPI flash by uniflash.  We have no idea to know how we could obtain information about free size to filesystem?

    Will