2025-04-08 10:57 AM - last edited on 2025-04-08 12:39 PM by mƎALLEm
Hi,
1) I'm using the Nucleo-L496ZG board. I 'am working on Independent Watchdog timer. I'm facing an issue that is my timeout value is 15msec, reload value is 29, so my watchdog refresh should happen till 14msec. But iam unable to refresh the watchdog timer at 14 msec. why?
2)How to se the value of IWDG Window value in IWDG configuration. And how to disable it? what is importance of it in IWDG?
Could anyone please assist me on this.
Below is my sample code.
#include "main.h"
/* Private variables ---------------------------------------------------------*/
IWDG_HandleTypeDef hiwdg;
UART_HandleTypeDef hlpuart1;
PCD_HandleTypeDef hpcd_USB_OTG_FS;
/* USER CODE BEGIN PV */
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_LPUART1_UART_Init(void);
static void MX_USB_OTG_FS_PCD_Init(void);
static void MX_IWDG_Init(void);
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
/**
* @brief The application entry point.
* @retval int
*/
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14,GPIO_PIN_RESET);
HAL_Delay(500);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14,GPIO_PIN_SET);
HAL_Delay(500);
// MX_LPUART1_UART_Init();
// MX_USB_OTG_FS_PCD_Init();
MX_IWDG_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
HAL_Delay(15);
HAL_IWDG_Refresh(&hiwdg);
/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}
2025-04-09 9:26 AM
Hello @Akhila_17
Please refer to these examples below in STM32CUBEL4.
Projects/STM32L476G-EVAL/Examples/IWDG