sys/ztimer/kconfig: add defaults for backends#16116
Conversation
|
Note that Searching for |
Then it seems to me that having |
That would be awesome! |
|
i had a short look into the arduino-due manual and saw that the rtt of its MCU capable of running at higher frequencys (just depends on the Prescaler which is independent for rtc(always 32....kHz and rtt (selectable)). |
So, if this would be made configurable, could we do something like the following? |
|
With the new structure for the ztimer peripheral selection process in #15715 a automated decision in the compilation process would be simple to implement. why not have a ztimer_rtt if there is a rtt but just not use it for ms if it has not enaugh resolution sec use rtt if rtt_freq>= 1 ms use rtt if rtt_freq>= 1000 |
Currently there is no information in Kconfig about the RTT frequency. If that information is added then the dependencies of the ms can be changed to add the frequency constraint. |
|
for the atmega it is done like this ( seems very intransparent) |
|
does kconfig support lists of options? |
It supports choices. As an example see the clock configuration for STM32 https://github.com/RIOT-OS/RIOT/blob/master/cpu/stm32/kconfigs/Kconfig.clk For reference: https://www.kernel.org/doc/html/latest/kbuild/kconfig-language.html |
|
It is also a pity that there is no API for querying the supported frequencies for a given RTT. A one size fits all Maybe we could also drop the RTT API altogether and just use |
|
Should I then, for now, swap the preference in the defaults for this PR? |
That would be nice. But there might still be boards that actually cannot set their RTT to 1kHz / 1.024 kHz - I have no idea. If all boards support 1 kHz / 1.024 kHz, using this by default would be awesome for ztimer. |
55ef586 to
6a0240d
Compare
|
Changed the default backend and updated the description accordingly. |
MrKevinWeiss
left a comment
There was a problem hiding this comment.
Tested with native on posix sleep.
The CI passes.
For now it cleans up some of the app.config.test and allows a bit simpler way of managing kconfig.
As discussed the logic to select the RTC should be dealt with later once the information to make that decision is available in the build system. This is a safer way to move forward.
ACK!
|
I'm fine, go ahead! |
atm most boards that define some RTT_frequency seem not to be set to ~1kHz they are either (much) higher (~32kHz most) or 1Hz |
I will take that as a future PR will be needed! |
you are right i just thought about that when i read it here and did some counting |
Contribution description
This PR proposes defaults for the ztimer backends' Kconfig symbols. When ztimer is selected the
RTTTimer backend (if supported) will be enabled. If theRTTTimer is not enabled or supported theTimerRTT backend (if supported) is enabled.RTT was given priority, considering low-power as the optimization goal, We could have it the other way around, given that the Timer backend enables more ztimer clocks by default.As having an RTT is not enough to allow that ztimer backend, the Timer peripheral was given priority.
Testing procedure
Issues/PRs references
None