Skip to main content
keebler411
Associate II
January 21, 2019
Question

CRC module init code

  • January 21, 2019
  • 2 replies
  • 1311 views

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?

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
January 21, 2019

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.

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
MNapi
Senior II
January 21, 2019

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 */

}

Tesla DeLorean
Guru
January 21, 2019

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();
}

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..