Solved
F103C8: CubeMX generates a garbage in rtc.c
Posted on February 03, 2018 at 08:27
I have created a project for stm32f103c8t6 with RTC support and selected 'generate peripheral init as a pair of .c and .h file', toolchain is TrueSTUDIO. It worked nice before the last update. After update to version 4.24 in rtc.c file I see the following mess:
/* Includes ------------------------------------------------------------------*/
&sharpinclude 'rtc.h'&sharpn&sharpn
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
RTC_HandleTypeDef hrtc;
&sharpn/* RTC init function */void MX_RTC_Init(void){&sharptRTC_TimeTypeDef sTime;&sharptRTC_DateTypeDef DateToUpdate;&sharpn&sharpt&sharpt/**Initialize RTC Only &sharpn&sharpt&sharpt*/&sharpthrtc.Instance = RTC;&sharptif(HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR1) != 0x32F2){&sharpthrtc.Init.AsynchPrediv = RTC_AUTO_1_SECOND;&sharpthrtc.Init.OutPut = RTC_OUTPUTSOURCE_NONE;&sharptif (HAL_RTC_Init(&hrtc) != HAL_OK)&sharpt{&sharpt&sharpt_Error_Handler(__FILE__, __LINE__);&sharpt}&sharpn&sharpt&sharpt/**Initialize RTC and set the Time and Date &sharpn&sharpt&sharpt*/&sharptsTime.Hours = 0x1;&sharptsTime.Minutes = 0x0;&sharptsTime.Seconds = 0x0;&sharpn&sharptif (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK)&sharpt{&sharpt&sharpt_Error_Handler(__FILE__, __LINE__);&sharpt}#rtc-stm32f1xx