Skip to main content
suads
Associate III
December 13, 2021
Solved

STM32WB TIMx clock source?

Hi,

I want to calibrate the RTC. So I need one timer to count the pulses from RTC.

The RTC clock source.(LSE external oscillator 32768 Hz) needs to be the clock source for one of the timers. In the reference design (RM0434) page 682 there are multiple clock source but I don't see the RTC_CLK.

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
December 13, 2021

Which STM32WB?

The clocks arrangement differs between STM32 models significantly.

If your mcu is governed by RM0434, LSE is connected through TIM2_OR1.ETR_RMP to TIM2's ETR, which can be used e.g. as clock to TIM2 when set to External Clock mode 2, ie. TIM2_SMCR.ECE is set.

JW

5 replies

TDK
December 13, 2021

Non-LP timers can't be clocked from LSE. Looks like LPTIM1 can be clocked off of LSE.

Not sure I understand your method, though. You can't calibrate anything if both RTC and (LP)TIM are clocked from LSE.

"If you feel a post has answered your question, please click ""Accept as Solution""."
suads
suadsAuthor
Associate III
December 13, 2021

Hi TDK,

I m referring to this document it is for another board(document AN4759),

0693W00000HoTTAQA3.pngI skipped the LPTIM section in the reference design. I thought all timers can be.

As I understand you only the LPTIMx can be configured to use the LSE oscillator?

waclawek.jan
waclawek.janBest answer
Super User
December 13, 2021

Which STM32WB?

The clocks arrangement differs between STM32 models significantly.

If your mcu is governed by RM0434, LSE is connected through TIM2_OR1.ETR_RMP to TIM2's ETR, which can be used e.g. as clock to TIM2 when set to External Clock mode 2, ie. TIM2_SMCR.ECE is set.

JW

suads
suadsAuthor
Associate III
December 13, 2021

It Is a custom board using STM32WB55CGU6

waclawek.jan
Super User
December 13, 2021

OK so that should be covered by RM0434 and thus work as I described above.

JW