2016-01-26 05:30 AM
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; }2016-01-26 06:30 AM
Hi Andreas,
Please try to use the latest version of the STM32F2 cube firmware package, there was an issue with the management of the IT macro on the V1.1.0, but it was fixed since the version V1.2.0-Syrine-2016-01-26 07:49 AM
Hi Syrine,
I performed an update of Cube and the firmware packages in use. The newly generated file seems to contain the same problem. I attached the file. Best regards Andreas ________________ Attachments : stm32f2xx_hal_wwdg.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htf1&d=%2Fa%2F0X0000000aVV%2FNwfo8izeCb3Wf0E2t2QxVrc71_5H_9v_cKFPGsOVhiQ&asPdf=false2016-01-26 08:35 AM
Hi Andreas,
For the WWDG Start with interrupt enabled the Unlock process is added in the WWDG handler ( HAL_WWDG_IRQHandler() ) that should be called in the stm32f2xx_it file -Syrine-2016-01-26 10:22 AM
Hi Syrine,
so it is not meant to perform a HAL_WWDG_Refresh from outside the the ISR. That seems strange to me. In that case, I have to wait for the first early wakeup interrupt before being able to trigger the watchdog from my normal application? Beside that, the lock is taken away at the end of the IRQ_Handler, so not even using HAL_WWDG_WakeupCallback would allow to refresh the watchdog. Best regards Andreas2016-01-27 02:45 AM
Hi Andreas,
I understood your issue, I'll report it to our team for checking. Please be patient when I could get some updated info.-Syrine-