AnsweredAssumed Answered

F103C8: CubeMX generates a garbage in rtc.c

Question asked by alm494 lastname on Feb 3, 2018
Latest reply on Mar 13, 2018 by Imen D

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 ------------------------------------------------------------------*/
#include "rtc.h"
#n

#n

/* USER CODE BEGIN 0 */

/* USER CODE END 0 */

RTC_HandleTypeDef hrtc;
#n
/* RTC init function */
void MX_RTC_Init(void)
{
#tRTC_TimeTypeDef sTime;
#tRTC_DateTypeDef DateToUpdate;
#n
#t#t/**Initialize RTC Only #n#t#t*/
#thrtc.Instance = RTC;
#tif(HAL_RTCEx_BKUPRead(&hrtc, RTC_BKP_DR1) != 0x32F2){
#thrtc.Init.AsynchPrediv = RTC_AUTO_1_SECOND;
#thrtc.Init.OutPut = RTC_OUTPUTSOURCE_NONE;
#tif (HAL_RTC_Init(&hrtc) != HAL_OK)
#t{
#t#t_Error_Handler(__FILE__, __LINE__);
#t}
#n
#t#t/**Initialize RTC and set the Time and Date #n#t#t*/
#tsTime.Hours = 0x1;
#tsTime.Minutes = 0x0;
#tsTime.Seconds = 0x0;
#n
#tif (HAL_RTC_SetTime(&hrtc, &sTime, RTC_FORMAT_BCD) != HAL_OK)
#t{
#t#t_Error_Handler(__FILE__, __LINE__);
#t}

Outcomes