# 引导加载程序：应用程序镜像在0x08020000的CRC校验失败，期望0xABCD1234，实际0x5678EF00

- **ID:** `embedded/crc-checksum-mismatch-bootloader`
- **领域:** embedded
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

对闪存应用程序区域计算的CRC32校验和与存储的校验和不匹配，表明编程期间损坏、闪存写入不完整或CRC多项式/种子不匹配。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| STM32CubeProgrammer v2.14.0 | active | — | — |
| GCC ARM Embedded 13.2.Rel1 | active | — | — |
| OpenOCD 0.12.0 | active | — | — |

## 解决方案

1. ```
   Re-program the flash using a verified programming tool (e.g., ST-Link CLI) with full erase and verify enabled: `st-flash --reset --format ihex write firmware.hex`
   ```
2. ```
   Check CRC polynomial and seed match between bootloader and image generation script; ensure both use CRC-32 (0x04C11DB7) with initial value 0xFFFFFFFF.
   ```
3. ```
   Ensure flash supply voltage (VDD) is within spec (2.7V-3.6V for STM32F4) during programming; brown-out can cause partial writes.
   ```

## 无效尝试

- **** — If the root cause is a hardware flash issue (e.g., bad sector or voltage drop), re-flashing the same binary will produce the same CRC mismatch. (80% 失败率)
- **** — This bypasses safety entirely; a corrupted image may execute and cause undefined behavior or system failure. (95% 失败率)
- **** — The bootloader expects a specific polynomial and length; mismatch will always fail. (100% 失败率)
