Skip to main content
Robert Ritchey
Senior
July 23, 2025
Solved

STM32N657xx Timer Clock(s)

  • July 23, 2025
  • 2 replies
  • 504 views

I am confused about which clock(s) drive the timers.  In the reference manual is says the APB clock drives the timers but there are 5 APB clocks.  Also, in STM32CubeMX there is a "Timer Group Clocks".  What clocks drive which timers or is the one drives all (Timer Group Clocks)? 

Best answer by Robert Ritchey

I was told by the support team at ST that this is not true.  The "Timer Group Clocks" actually drive the timers.  

"Yes, the clocks are connected PCLK1 and PCLK2, as shown in the reference manual. I know the term "Timer Group clocks" is vague, but I think we can deduce what it does by looking at the definition of TIMPRE register field:

Bits 25:24 TIMPRE[1:0]: Timer clock prescaler selection
This bitfield is security-protected by a SEC signal from RIFSC, the SYSSEC bit, a PRIV
signal from RIFSC, or the SYSPRIV bit, and is publicly readable if SYSPUB = 1. It is set and
reset by software to control the clock frequency of all the timers connected to APB1 and
APB2 domains.
00: timg_ck = sys_bus_ck (default after reset)
01: timg_ck = sys_bus_ck / 2
10: timg_ck = sys_bus_ck / 4
11: timg_ck = sys_bus_ck / 8" 

Look at "Figure 45. Core and bus clock generation" for the divider and resultant timer clocks. 

2 replies

TDK
Super User
July 23, 2025

Go to the reference manual in the "Peripheral register boundary addresses" table and you can see which timer is within which APB.

TDK_0-1753314748726.png

The "timer group clock" is a separate clock you can use to clock individual timers. See timgx_ck below

It's also listed here which PCLK goes with which timer:

TDK_1-1753314979134.png

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
Robert Ritchey
Senior
July 24, 2025

I missed that in the "Peripheral register boundary addresses".  I guess I do not know what "PClkx" is and where it comes from.  I am using STM32CubeMX and am confused on how to set the clocks for the timers.  Nothing seems to match with the documentation.  What are the "Timer Clock Group" clocks.  

TDK
Super User
July 24, 2025

pclk1 is the APB1 clock here:

TDK_0-1753319190814.png

 

timer group clocks is this:

TDK_1-1753319218000.png

 

This is in the CubeMX clock tree which helps visualize it, but it should match the RM. What isn't matching the documentation?

 

"If you feel a post has answered your question, please click ""Accept as Solution""."
STOne-32
Technical Moderator
July 28, 2025

Dear @Robert Ritchey ,

We got your question on our OnLine-Support support and will be back to you with a clarification, for follow-up an internal Number Ticket  #214797.

Regards,

STOne-32.