2019-01-21 09:41 AM
Is STM32CubeMX v5.01 supoosed to generate CRC intializtion code? All I get is an empty MX_CRC_Init() function and no handle is created. Is this a bug? I can copy the init code from an example but I'm wondering how/where the CRC clock gets enabled or do I need to worry about this?
2019-01-21 10:50 AM
CubeMX tends to hide clock/pin stuff in the MSP callback code, would suggest grepping the source until you find it, or add it manually.
2019-01-21 01:39 PM
This is what I get in Cube Mx
static void MX_CRC_Init(void)
{
/* USER CODE BEGIN CRC_Init 0 */
/* USER CODE END CRC_Init 0 */
/* USER CODE BEGIN CRC_Init 1 */
/* USER CODE END CRC_Init 1 */
hcrc.Instance = CRC;
if (HAL_CRC_Init(&hcrc) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN CRC_Init 2 */
/* USER CODE END CRC_Init 2 */
}
2019-01-21 01:46 PM
The OP's also looking for this portion, nominally in stm32f7xx_hal_msp.c
/**
* @brief CRC MSP Initialization
* This function configures the hardware resources used in this example:
* - Peripheral's clock enable
* @param hcrc: CRC handle pointer
* @retval None
*/
void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc)
{
/* CRC Peripheral clock enable */
__HAL_RCC_CRC_CLK_ENABLE();
}