{
  "id": "embedded/sdio-crc-error",
  "signature": "SDIO: CRC error on command 17, response timeout",
  "signature_zh": "SDIO：命令 17 上 CRC 错误，响应超时",
  "regex": "SDIO: CRC error on command \\d+, response timeout",
  "domain": "embedded",
  "category": "protocol_error",
  "subcategory": null,
  "root_cause": "CRC mismatch between SD card and host during command or data transfer, often due to electrical noise, clock timing issues, or card initialization failure.",
  "root_cause_type": "generic",
  "root_cause_zh": "SD 卡与主机之间在命令或数据传输期间 CRC 不匹配，通常由于电气噪声、时钟时序问题或卡初始化失败。",
  "versions": [
    {
      "version": "STM32Cube_FW_L4 v1.18.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "SDIO v2.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "GCC ARM Embedded 10.3.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase SDIO clock frequency to improve throughput",
      "why_fails": "Higher clock frequency worsens timing margins and increases CRC errors.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Replace SD card with a different brand without changing settings",
      "why_fails": "Different cards have varying timing requirements; the issue may persist without proper clock adjustment.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Disable CRC checking in SDIO peripheral",
      "why_fails": "CRC is mandatory for reliable data transfer; disabling it can cause silent data corruption.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Reduce SDIO clock divider to lower frequency: set SDIO_CLKCR_CLKDIV to 2 (e.g., for 48 MHz clock, output 12 MHz) and ensure clock polarity matches SD card spec.",
      "success_rate": 0.85,
      "how": "Reduce SDIO clock divider to lower frequency: set SDIO_CLKCR_CLKDIV to 2 (e.g., for 48 MHz clock, output 12 MHz) and ensure clock polarity matches SD card spec.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Enable internal pull-ups on SDIO data lines and add external 10-100 pF capacitors to ground on each line to filter noise.",
      "success_rate": 0.75,
      "how": "Enable internal pull-ups on SDIO data lines and add external 10-100 pF capacitors to ground on each line to filter noise.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reinitialize the SD card with a slower clock and retry command 17: use HAL_SD_Init() with SDIO_INIT_CLK_DIV of 0x76, then switch to high-speed after successful read.",
      "success_rate": 0.8,
      "how": "Reinitialize the SD card with a slower clock and retry command 17: use HAL_SD_Init() with SDIO_INIT_CLK_DIV of 0x76, then switch to high-speed after successful read.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "降低 SDIO 时钟分频器以降低频率：设置 SDIO_CLKCR_CLKDIV 为 2（例如，48 MHz 时钟输出 12 MHz），并确保时钟极性符合 SD 卡规格。",
    "在 SDIO 数据线上启用内部上拉，并在每条线上添加外部 10-100 pF 电容到地，以过滤噪声。",
    "使用较慢时钟重新初始化 SD 卡并重试命令 17：使用 SDIO_INIT_CLK_DIV 为 0x76 的 HAL_SD_Init()，成功读取后切换到高速模式。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.st.com/resource/en/application_note/an3991-sdio-hardware-and-software-design-guidelines-for-stm32-microcontrollers-stmicroelectronics.pdf",
  "official_doc_section": null,
  "error_code": "SDIO_STA_CCRCFAIL",
  "verification_tier": "ai_generated",
  "confidence": 0.82,
  "fix_success_rate": 0.78,
  "resolvable": "true",
  "first_seen": "2024-01-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}