Skip to main content
alm494 lastname
Visitor II
February 3, 2018
Solved

F103C8: CubeMX generates a garbage in rtc.c

  • February 3, 2018
  • 3 replies
  • 875 views
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.
Best answer by Jeanne Joly
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
February 16, 2018
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
February 22, 2018
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
March 13, 2018
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