Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop watchdog #628

Open
Zaltora opened this issue May 28, 2018 · 8 comments
Open

stop watchdog #628

Zaltora opened this issue May 28, 2018 · 8 comments

Comments

@Zaltora
Copy link
Contributor

Zaltora commented May 28, 2018

How can i stop watchdog or feed him in a infinite loop ?

I want shutdown my device properly. In a function, i suspend FreeRTOS, set some level pin and i want finish by a infinite loop until the device is off.

@ourairquality
Copy link
Contributor

Perhaps the function sdk_wdt_init() in app_main.c would give some clues. There is a hardware wdt and one of the mac timers is used for a soft wdt. Perhaps the following keep both fed:

WDT.FEED = WDT_FEED_MAGIC;
sdk_wDev_MacTim1Arm(1600000);

@Zaltora
Copy link
Contributor Author

Zaltora commented May 29, 2018

it did not work. I added these two lines in the loop and add the include.
FreeRTOS must do it with the idle task or the tick hook.
I did not find where exactly FreeRTOS manages the watchdog.

@ourairquality
Copy link
Contributor

FreeRTOS does not appear to have anything to do with the wdt. The wdt appears to be fed from the wifi binary, the soft wdt from the mac counter. Perhaps the wifi layer is failing and hitting some assertion, e.g. if the NMI is disabled for too long it asserts. Perhaps try some of the following:

WDT.CTRL &= ~WDT_CTRL_ENABLE;
DPORT.INT_ENABLE &= ~DPORT_INT_ENABLE_WDT;
pp_soft_wdt_count = 0;

@Zaltora
Copy link
Contributor Author

Zaltora commented May 29, 2018

i try this without succes:

        while(1)
        {
            WDT.FEED = WDT_FEED_MAGIC;
            sdk_wDev_MacTim1Arm(1600000);
            sdk_pp_soft_wdt_feed();

            WDT.CTRL &= ~WDT_CTRL_ENABLE;
            DPORT.INT_ENABLE &= ~DPORT_INT_ENABLE_WDT;
            //pp_soft_wdt_count = 0;
        }

pp_soft_wdt_count seem unknow ?

Is not FreeRTOS taking care of the watchdog?
How can the wifi binary take the hand to reset the watchdog?
I assumed that FreeRTOS was doing it because when I did a task without delay, it reboot.

PS: And it is reboot (wdt rst) when you disable all RTOS task.

@Zaltora
Copy link
Contributor Author

Zaltora commented May 29, 2018

PS2: the code above make the system break;

        while(1)
        {
           // WDT.FEED = WDT_FEED_MAGIC;
           // sdk_wDev_MacTim1Arm(1600000);
           // sdk_pp_soft_wdt_feed();

            WDT.CTRL &= ~WDT_CTRL_ENABLE;
            DPORT.INT_ENABLE &= ~DPORT_INT_ENABLE_WDT;
            //pp_soft_wdt_count = 0;
        }

don't work too. Automatic reset after some seconds

@Zaltora
Copy link
Contributor Author

Zaltora commented Jun 7, 2018

i will try to enter in deep sleep mode to work around the problem.
I hope the gpio16 pin does not change state during the transition. (state: 0 logic)

@SmartArduino
Copy link

Did you find a way to stop

@SmartArduino
Copy link

This issue has been resolved because flash SPI speed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants