Skip to main content
Cyeoj.1
Associate
August 19, 2020
Question

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

  • August 19, 2020
  • 5 replies
  • 1891 views

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

https://github.com/ch-jwoo/FlightController

This topic has been closed for replies.

5 replies

waclawek.jan
Super User
August 19, 2020

> 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.

JW

Cyeoj.1
Cyeoj.1Author
Associate
August 20, 2020

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?

TDK
Super User
August 19, 2020

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""."
TDK
Super User
August 20, 2020

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""."
waclawek.jan
Super User
August 20, 2020

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

Also check/post clock settings for TIM4 in RCC.

JW

NorfLoud
Associate II
August 21, 2020

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