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.

CC2651R3: Heap memory failure eventhough enough SRAM is available

Expert 1760 points

Part Number: CC2651R3

Hi geeks,

I'm working on the CC2651R3 (ble sdk 5.40).

We configured heap as autosized.

I observe heap memory failure (HEAPMGR_METRICS is enabled), while connecting with iPhone (MTU set to 250) and doing data transfer.

HeapmemFail =2 (please see below pic). SRAM usage (r/w data from linker map) is 29646 bytes.(90.47%  of 32kB). I have not enabled the Cache RAM.

After enabling Cache RAM also I observe Heap memory failure as below:

Could you please let me know what could be the reason for heap mem failure ?

  • Hi,

    Thank you for reaching out.

    The first element I can think of is the impossibility of the system to find enough consecutive memory to allocate. This is more likely to happen when a large allocation is attempted after long operation time.

    It would be interesting to have more details on the memory allocation that lead to this heap mem failure. Among others, it would be interesting to know the length of the allocation attempted and the state of the RAM at that point.

    I hope this will help,

    Best regards,

  • Hi Clement,

    The first element I can think of is the impossibility of the system to find enough consecutive memory to allocate. This is more likely to happen when a large allocation is attempted after long operation time.

    Thanks for the input. But i observe it immediately after starting data transfer (with mtu set to 250)

    It would be interesting to have more details on the memory allocation that lead to this heap mem failure. Among others, it would be interesting to know the length of the allocation attempted and the state of the RAM at that point.

    RAM allocation is 29646 bytes. Could you guide me how to check the state of RAM at that point in time?

    We observe this issue when more than 245MTU is set, but not if the MTU is set to 200bytes.

  • Hi Ddnr,

    First off, I always recommend to stay up to date with the newest sdk.

    Do you have multiple BLE connections or just one?

    How quick does the memory seems to fill up?

    Kind Regards,

    Rogelio

  • Thanks for the info. We have already in the migration process.

    Only one BLE connection.

    How quick does the memory seems to fill up?

    Immediately on connection, or immediately on starting data transfer (immediately means within 2-3 seconds).

  • Hi Ddnr,

    With only one connection there should be any memory issues unless your application is using a lot. 

    What example is your application based on, and what changes were done.

    Kind Regards,

    Rogelio