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: Watchdog reset during continuous scan

Part Number: CC2642R

Hi,

I'm using SDK 6.0.10.29 and basing off a Multi-Role example. I've set up a Watchdog timer for 3 seconds, and I've stuck Watchdog_clear(watchdogHandle); in the for (;;) of  multi_role_taskFxn function. I need to set up a GAP_scan for about a minute in sequence, but I'm getting watchdog resets after 3 seconds.

My question is, do I need to either disable Watchdog during scanning, or set it to a duration longer than 1 minute, or is there a place where I can stick Watchdog_clear(watchdogHandle); to avoid reset without changing Watchdog parameters.

Thanks

  • Hi Eyal,

    I have assigned an expert to help with your query.

    Best Regards,

    Jan

  • Hi Eyal,

    Thank you for posting on the E2E forums! One place you could put Watchdog_clear() would be in MR_EVT_ADV_REPORT in multi_role_processAppMsg(). Every time a device is scanned this event is triggered. Alternatively, you can place a breakpoint where you're calling Watchdog_clear() to see if you're ever reaching that point and increase the timer as necessary. 

    Please let me know if that helps.

    Best,

    Nima 

  • Hi Nima, 

    MR_EVT_ADV_REPORT won't matter because to trigger MR_EVT_ADV_REPORT you need to pass through multi_role_taskFxn anyways and a reset clear is there already. Plus, in the system I have planned, I can't guarantee a scan report would be available every 3 seconds.

    The code only enters multi_role_taskFxn once to trigger the scan enable event, and then doesn't enter it again unless there's a device scanned. The MCU however is not in idle mode when the scan is enabled, and I have no idea where the code hangs during this time and if it's even possible to add a reset clear there. 

    If you don't know the code section in which the MCU hangs during scanning, or if it's an uneditable location, then I'll just resort to cancelling Watchdog during this time although I'd prefer not to.

    Eyal

  • Hi Eyal,

    Another method could be creating a periodic task that clears the watchdog timer. For instance, since the watchdog timer is set to 3 seconds, having a periodic task to call Watchdog_clear() every second will clear the flag and ensure scanning continues. 

    Best,

    Nima Behmanesh

  • That's actually a simple and decent solution thanks