Tool/software: Code Composer Studio
Hi,
On every connect + disconnect, the MCU loses 8 bytes of heap memory.
Here are the steps to reproduce:
1. run ble5_simple_peripheral_cc26x2r2lp_app project on the relevant LaunchPad.
2. constantly print the total free size of the heap using
uint32_t heap_now = heap_stat.totalFreeSize; Display_print1(dispHandle, 15, 0, "heap now: 0x%x", heap_now);
3. notice: the free heap size before connecting is larger in 8 bytes than the total free heap size after disconnecting.
I've noticed you skip in your code on the deallocation of connHandle:
case SP_SEND_PARAM_UPDATE_EVT: { // Extract connection handle from data uint16_t connHandle = *(uint16_t *)(((spClockEventData_t *)pMsg->pData)->data); SimplePeripheral_processParamUpdate(connHandle); // This data is not dynamically allocated dealloc = FALSE; break; }
What makes sense since we're still in connection on that point. But, I haven't notices the deallocation anywhere else... is that might be it?
I would appreciate your help,
Amit