cancel
Showing results for 
Search instead for 
Did you mean: 

Can't Init RTC on STM32F4 by STM32CubeMX

3120202238
Associate
Posted on December 28, 2014 at 09:16

to be migrated, sourceId: 2290:0EA5537E-3674-4A46-8D71-9B00EC9F6F4B

2 REPLIES 2
stm32cube-t
Senior III
Posted on January 08, 2015 at 16:01

Hello,

There is a known issue with STM32CubeMX generated code missing some macros in stm32f4xx_hal_msp.c.

Please update the file as follows:

void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)

{

  if(hrtc->Instance==RTC)

  {

  /* USER CODE BEGIN RTC_MspInit 0 */

  /* USER CODE END RTC_MspInit 0 */

    /* Peripheral clock enable */

    __HAL_RCC_RTC_ENABLE();

 

  /* USER CODE BEGIN RTC_MspInit 1 */

  /* USER CODE END RTC_MspInit 1 */

  }

}

void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)

{

  if(hrtc->Instance==RTC)

  {

  /* USER CODE BEGIN RTC_MspDeInit 0 */

  /* USER CODE END RTC_MspDeInit 0 */

    /* Peripheral clock disable */

    __HAL_RCC_RTC_DISABLE();

 

  /* USER CODE BEGIN RTC_MspDeInit 1 */

  /* USER CODE END RTC_MspDeInit 1 */

  }

}

randy2
Associate II
Posted on December 30, 2014 at 17:32

What board or chip are you using?