zephyr/tests/kernel/timer/timer_behavior/Kconfig
Tomasz Moń c55266a925 tests: kernel: timer_behavior: Decrease tick rate for nRF
Nordic targets use 24-bit RTC peripheral for system clock. Nordic system
clock timeout implementation relies on RTC CC (capture compare) when
the timeout is in future. Nordic system clock driver allows setting
alarm only to 3 or more counts from current counter value due to silicon
limitation (to ensure that CC event triggers before counter overflow).

RTC CC limitation does not have much impact on normal applications where
there is no need to schedule such short timeouts, but is problematic in
a timer test that expects being able to repeatedly schedule timeouts on
subsequent ticks.

Reduce system tick rate to 8192 on nRF targets to allow setting CC to
the very next tick. With system tick rate being 4 times less than the
hardware tick rate, it is always possible to schedule timeout to happen
in the next tick because ticks are 4 counts apart, i.e. current timer
value + 3 never runs past the next tick.

Fixes: #54211

Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
2023-04-05 08:30:15 +02:00

37 lines
954 B
Plaintext

# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2022 Intel Corporation
mainmenu "Timer Behavior Test"
config SYS_CLOCK_TICKS_PER_SEC
default 8192 if NRF_RTC_TIMER && TICKLESS_KERNEL
source "Kconfig.zephyr"
config TIMER_TEST_SAMPLES
int "The number of timer samples to gather for statistics"
default 1000 if (SRAM_SIZE < 24)
default 2000 if (SRAM_SIZE < 32)
default 3000 if (SRAM_SIZE < 48)
default 5000 if (SRAM_SIZE < 64)
default 7000 if (SRAM_SIZE < 96)
default 10000
config TIMER_TEST_PERIOD
int "The number of microseconds to for the timer period"
default 1000
config TIMER_TEST_MAX_STDDEV
int "Maximum standard deviation in microseconds allowed"
default 10
config TIMER_TEST_MAX_DRIFT
int "Maximum drift in microseconds allowed (should be about 1 period allowance)"
default 1000
config TIMER_TEST_PERIOD_MAX_DRIFT_PERCENT
int "Maximum drift percentage for the timer period"
default 10
help
A value of 10 means 10%.