# Bootloader: CRC check failed for application image at 0x08020000, expected 0xABCD1234, got 0x5678EF00

- **ID:** `embedded/crc-checksum-mismatch-bootloader`
- **Domain:** embedded
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

The CRC32 checksum computed over the flash application region does not match the stored checksum, indicating corruption during programming, incomplete flash write, or a mismatch in CRC polynomial/seed.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| STM32CubeProgrammer v2.14.0 | active | — | — |
| GCC ARM Embedded 13.2.Rel1 | active | — | — |
| OpenOCD 0.12.0 | active | — | — |

## Workarounds

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`** (85% success)
   ```
   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.** (90% success)
   ```
   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.** (70% success)
   ```
   Ensure flash supply voltage (VDD) is within spec (2.7V-3.6V for STM32F4) during programming; brown-out can cause partial writes.
   ```

## Dead Ends

- **** — 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% fail)
- **** — This bypasses safety entirely; a corrupted image may execute and cause undefined behavior or system failure. (95% fail)
- **** — The bootloader expects a specific polynomial and length; mismatch will always fail. (100% fail)
