AnsweredAssumed Answered

Bug Report: stm32f2xx_hal_wwdg.c

Question asked by Walter.Andreas on Jan 26, 2016
Latest reply on Jan 27, 2016 by Nesrine M
Hello there,

I was trying to activate WWDG using STM32CubeF2 v1.1.1 and got problems when trying to use HAL_WWDG_Start_IT. The handle was kept in lock state.
Comparing with HAL_WWDG_Start I miss a call to __HAL_UNLOCK(hwwdg);

Please have a look at the code sample. Am I missing somthing, or is realy the unlock call missing in the library.

Best regards
Andreas

/**
  * @brief  Starts the WWDG.
  * @param  hwwdg: WWDG handle
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_WWDG_Start(WWDG_HandleTypeDef *hwwdg)
{
  /* Process Locked */
  __HAL_LOCK(hwwdg);
 
  /* Change WWDG peripheral state */  
  hwwdg->State = HAL_WWDG_STATE_BUSY;

  /* Enable the peripheral */
  __HAL_WWDG_ENABLE(hwwdg);  
 
  /* Change WWDG peripheral state */    
  hwwdg->State = HAL_WWDG_STATE_READY;
 
  /* Process Unlocked */
  __HAL_UNLOCK(hwwdg);
 
  /* Return function status */
  return HAL_OK;
}

/**
  * @brief  Starts the WWDG with interrupt enabled.
  * @param  hwwdg: WWDG handle
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_WWDG_Start_IT(WWDG_HandleTypeDef *hwwdg)
{   
  /* Process Locked */
  __HAL_LOCK(hwwdg);
 
  /* Change WWDG peripheral state */  
  hwwdg->State = HAL_WWDG_STATE_BUSY;
 
  /* Enable the Early Wakeup Interrupt */
  __HAL_WWDG_ENABLE_IT(WWDG_IT_EWI);

  /* Enable the peripheral */
  __HAL_WWDG_ENABLE(hwwdg);  
 
  /* Return function status */
  return HAL_OK;
}

Outcomes