Files
nuttx/include/sys
Gao Jiawei 564c9d7dcd arm: systick: fix off-by-one in SysTick RELOAD programming
ARM specifies that SysTick RELOAD must be programmed with N-1 to get a period of N CPU cycles.
Adjust the timeout/reload conversions accordingly: subtract 1 when writing RELOAD and add 1 back when converting RELOAD to a timeout/interval.
Also clamp RELOAD to the valid 24-bit range (1..0x00ffffff) for Armv7-M/Armv8-M to avoid invalid values.
Reference: https://developer.arm.com/documentation/dui0646/c/Cortex-M7-Peripherals/System-timer--SysTick/SysTick-Reload-Value-Register

Signed-off-by: Gao Jiawei <gaojiawei@xiaomi.com>
2026-01-26 19:34:00 +08:00
..
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-12-20 11:46:14 -03:00
2024-10-04 08:18:42 +08:00
2024-10-10 18:46:51 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2025-05-26 18:49:45 +08:00
2024-12-20 11:46:14 -03:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-12-20 11:46:14 -03:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2024-10-04 08:18:42 +08:00
2026-01-15 23:16:27 +08:00