2018-03-20 12:47 AM
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 1122018-03-21 10:43 PM
Meet the same problem here.
When I use CubeMX version 4.25.
The firmware package version F1 V1.6.1.
2018-03-22 03:27 AM
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
2018-05-03 06:54 AM
@
Hu.Bruno
Hi,
This issue will be resolved in next cubeMX release: 4.0 .
regards,
Houda
2018-05-04 12:18 PM
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