cancel
Showing results for 
Search instead for 
Did you mean: 

bug report for stm32cubemx 4.25.0

Bruno Hu
Associate II
Posted on March 20, 2018 at 08:47

when use the stm32f103xx MCU  RTC module with HAL lib, the rtc init code generated with ll lib function.

the steps to replay the issue.

1) select MCU as stm32f103rct6;

2)check 'Generate peripheral initialization as a pair of'.c/.h' files per peripheral' from 'menu project->Code Generator->Generated files';

3) generate the source code;

4) the rtc init function in rtc.c file as below

void HAL_RTC_MspInit(RTC_HandleTypeDef* rtcHandle)

{

  if(rtcHandle->Instance==RTC)

  {

   

/* USER CODE BEGIN RTC_MspInit 0 */

    /* USER CODE END RTC_MspInit 0 */

   

LL_PWR_EnableBkUpAccess();

   

/* Enable BKP CLK enable for backup registers */

   

LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_BKP);

   

/* RTC clock enable */

    __HAL_RCC_RTC_ENABLE();

   

/* USER CODE BEGIN RTC_MspInit 1 */

    /* USER CODE END RTC_MspInit 1 */

  }

}

this two functions should been replace with 

HAL_PWR_EnableBkUpAccess();

__HAL_RCC_BKP_CLK_ENABLE();

otherwise, the rtc.c code can't been complied.

error informaton as below

Warning[Pe223]: function 'LL_PWR_EnableBkUpAccess' declared implicitly D:\temp\rtc\Src\rtc.c 110

Warning[Pe223]: function 'LL_APB1_GRP1_EnableClock' declared implicitly D:\temp\rtc\Src\rtc.c 112

Error[Pe020]: identifier 'LL_APB1_GRP1_PERIPH_BKP' is undefined D:\temp\rtc\Src\rtc.c 112
4 REPLIES 4
Zhi Pang
Associate III
Posted on March 22, 2018 at 06:43

Meet the same problem here.

When I use CubeMX version 4.25.

The firmware package version F1 V1.6.1.

Imen.D
ST Employee
Posted on March 22, 2018 at 11:27

Hello,

We raised this issue to our CubeMx team for fix.

Thank you for highlighting it, and Sorry for the inconvenience it may bring!

Kind Regards,

Imen 

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Houda GHABRI
ST Employee
Posted on May 03, 2018 at 15:54

@

Hu.Bruno

Hi,

This issue will be resolved in next cubeMX release: 4.0 .

regards,

Houda

Posted on May 04, 2018 at 19:18

Hey,

I want to report another problem with 4.25.

When using LL drivers for TIM2 on STM32F378 with PWM generation for all 4 channels, the OCState is set to DISABLED, when it should be enabled, please see below the generated code.

  TIM_OC_InitStruct.OCMode = LL_TIM_OCMODE_PWM1;

  TIM_OC_InitStruct.OCState = LL_TIM_OCSTATE_DISABLE;  --> I guess this should be enabled

  TIM_OC_InitStruct.OCNState = LL_TIM_OCSTATE_DISABLE;

  TIM_OC_InitStruct.CompareValue = 0;

  TIM_OC_InitStruct.OCPolarity = LL_TIM_OCPOLARITY_HIGH;

  LL_TIM_OC_Init(TIM2, LL_TIM_CHANNEL_CH1, &TIM_OC_InitStruct);

After changing TIM_OC_InitStruct.OCState = LL_TIM_OCSTATE_ENABLE; i get the desired PWM output.

Regards,

Florin