Skip to main content
EDuat.1
Associate II
Dec 15, 2020 12:46 PM UTC
Solved

Bug in RTC CubeMX code generate

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.
Houssem CHAABANI
Houssem CHAABANIBest answer
Visitor II
Dec 16, 2020 8:44 AM UTC

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
Dec 15, 2020 12:50 PM UTC

Hi @Community member​ ,

Could you share you .ioc file?

Thanks

Houssem

EDuat.1
EDuat.1Author
Associate II
Dec 15, 2020 1:36 PM UTC

ofcourse

Houssem CHAABANI
Houssem CHAABANIBest answer
Visitor II
Dec 16, 2020 8:44 AM UTC

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
Dec 16, 2020 8:58 AM UTC

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