cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX_LL_code enables only some devices?

Willunen
Associate III
Posted on April 03, 2018 at 10:46

Using:

Truestudio for STM32 v9.0.0.0

STM32CubeMX v4.25.0

STM32F100C8

LL_drivers only

LL_Code generated by cube enables some devices, such as the USART:

LL_USART_Enable(USART1);

But for the TIMERS it doesn't.

(perhaps there is a good reason for this?)

Also, when you select a PWM output, it does not enable the output(s):

TIM_OC_InitStruct.OCMode = LL_TIM_OCMODE_PWM1;

TIM_OC_InitStruct.OCState = LL_TIM_OCSTATE_DISABLE;

Again, why?

(Leaving a hint in int main(void) might be an idea.)

For advanced TIMERS (TIM1) it may help people who want to use PWM when this is mentioned somewhere:

LL_TIM_EnableAllOutputs(TIM1);

(I found the MOE_bit to be rather hidden in the documentation in TIMx_BDTR)

Regards,

Wilko

11 REPLIES 11
Posted on May 09, 2018 at 16:29

Hi Mohamed,

Thanks, I understand. Should I do something to close this case?

And may I ask you to look at another question from me? It has the title '

https://community.st.com/0D50X00009XkYRlSAN

'

Regards,

Wilko

Ruslan1
Associate II

Run into the same problem with stm32f100rbt!

Configure OC output pin for TIM3 in CubeMX and then get the generated

"TIM_OC_InitStruct.OCState = LL_TIM_OCSTATE_DISABLE"

in the code.

What the developer tries to avoid?

The timer isn't been started in the configuration code.

Thinking this way all output pins should be disabled during configuration!

I spent 2 days trying to find whats wrong!