STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
stm32f7xx_hal_wwdg.c File Reference

WWDG HAL module driver. This file provides firmware functions to manage the following functionalities of the Window Watchdog (WWDG) peripheral: More...

#include "stm32f7xx_hal.h"

Go to the source code of this file.

Detailed Description

WWDG HAL module driver. This file provides firmware functions to manage the following functionalities of the Window Watchdog (WWDG) peripheral:

Author
MCD Application Team
Version
V1.1.0
Date
22-April-2016
  • Initialization and Configuration function
  • IO operation functions
    ==============================================================================
                        ##### WWDG specific features #####
    ==============================================================================
    [..]
      Once enabled the WWDG generates a system reset on expiry of a programmed
      time period, unless the program refreshes the counter (T[6;0] downcounter)
      before reaching 0x3F value (i.e. a reset is generated when the counter
      value rolls over from 0x40 to 0x3F).
    
      (+) An MCU reset is also generated if the counter value is refreshed
          before the counter has reached the refresh window value. This
          implies that the counter must be refreshed in a limited window.
    
      (+) Once enabled the WWDG cannot be disabled except by a system reset.
    
      (+) WWDGRST flag in RCC_CSR register informs when a WWDG reset has 
          occurred (check available with __HAL_RCC_GET_FLAG(RCC_FLAG_WWDGRST)).
    
      (+) The WWDG downcounter input clock is derived from the APB clock divided
          by a programmable prescaler.
    
      (+) WWDG downcounter clock (Hz) = PCLK1 / (4096 * Prescaler)
    
      (+) WWDG timeout (ms) = (1000 * (T[5;0] + 1)) / (WWDG downcounter clock)
          where T[5;0] are the lowest 6 bits of downcounter.
    
      (+) WWDG Counter refresh is allowed between the following limits :
          (++) min time (ms) = (1000 * (T[5;0] - Window)) / (WWDG downcounter clock)
          (++) max time (ms) = (1000 * (T[5;0] - 0x40)) / (WWDG downcounter clock)
    
      (+) Min-max timeout value @80 MHz(PCLK1): ~51.2 us / ~26.22 ms
    
      (+) The Early Wakeup Interrupt (EWI) can be used if specific safety 
          operations or data logging must be performed before the actual reset is
          generated. When the downcounter reaches the value 0x40, an EWI interrupt
          is generated and the corresponding interrupt service routine (ISR) can 
          be used to trigger specific actions (such as communications or data 
          logging), before resetting the device.
          In some applications, the EWI interrupt can be used to manage a software
          system check and/or system recovery/graceful degradation, without 
          generating a WWDG reset. In this case, the corresponding interrupt 
          service routine (ISR) should reload the WWDG counter to avoid the WWDG 
          reset, then trigger the required actions.
          Note:When the EWI interrupt cannot be served, e.g. due to a system lock 
          in a higher priority task, the WWDG reset will eventually be generated.
    
      (+) Debug mode : When the microcontroller enters debug mode (core halted),
          the WWDG counter either continues to work normally or stops, depending 
          on DBG_WWDG_STOP configuration bit in DBG module, accessible through
          __HAL_DBGMCU_FREEZE_WWDG() and __HAL_DBGMCU_UNFREEZE_WWDG() macros
    
                       ##### How to use this driver #####
    ==============================================================================
    [..]
      (+) Enable WWDG APB1 clock using __HAL_RCC_WWDG_CLK_ENABLE().
    
      (+) Set the WWDG prescaler, refresh window, counter value and Early Wakeup 
          Interrupt mode using using HAL_WWDG_Init() function.
          This enables WWDG peripheral and the downcounter starts downcounting 
          from given counter value.
          Init function can be called again to modify all watchdog parameters, 
          however if EWI mode has been set once, it can't be clear until next 
          reset.
    
      (+) The application program must refresh the WWDG counter at regular
          intervals during normal operation to prevent an MCU reset using
          HAL_WWDG_Refresh() function. This operation must occur only when
          the counter is lower than the window value already programmed.
    
      (+) if Early Wakeup Interrupt mode is enable an interrupt is generated when 
          the counter reaches 0x40. User can add his own code in weak function 
          HAL_WWDG_EarlyWakeupCallback().
    
       *** WWDG HAL driver macros list ***
       ==================================
       [..]
         Below the list of most used macros in WWDG HAL driver.
    
        (+) __HAL_WWDG_GET_IT_SOURCE: Check the selected WWDG's interrupt source.
        (+) __HAL_WWDG_GET_FLAG: Get the selected WWDG's flag status.
        (+) __HAL_WWDG_CLEAR_FLAG: Clear the WWDG's pending flags.
Attention

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32f7xx_hal_wwdg.c.