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.

CC2640: Peripheral+Observer stuck at HAL_ASSERT_SPINLOCK

Part Number: CC2640


Hi Team,

My customer implements peripheral + Observer with CC2640 based on the Github example,but the program will stuct at HAL_ASSERT_SPINLOCK. 

1.If disable the Observer function, no error will occur.

2.Enable the Observer function, if setting DEFAULT_MAX_SCAN_RES  = 20, the program will down in 30s;  if setting it to 1, the program can run 5 minutes before stuck.

He called ICall_freeMsg(pEvent) for every message queue that the callback function sent. Is this about memory management or something else?

Code snippet:

void AssertHandler(uint8 assertCause, uint8 assertSubcause)
{
// check the assert cause
switch (assertCause)
{
case HAL_ASSERT_CAUSE_OUT_OF_MEMORY:
break;

case HAL_ASSERT_CAUSE_INTERNAL_ERROR:
// check the subcause
if (assertSubcause == HAL_ASSERT_SUBCAUSE_FW_INERNAL_ERROR)
{

}
else
{
;
}
break;

case HAL_ASSERT_CAUSE_ICALL_ABORT:
HAL_ASSERT_SPINLOCK;
break;

default:
HAL_ASSERT_SPINLOCK;
}

return;
}

assertCause = 8 and  has the following definition:

// Common Assert Causes (0x00 .. 0x1F)
#define HAL_ASSERT_CAUSE_FALSE 0x00
#define HAL_ASSERT_CAUSE_TRUE 0x01
#define HAL_ASSERT_CAUSE_INTERNAL_ERROR 0x02
#define HAL_ASSERT_CAUSE_HW_ERROR 0x03
#define HAL_ASSERT_CAUSE_OUT_OF_MEMORY 0x04
#define HAL_ASSERT_CAUSE_ICALL_ABORT 0x05
#define HAL_ASSERT_CAUSE_ICALL_TIMEOUT 0x06
#define HAL_ASSERT_CAUSE_WRONG_API_CALL 0x07
#define HAL_ASSERT_CAUSE_HARDWARE_ERROR 0x08
#define HAL_ASSERT_CAUSE_RF_DRIVER_ERROR 0x09
#define HAL_ASSERT_CAUSE_UNEXPECTED_ERROR 0x0A

Viki

Best Regards.