Closed ycsin closed 3 years ago
@ycsin Just as a clarification, adding counter driver for F1 won't have any impact on k_sleep
.
k_sleep
(and ms derivatives) are clocked by ARM Cortex Systick (cf drivers/timer/cortex_m_systick.c
).
This doesn't mean it has no interest, but won't it provide the expected improvement.
I think what you rather look for is an implementation of timer api (to clock kernel ticks) using RTC. A L1 implementation is tempted here: https://github.com/zephyrproject-rtos/zephyr/pull/30790. Though, I'm not sure implementation can provide a better lock accuracy in ms, as the implementation of a ms ticker using RTC hardware is not easy (taking into account various cases expected by kernel).
@ycsin Just as a clarification, adding counter driver for F1 won't have any impact on
k_sleep
.k_sleep
(and ms derivatives) are clocked by ARM Cortex Systick (cfdrivers/timer/cortex_m_systick.c
).This doesn't mean it has no interest, but won't it provide the expected improvement.
I think what you rather look for is an implementation of timer api (to clock kernel ticks) using RTC. A L1 implementation is tempted here: #30790. Though, I'm not sure implementation can provide a better lock accuracy in ms, as the implementation of a ms ticker using RTC hardware is not easy (taking into account various cases expected by kernel).
I see, thanks for the clarification!
@ycsin, I'll close the current point as it doesn't answer your need.
I was trying to get the 32.768 kHz LSE work for my STM32F103RE custom board to achieve higher timing accuracy for
k_msleep()
(not sure if this is the correct direction), but then I found out that the STM32F1 series doesn't support theCONFIG_COUNTER_RTC_STM32
flag.I've added:
to
soc.h
and relevant flags:to
*_defconfig
. But the compilation failed due tostm32f1xx_ll_rtc.h
lacks theLL_RTC_Date_Get(RTC_TypeDef *RTCx)
function required bydrivers\counter\counter_ll_stm32_rtc.c
and a lots of other related things.Is there a way of getting the RTC driver supported? The 32bit RTC register on the STM32F1 should be able to hold up to ~136 years. Or any possible workaround for the
stm32f1xx_ll_rtc.h
so that the COUNTER aspect of the LSE can work? (ie: Higherk_msleep()
precision)zephyr_compile_log.txt