![]() ![]() * * This software component is licensed by ST under BSD 3-Clause license, * the "License" You may not use this file except in compliance with the * License. Try to comment out the HAL_Delay(), try to replace HAL_GPIO_TogglePin() to HAL_GPO_WritePin() and see what happens.Īlso with the EWI enabled, try to refresh the WWDG too early and see if ISR is executed. In fact the HAL_GPIO_TogglePin() is not even fully executed. ![]() As the reset happens every 52ms, we might misinterpret the LED toggling as our ISR routine. The reset is forcing the led to turn off as the WWDG is giving the MCU only 1 clock cycle to do anything important. The on-board led is not being toggled every 20ms. In Case 4, we see something quite interesting. We have configured and tested the Window watchdog of STM32F401RE in various scenarios. Description of STM32F4 HAL and low-layer drivers Note: In case if you need complete information about HAL libraries for STM32F4 and how to use them, please refer to the manual UM1725. only after the down counter counts down to 0x3F (decimal: 63). But the reset is triggered every 52ms, i.e. 780us before reset, which is exactly one WWDG clock cycle before. We can see that the Interrupt is generated ca. This activates the WWDG with the default configuration as displayed in the section 3 in the below image. A window appears showing WWDG configuration. On the left pane, expand- System Core and select- WWDG. Refer to the attached file for details- 'Create STM32CubeMX project'.Ģ. Create a project in STM32CubeMX from the board selector. This is an advance feature in WWDG which is not available in IWDG.ġ. We will observe on the oscilloscope that the ISR is executed before initiating a MCU reset. Case 4: We will enable the EWI interrupt and write a routine to toggle the on-board Green LED there.Case 3: We will refresh the WWDG too early and check that a reset is triggered.Case 2: Include our routine to refresh it within the window and see that no reset is initiated by the WWDG.We will monitor the reset line using Digilent- Analog Discovery (Legacy) instrument. Case 1: Activate WWDG and we will not refresh the WWDG and check that a reset is triggered, by the time down counter WWDG_CR is elapsed.In this project we will, configure and test these cases. The following image shows a snapshot form STM32CubeMX. Unlike IWDG, WWDG is clocked by the APB1 peripheral clock. IWDG offers no Interrupt Service Routine (ISR) where as WWDG does.IWDG does not offer a window for refresh.It then initiates a MCU reset, which will help to start the software all over again.įrom the functionality stand point, there are two major differences between IWGD and WWDG. In case of any abnormality from the normal sequence of program execution- software fault, the watchdog detects it. Some knowledge of STM32CubeMX, Keil MDK, GPIOs, Counters are assumed from the reader to follow along.Īs the name watchdog suggests, it is watching the application running on the MCU. petting (refreshing) too late or too early. Also we will see what will happen if you don't pet your watchdog within the window i.e. ![]() In this project we will see how to activate and periodically pet the dog, I mean refresh the watchdog. STM32F401xD/E has two Watchdog timers- Independent watchdog (IWDG) and Window watchdog (WWDG). ![]()
0 Comments
Leave a Reply. |