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

Reconnecting Feather WICED to Wifi #83

Open
danielcompton opened this issue May 13, 2018 · 1 comment
Open

Reconnecting Feather WICED to Wifi #83

danielcompton opened this issue May 13, 2018 · 1 comment

Comments

@danielcompton
Copy link

danielcompton commented May 13, 2018

This is just a tracking issue to follow along for https://forums.adafruit.com/viewtopic.php?f=57&t=114903. As best as I could tell it still hasn't been resolved, although there is a workaround provided of using a watchdog timer to reset the board if it hangs. More info on watchdog timers at http://librambutan.readthedocs.io/en/latest/libmaple/api/iwdg.html.

#include <iwdg.h>

// ...

// turn on to recover after hang
boolean useWDT = true;

void setup()
{
  //...

   if( useWDT )
  {
    iwdg_init(IWDG_PRE_128, 11500000);
  }
}

void loop()
{
// ...
  # Call this to reset the watchdog timer.
  # If it isn't called then the board will reset.
  iwdg_feed();

}

@dabrams
Copy link

dabrams commented Aug 4, 2018

The Watch Dog Timer in the STM32F205 is only 12 bits with an 8 bit prescaler. See https://www.st.com/resource/en/datasheet/stm32f205rb.pdf

"3.20.4 Independent watchdog
The independent watchdog is based on a 12-bit downcounter and 8-bit prescaler. It is
clocked from an independent 32 kHz internal RC and as it operates independently from the
main clock, "

so

iwdg_init(IWDG_PRE_128, 11500000); // does not make sense

While idwg.h shows:

void iwdg_init(iwdg_prescaler prescaler, uint16 reload)

only the lower 12 bits of the 16-bit reload value are used.

The longest WDT delay is

iwdg_init(IWDG_PRE_256, 0xfff);

This gives a time out of 1/32kHz * 256 * 4095 or about 32.8 seconds.

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

2 participants