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.

HAL ASSERT after write blob request



Hi,

I am using the simpleBLECentral and SimpleBLEPeripheral applications. The sample code given reads/writes 1 byte of data in the simple GATT profile :- simpleProfileChar1

I modified the profile to write 40 bytes of data. I am using an array to store the value. For writing to the peripheral i am using GATT_WriteLongCharValue() api.

It is able to write the data to the peripheral side but when the coming back to the central it is ASSERTing.

I enabled the HAL_ASSERT() and found that the error is due to freeing an unallocated memory due to BLE Stack library.

In osal_mem_free() library function it is trying to free a memory address 0x1049 while heap starts from 0x1084. As a result below condition fails:-
HAL_ASSERT(((uint8 *)ptr >= (uint8 *)theHeap) && ((uint8 *)ptr < (uint8 *)theHeap+MAXMEMHEAP));

Call stack:-
osal_mem_free
gattResetClientInfo
gattClientProcessMsgCB
gattProcessRxData
GATT_ProcessEvent
osal_run_system

Can you suggest me workaround for this problem ?