-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stm32 LPTIM clock with prescaler to adjust the TICKS_PER_SEC #63563
Conversation
c8726ab
to
1478bec
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a good occasion to remove the deprecation message on "#if DT_INST_NUM_CLOCKS(0) == 1
#warning Kconfig for LPTIM source clock (LSI/LSE) is deprecated, use device tree."
samples/boards/stm32/power_mgmt/blinky/boards/nucleo_wb55rg.conf
Outdated
Show resolved
Hide resolved
Rebase on 68365d5
|
643bf1a
to
7c72f85
Compare
6148636
to
3c5dcf3
Compare
rebase on #65683 which removes the lptim clock source divider of the stm32u5 |
rebase on 9521371 |
7f023c1
to
7abb247
Compare
Rename to LPTIM_PRESCALER, the <st,property> prescaler of the stm32 LPTimer. This commit gives better readability than LPTIM_CLOCK_RATIO. Signed-off-by: Francois Ramu <francois.ramu@st.com>
With low LPTIM freq when prescaler is set to 16 or 32, the CONFIG_SYS_CLOCK_TICKS_PER_SEC must be reduced to LPTIM CLOCK_/prescaler to avoid spurious timer wakeup activity. Assert error if the CONFIG_SYS_CLOCK_TICKS_PER_SEC is not compatible with the lptim clock freq. Signed-off-by: Francois Ramu <francois.ramu@st.com>
Configure the SYS_CLOCK_TICKS_PER_SEC directly from the DTS st-prescaler property of the lptim node aka stm32_lp_tick_source Signed-off-by: Francois Ramu <francois.ramu@st.com>
Change the name of the node for the lptim used as lowpower tick source to stm32_lp_tick_source. Once enabled, this node is known as stm32_lp_tick_source That will avoid naming the node lptim1 or lptim2 or lptim, etc. Signed-off-by: Francois Ramu <francois.ramu@st.com>
Update migration guide to introduce the stm32_lp_tick_source for stm32 device when choosing the LPTIM fo lowPower modes. Signed-off-by: Francois Ramu <francois.ramu@st.com>
|
samples/boards/stm32/power_mgmt/blinky/boards/b_u585i_iot02a.conf
Outdated
Show resolved
Hide resolved
Set the prescaler for the stm32_lp_tick_source lptim node. When the LPTIM is clocked by the LSE with a prescaler of 16 (lptim freq at 2048Hz) expecting 2048 for the TICKS_PER_SEC. When the LPTIM is clocked by the LSE with a prescaler of 32 (lptim freq at 1024Hz) expecting 1024 for the TICKS_PER_SEC. Signed-off-by: Francois Ramu <francois.ramu@st.com>
adding more text to the README.rst |
When the LPTIM is enabled for the lowPower (PM) purpose, the SYS_CLOCK_TICKS_PER_SEC is set to a lower value (than default 10000)
However when the lptim has a that divides the clock source , this SYS_CLOCK_TICKS_PER_SEC is even too high, resulting in numerous system wakeup during sleep mode (no more sleeping indeed)
Consequently the SYS_CLOCK_TICKS_PER_SEC is set to a value depending
on the clock input LSE/LSI and the clock prescaler property set in the DTS
Removing SYS_CLOCK_TICKS_PER_SEC in the board config and adding
Warning build message to check the coherency between
Fixes #61099