Skip to main content
alm494 lastname
Visitor II
Feb 3, 2018 7:27 AM UTC
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
This topic has been closed for replies.
Jeanne Joly
Jeanne JolyBest answer
Associate
Feb 22, 2018 4:00 PM UTC
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

3 replies

ST Technical Moderator
Feb 16, 2018 10:51 AM UTC
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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Jeanne Joly
Jeanne JolyBest answer
Associate
Feb 22, 2018 4:00 PM UTC
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

ST Technical Moderator
Mar 13, 2018 1:43 PM UTC
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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks