{
  "id": "embedded/arm-systick-rollover-missed",
  "signature": "SysTick: interrupt not serviced within rollover period, time base corrupted",
  "signature_zh": "SysTick：中断在翻转周期内未得到服务，时间基准损坏",
  "regex": "SysTick.*interrupt not serviced.*rollover period.*time base corrupted",
  "domain": "embedded",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "SysTick interrupt was masked or delayed by higher-priority ISR, causing the 24-bit counter to wrap without handler execution, corrupting RTOS tick count.",
  "root_cause_type": "generic",
  "root_cause_zh": "SysTick中断被更高优先级的中断服务程序屏蔽或延迟，导致24位计数器未执行处理程序就翻转，损坏了RTOS滴答计数。",
  "versions": [
    {
      "version": "FreeRTOS v10.6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "ARM Cortex-M4 r0p1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "STM32CubeH7 v1.11.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase SysTick interrupt priority to 0 (highest)",
      "why_fails": "Setting SysTick to highest priority may break critical timing in other interrupts and does not address the root cause of long ISR masking.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "Disable all other interrupts to ensure SysTick runs",
      "why_fails": "Disabling interrupts globally defeats the purpose of RTOS and can cause watchdog resets or data loss.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase SysTick reload value to extend rollover period",
      "why_fails": "SysTick reload is fixed at 24 bits (max 16,777,215 cycles); increasing it is impossible without changing clock source.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure SysTick interrupt priority is lower than time-critical ISRs but never masked for longer than 1 SysTick period. In FreeRTOS, set configMAX_SYSCALL_INTERRUPT_PRIORITY to include SysTick and check that no ISR runs for > 1 ms (assuming 1 kHz tick).",
      "success_rate": 0.8,
      "how": "Ensure SysTick interrupt priority is lower than time-critical ISRs but never masked for longer than 1 SysTick period. In FreeRTOS, set configMAX_SYSCALL_INTERRUPT_PRIORITY to include SysTick and check that no ISR runs for > 1 ms (assuming 1 kHz tick).",
      "condition": "",
      "sources": []
    },
    {
      "action": "Add a guard to detect missed tick and manually increment RTOS tick count. Implement a high-priority timer that checks if SysTick counter wrapped without ISR.",
      "success_rate": 0.75,
      "how": "Add a guard to detect missed tick and manually increment RTOS tick count. Implement a high-priority timer that checks if SysTick counter wrapped without ISR.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reduce interrupt latency by splitting long ISRs into deferred tasks (e.g., using FreeRTOS task notifications or semaphores).",
      "success_rate": 0.9,
      "how": "Reduce interrupt latency by splitting long ISRs into deferred tasks (e.g., using FreeRTOS task notifications or semaphores).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Ensure SysTick interrupt priority is lower than time-critical ISRs but never masked for longer than 1 SysTick period. In FreeRTOS, set configMAX_SYSCALL_INTERRUPT_PRIORITY to include SysTick and check that no ISR runs for > 1 ms (assuming 1 kHz tick).",
    "Add a guard to detect missed tick and manually increment RTOS tick count. Implement a high-priority timer that checks if SysTick counter wrapped without ISR.",
    "Reduce interrupt latency by splitting long ISRs into deferred tasks (e.g., using FreeRTOS task notifications or semaphores)."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://developer.arm.com/documentation/dui0552/a/cortex-m3-peripherals/system-timer--systick",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-03-12",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}