STM32F103 - IWDG usage

Version 1

    Hi,

     

    I had to do some tests with the IWDG of the F103.

     

    There is no code example in the Cube for either of the boards.

     

    So here is one code to enable the IWGD by software on the STM32F103 Discovery kit.

     

    I tested a code on STM32F103 discovery kit and I can see that the IWDG is working properly.

     

    I am setting the timeout of the IWDG to 1 second.

     

    In my infinite loop I refresh the watchdog every 100 ms: the code is running properly and no reset is generated by IWDG

     

    Now if in my infinite loop I remove the refresh then I see that as expected every second I get a reset (by monitoring NRST line on the scope: you can see the NRST being asserted every second).

     

    A very simple code to show you how to enable and use the IWDG.

     

    Tested on the STM32F013 Discovery kit.

     

    You will need to download the F1 Cube library (link to the latest version here: http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef1.html)

     

    Code attached should be unzipped at the following location in your F1 Cube Library (tested with version 1.4.0):

     

    STM32Cube_FW_F1_V1.4.0\Projects\STM32VL-Discovery\Examples\IWDG

     

    (IWDG needs to be created).

     

    Best Regards.

     

    Nicolas.