Part Number: CC2640R2F
Tool/software: TI-RTOS
Hi ,sir :
I am developing a beacon like ble product, so I need to scan endlessly in my program. My product is based on TI CC2640R2F+simplelink_cc2640r2_sdk_1_30_00_25, and my program is based on multi_role which comes with the sdk.
currently, I manage the feature by start another scan(calling GAPRole_StartDiscovery with defaults parameters) when I get GAP_DEVICE_DISCOVERY_EVENT in multi_role_processRoleEvent.
However, my board often hangs after a while,approximately, sevaral thounsands times.
Then I switch from my product board to LaunchPad with the default multi role demo by adding the sevaral lines:
1.add GAPRole_StartDiscovery(DEFAULT_DISCOVERY_MODE,DEFAULT_DISCOVERY_ACTIVE_SCAN, DEFAULT_DISCOVERY_WHITE_LIST); when I got GAP_MAKE_DISCOVERABLE_DONE_EVENT
2.add GAPRole_StartDiscovery(DEFAULT_DISCOVERY_MODE,DEFAULT_DISCOVERY_ACTIVE_SCAN, DEFAULT_DISCOVERY_WHITE_LIST); when I got GAP_DEVICE_DISCOVERY_EVENT.
Unfortunately, the problem remains.
Here, I got some clues by attach xds110 to Launch Pad(I pause the debugger when system are freezing):
1.when system hangs, scanerrors in ROV says that "All ROV views have been run and no errors were encountered. In BIOS, this includes a check of the System stack usage and all Task stacks."
2.ICall_taskEntry remains in running mode, and other tasks would not be scheduled by cpu. I try to do some debugging in the loop
for(;;) // Forever Loop
#endif
{
osal_run_system();
#ifdef USE_ICALL
ICall_wait(ICALL_TIMEOUT_FOREVER);
#endif /* USE_ICALL */
}
and found that ICall_wait will not make the stack task switch to blocking mode.
So, could any one give me some suggestions?