cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 Watch dog

nps
Associate II
Posted on May 25, 2016 at 10:23

Hi,

I enabled WDT in STM32F407 controller and I have a very tight loop which is resetting the flag. Here is the code

    RCC_APB1PeriphClockCmd(RCC_APB1Periph_WWDG, ENABLE);

    WWDG_SetPrescaler(WWDG_Prescaler_8);

    WWDG_SetWindowValue(0x41);

    WWDG_Enable(0x7F);

    WWDG_ClearFlag();

    while (1)

     {

      WWDG_SetCounter (127)

       WWDG_ClearFlag();

       }

However WDT is resetting my controller. What have I missed? Thank you for your time.

Partha

4 REPLIES 4
Nesrine M_O
Lead II
Posted on May 25, 2016 at 11:28

Hi Partha,

Please have a look to the WWDG example under the STM32F4 standard peripheral library:  

STM32F4xx_DSP_StdPeriph_Lib_V1.7.0\Project\STM32F4xx_StdPeriph_Examples\WWDG\WWDG_Example

This example shows how to update at regular period the WWDG counter and how to simulate a software fault generating an MCU WWDG reset on expiry of a programmed time period.

-Syrine-
nps
Associate II
Posted on May 25, 2016 at 12:15

Hi Syrine,

Unfortunately I am not able to locate the library on st site. I tried searching but to no avail. Could you post a link please? Thank you.

Nesrine M_O
Lead II
Posted on May 25, 2016 at 12:29

Hi Partha,

The STM32F4 standard peripheral library is available for download under this

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32-standard-peripheral-libraries/stsw-stm32065.html

-Syrine-

nps
Associate II
Posted on June 01, 2016 at 02:48

Hi Syrine,

Thank you very much for the link.

Partha