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.

RTOS/CC2640R2F: a problem in endless scan

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?

  • 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 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 debug 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 stack task switch to blocking mode.

    So, could any one give me some suggestions?

  • Hello,

    Have you checked to see if the ICall heap has been exhausted, perhaps by a mem leak?

    Best wishes
  • Hi, Thanks for your reply.
    I checked sevaral values of HEAP, it is OK and there is no HEAPMGR_MEMFAIL.
  • Hi JXS , do you have any other suggestions?
  • Hi Jimmy,

    Unfortunately no. If you can provide a complete sample application for the LaunchPad, I can have someone run it after the holiday.

    Best wishes
  • Thanks for you help.

    Here is my sample application. Since the rar file is too big to upload, I put it into a netdisk. You can get the application from

    pan.baidu.com/s/1qXB063y

    If you have questiones in fetching the file , please let me know. 

  • Hi JXS, I wish you could help me look at my sample in the netdisk if you have any spare time.

    Thanks a lot.
  • Hi JXS,have you found any clues to this problem?

    Thanks a lot!

  • Hi Jimmy,

    We are not able to access the netdisk link. Can you attach the project to E2E or use www.box.com? You can access the attachment option by selected "Use rich formatting".

    Thank you.

    Best wishes
  • multi_role.rar

    Hi JXS, I upload the whole sample application to e2e. Thanks for your help.

  • Forgot to tell you that this is a iar7.8 project.

    Looking forward to your reply.

  • Hi Jimmy,

    Any updates from TI? I also am facing a similiar situation.
    I think that this issue is derived from the task pending/posting/yield issue.

    Let me know if any updates or shares.

    BR,
    Ji Won
  • Sadly, I have not got any replies from TI. I am planning to enable watchdog in my product board to solve this problem.

  • Thanks Jimmy,

    I also did it, but I am trying to solve this issue clearly.

    But not yet.

    BR,

    Ji Won