cancel
Showing results for 
Search instead for 
Did you mean: 

A Mistake Found in HAL Library

Laurie1
Associate III

Function "PWM Generation CH2N" can not work, channel CH2N don't output PWM signal. But after I changed "tmpccer &= ~TIM_CCER_CC2NE;" to "tmpccer |= TIM_CCER_CC2NE;" (in file stm32h7xx_hal_tim.c), it works well.

Hoping developers of HAL library will fix this mistake soon.

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

The complementary timer channels are started with HAL_TIMEx_PWMN_Start. No bug here.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

4 REPLIES 4
TDK
Guru

The complementary timer channels are started with HAL_TIMEx_PWMN_Start. No bug here.

If you feel a post has answered your question, please click "Accept as Solution".
Laurie1
Associate III

I called "HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_2);", did you mean that?

Could you please tell me which chip do you use? Thank you.

TDK
Guru

Nope, I mean HAL_TIMEx_PWMN_Start.

https://github.com/STMicroelectronics/STM32CubeH7/blob/ccb11556044540590ca6e45056e6b65cdca2deb2/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_tim_ex.c#L1074

To start channel 2N:

HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_2);

I use many different chips.

If you feel a post has answered your question, please click "Accept as Solution".
Laurie1
Associate III

Thank you very much! I found that founction in file "stm32h7xx_hal_tim_ex.h" and solve my problem :)