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.

CC2642R: ICall_clockFunc - Timeout set to 89999700 after 'GAP_DeviceInit()' which returns 'SUCCESS' seems to cause scheduling issues

Part Number: CC2642R
Other Parts Discussed in Thread: CC2640R2F

Hi,

i'm observing some strange behaviour. My device is advertising and it seems like it's running. Additionally it seems like it does not dequeue any enqueued messages anymore in the task managing the advertising.

I'm receiving some messages and including GAP_DEVICE_INIT_DONE and i'm starting the creation of Advertising-Sets as well as advertising itself after this event. Sadly i won't get any message like 'GAP_EVT_ADV_START' or similar. Due to the assumed scheduling issue i've looked into the Clock module using the ROV. There i saw my callbacks for the clock event as well as some 'ICall_clockFunc' including the timeouts and the remaining time. There i saw the 'ICall_clockFunc' has been set to '89999700' which i interpreted as faulty. After observing this i tracked down the point at which this timeout is set. It looks like 'GAP_DeviceInit' is causing this timeout to be set.

Using a CC2640R2F application this timeout is present too but set to 2700 which seems much more correct.

Do i have to add some initialization steps or set this timeout manually to a correct value?

Thanks for your answers.

Best regards,
Jan

  • Hi Jan,

    Assigning an expert to reproduce and comment.

  • Hi Jan, 

    Which version of the SDK and which project are you using? 

    Thanks,
    Elin

  • Hi Elin,

    i'm using the Simple-Peripheral project extended with my own application logic. The SDK Version is 3.20.0.68.

    Thanks,
    Jan

  • Hi,

    additionally it seems like i'm not able to update the advertising data using 'GapAdv_prepareLoadByHandle()' and 'GapAdv_loadByHandle()' due to some memory issues. The cpu-registers are indicating an HardFault when updating/accessing the data. The same happens when trying to update the scan response. An initial setup when starting advertising is working fine.

    What i'm wondering about too is that it seems like i'm not getting any advertising callbacks. It seems like it's just not calling the function. Maybe there's something related to the corrupted clock-timeout for the ICall task. Maybe that's why these callbacks are not called.

    Is there a way to modify this timeout directly or by project configuration?

    Best regards,
    Jan

  • Hi Jan, 

    I'm working with your problem but haven't been able to reproduce the issue yet. 

    I'll get back to you with an update at the end of this week.

    Thanks, 
    Elin

  • Hi Jan, 

    I'm not able to reproduce this using only the simple_peripheral project, do you see the same issue without your application logic?

    What kind of HardFault are you getting? 

    Do you have a sniffer log you can share? 

    I'm unsure about how to modify the timeout since I don't know which timeout it is. Can you share some more insight about the timeout? 

    Thanks, 
    Elin

  • Hi Elin,

    it looks like some changes and multiple full rebuilds solved the problem. I'm receiving all callbacks and events and it seems like the application is working. The timeout is reset and initialized with values which seem much more reasonable.

    Now i'm facing another problem.

    When i'm scanning for devices (i've implemented a peripheral + central mode) i'll find devices but after some time the scan simply stops without any event like 'GAP_EVT_SCAN_DISABLED' or similar. Either the scan stops and i'm not able to restart it due to the lack of information about the stopped scan or the heap memory is corrupted during the scan process which leads to a hard-fault (CPU exception register == 0x03). This does even happen without my application logic.

    Many thanks for your help!

    Best regards,
    Jan

  • Hi Elin,

    actually i don't know what happend from yesterday to today but it seems like it's working right now. Maybe some extended power-down and complete cleaning of the project folders have solved the problem for me. Sadly i can't tell what caused the problem.

    I think you can assume this issue as resolved!

    Thanks for your effort you put into it.

    Best regards,

    Jan