Skip to main content
EDuat.1
Associate II
December 15, 2020
Solved

Bug in RTC CubeMX code generate

  • December 15, 2020
  • 4 replies
  • 1244 views
static void MX_RTC_Init(void)
 
{
 
 
 
 /* USER CODE BEGIN RTC_Init 0 */
 
 
 
 /* USER CODE END RTC_Init 0 */
 
 
 
 LL_RTC_InitTypeDef RTC_InitStruct = {0};
 
 LL_RTC_TimeTypeDef RTC_TimeStruct = {0};
 
 LL_RTC_DateTypeDef RTC_DateStruct = {0};
 
 
 
 /* Peripheral clock enable */
 
 LL_RCC_EnableRTC();
 
 
 
 /* USER CODE BEGIN RTC_Init 1 */
 
 
 
 /* USER CODE END RTC_Init 1 */
 
 /** Initialize RTC and set the Time and Date
 
 */
 
 RTC_InitStruct.HourFormat = LL_RTC_HOURFORMAT_24HOUR;
 
 RTC_InitStruct.AsynchPrescaler = 36;
 
 RTC_InitStruct.SynchPrescaler = 999;
 
 LL_RTC_Init(RTC, &RTC_InitStruct);
 
 /** Initialize RTC and set the Time and Date
 
 */
 
 RTC_TimeStruct.Hours = 15;
 
 RTC_TimeStruct.Minutes = 19;
 
 RTC_TimeStruct.Seconds = 0;
 
 LL_RTC_TIME_Init(RTC, LL_RTC_FORMAT_BCD, &RTC_TimeStruct);
 
 RTC_DateStruct.WeekDay = LL_RTC_WEEKDAY_MONDAY;
 
 RTC_DateStruct.Month = LL_RTC_MONTH_JANUARY;
 
 RTC_DateStruct.Year = 20;
 
 //RTC_DateStruct.Day = 15;
 
 LL_RTC_DATE_Init(RTC, LL_RTC_FORMAT_BCD, &RTC_DateStruct);
 
 /* USER CODE BEGIN RTC_Init 2 */
 
 
 
 /* USER CODE END RTC_Init 2 */
 
 
 
}

RTC_DateStruct.Day = 0; line is lost.Cube doesnt generate this line.

This topic has been closed for replies.
Best answer by Houssem CHAABANI

Dear @Community member​ ,

Thank you for your feedback.

This was internally checked and it will be fixed as soon as possible.

Thank you !

4 replies

Houssem CHAABANI
Visitor II
December 15, 2020

Hi @Community member​ ,

Could you share you .ioc file?

Thanks

Houssem

EDuat.1
EDuat.1Author
Associate II
December 15, 2020

ofcourse

Houssem CHAABANI
Houssem CHAABANIBest answer
Visitor II
December 16, 2020

Dear @Community member​ ,

Thank you for your feedback.

This was internally checked and it will be fixed as soon as possible.

Thank you !

EDuat.1
EDuat.1Author
Associate II
December 16, 2020

By the way,low layer library gettin bcd result doesnt work ,still produce binary result.This takes time almost half day to realise it.