Skip to main content
kurta999
Senior
January 9, 2019
Question

CubeMX 5.0.1 STM32L433RB Low Layer code generation bug for Timers

  • January 9, 2019
  • 4 replies
  • 915 views

Generated code is the following:

void MX_TIM6_Init(void)

{

 LL_TIM_InitTypeDef TIM_InitStruct = {0};

 /* Peripheral clock enable */

 LL_APB1_GRP1_EnableClock(LL_APB1_GRP1_PERIPH_TIM6);

 /* TIM6 interrupt Init */

 NVIC_SetPriority(TIM6_DAC_IRQn, NVIC_EncodePriority(NVIC_GetPriorityGrouping(),5, 0));

 NVIC_EnableIRQ(TIM6_DAC_IRQn);

 TIM_InitStruct.Prescaler = 48000;

 TIM_InitStruct.CounterMode = LL_TIM_COUNTERMODE_UP;

 TIM_InitStruct.Autoreload = LL_TIM_IC_FILTER_F IVLL_TIM_IC_FILTER_FDIV1_N26_N5-LL_TIM_IC_FILTER_FDIV1_N2;

 LL_TIM_Init(TIM6, &TIM_InitStruct);

 LL_TIM_DisableARRPreload(TIM6);

 LL_TIM_SetTriggerOutput(TIM6, LL_TIM_TRGO_RESET);

 LL_TIM_DisableMasterSlaveMode(TIM6);

}

and the error is here:

TIM_InitStruct.Autoreload = LL_TIM_IC_FILTER_FDIVLL_TIM_IC_FILTER_FDIV1_N26_N5-LL_TIM_IC_FILTER_FDIV1_N2;

..\Core\Src\tim.c:135:31: error: 'LL_TIM_IC_FILTER_FDIVLL_TIM_IC_FILTER_FDIV1_N26_N5' undeclared (first use in this function)

  TIM_InitStruct.Autoreload = LL_TIM_IC_FILTER_FDIVLL_TIM_IC_FILTER_FDIV1_N26_N5-LL_TIM_IC_FILTER_FDIV1_N2;

This topic has been closed for replies.

4 replies

ST Technical Moderator
January 11, 2019

Hello @kurta999​ ,

Thanks for highlighting this issue, I raised it internally to our CubeMX team for fix.

Kind 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
Houda GHABRI
ST Employee
January 16, 2019

Hello @kurta999​ ,

Thanks for your feedback.

The value of counter period is 10-1 and this is incorrect value.

Period must have numeric value between 0 and 65 535.   

Feel free to contact me for further details.

Regards,

Houda

kurta999
kurta999Author
Senior
January 16, 2019

Ahh.. Tomorrow I''ll try it with 9. But with HAL it worked correctly, then CubeMX should not allow entering complete expressions to period when using LL or create another workaround.

kurta999
kurta999Author
Senior
January 22, 2019

I've tried it with 9, it's still bugged.