cancel
Showing results for 
Search instead for 
Did you mean: 

F103C8: CubeMX generates a garbage in rtc.c

alm494 lastname
Associate
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
1 ACCEPTED SOLUTION

Accepted Solutions
Jeanne Joly
Senior III
Posted on February 22, 2018 at 17:00

Hello

Sharipov.Almaz

,

This issue will be fixed in the next CubeMX release.

Sorry for any inconvenience it may cause.

BR. Jeanne

View solution in original post

3 REPLIES 3
Imen.D
ST Employee
Posted on February 16, 2018 at 11:51

Hello

Sharipov.Almaz

I confirm this issue and reported it to our CubeMx team for fix.

Thank you for highlighting the issue, and Sorry for any inconvenience it may bring for you.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Jeanne Joly
Senior III
Posted on February 22, 2018 at 17:00

Hello

Sharipov.Almaz

,

This issue will be fixed in the next CubeMX release.

Sorry for any inconvenience it may cause.

BR. Jeanne

Imen.D
ST Employee
Posted on March 13, 2018 at 14:43

Hello

Sharipov.Almaz

,

Please download the new

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stm32cubemx.html

with fix of this issue.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen