Skip to main content
goottan
Visitor II
June 6, 2019
Question

LL bug STM32F303VCTx TIM15 PWM

  • June 6, 2019
  • 0 replies
  • 402 views

I try to configure TIM15 PMW channel1 - PF9 and channel2 - PF10 using LL driver.

Looks like the STM32CubeMX is generating the wrong code.

It set GPIO mode as AF_2

 GPIO_InitStruct.Pin = LL_GPIO_PIN_9|LL_GPIO_PIN_10;
 GPIO_InitStruct.Mode = LL_GPIO_MODE_ALTERNATE;
 GPIO_InitStruct.Speed = LL_GPIO_SPEED_FREQ_LOW;
 GPIO_InitStruct.OutputType = LL_GPIO_OUTPUT_PUSHPULL;
 GPIO_InitStruct.Pull = LL_GPIO_PULL_NO;
 GPIO_InitStruct.Alternate = LL_GPIO_AF_2;
 LL_GPIO_Init(GPIOF, &GPIO_InitStruct);

But PF9 and PF10 don`t have AF2 state according to datasheet Table 19. https://www.st.com/resource/en/datasheet/stm32f303vc.pdf

The correct way is to set GPIO mode as AF_3.

This topic has been closed for replies.