Showing results for 
Search instead for 
Did you mean: 

Nucleo-H743zi2 + freeRTOS, TIM4 PWM doesn't work!


I'm using nucleo-h743zi2 with freeRTOS for drone flight controller project

before using h743, I tested my code on f429zi everything works fine

But after migrate to h743, All PWM channels on TIM4 does't work,

Prescaler and counter period is correct for 500Hz operation(prescaler:12-1 , counter: 40000-1, APB timer clock 240mhz)

With another timer (1, 3, 12) on same setting ,PWM works fine

Is there any special consideration for H743-TIM4 ??

Here's my git


> All PWM channels on TIM4 does't work,

What is the expected behaviour and how does the observed one differ?

Read out and check/post the TIM and relevant GPIO registers content.



There isn't anything special about TIM4 that is relevant here. Gotta be something wrong in the code.

> sConfigOC.Pulse = 0;

This is a 0% duty cycle, so not really a PWM.

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

I want PWM signals that can control Drone motor controller(ESC).

50%~100% duty cycle, 500Hz

I've tested all Timer with same code and prescaler to generate demanded signals.

Every timer works fine except for TIM4. Only TIM4 generates 2.5Hz, 50%~100% duty cycle signal.

I'm using (i2c1, i2c2, UART3,8,7 SDMMC1), Is there any probability peripherals colliding each other?


Peripherals are independent, but if something else is also trying to use those pins, it's not going to work.

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

Read out and check/compare to working/post the TIM4 registers content.

Also check/post clock settings for TIM4 in RCC.


Associate III

And if "TIM4.PWM Generation Channel 1 -> Pulse" is raised from 0 to 20000, then the PWM will appear?