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.

Memory mapping

Guru 18625 points

Other Parts Discussed in Thread: CC2540

Hi,

I was wondering if anyone has an idea about how to calculate or check the amount of memory each connected slave represents for a master.

I know we can see the size of the program in the map file, this is not what I'm asking for :)

That is, I would like to check the amount of RAM a master is employing when it does not have ANY slave connected, an compare it when it has ONE slave connected, and TWO.

Any idea about this? Give me your wisdom!

Bye! :)

  • Hi Kazola,

    There are some debug functions in the OSAL memory manager that can be enabled to show how much of the heap is being used. You could enable this and examine the result for one and two devices. There is also a heap "high water" variable you can get at which tells you the highest heap usage after making some connections

    Best of luck

  • Hi Eng,

    thanks for your prompt answer. Unfortunately, I'm checking the OSAL API from the BLE stack installation and obviously there are function for memory allocation for example but I do not see those debug functions.

    Could you be a little more explicit or directly indicate me the place where to find them? In fact, perhaps this "high water limit" you commented maybe all I need, any further info about this? :)

    I'm just getting back to CC2540 development :)

    Let me know.

  • Hi!

    Some news here :)

    uint16 osal_heap_mem_used( void )
    {
    return memAlo;
    }

    I've been using this function to output a value on the LCD, but the value is always the same (3072), even if I have 0, 1 or 2 slaves connected.

    Perhaps I'm looking in the wrong place? I just want to observe the memory differences when having several slaves connected (i.e. a practical view why the TI BLE stack cannot manage more than 3 connections simultaneously).

    Let me know your ideas! Thanks!