# CAN error: FIFO overrun on mailbox 2, message lost

- **ID:** `embedded/can-fifo-overrun-error`
- **Domain:** embedded
- **Category:** runtime_error
- **Error Code:** `CAN_FLAG_FOV`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

CAN receive FIFO overflowed because the CPU did not read messages fast enough, causing loss of incoming frames.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| STM32CubeFW_F4 v1.27.0 | active | — | — |
| HAL_CAN v2.0.2 | active | — | — |
| CANopen stack v4.0.1 | active | — | — |

## Workarounds

1. **Increase the CAN receive FIFO depth in configuration: hcan.Instance->FMR |= CAN_FMR_FINIT; hcan.Instance->FS1R |= CAN_FS1R_FSC1;** (80% success)
   ```
   Increase the CAN receive FIFO depth in configuration: hcan.Instance->FMR |= CAN_FMR_FINIT; hcan.Instance->FS1R |= CAN_FS1R_FSC1;
   ```
2. **Implement DMA-based CAN message reading to offload CPU: HAL_CAN_Start_DMA(&hcan, CAN_RX_FIFO0);** (90% success)
   ```
   Implement DMA-based CAN message reading to offload CPU: HAL_CAN_Start_DMA(&hcan, CAN_RX_FIFO0);
   ```

## Dead Ends

- **** — Faster baud rate increases message frequency, worsening the overflow issue. (80% fail)
- **** — Filtering reduces noise but does not address the root cause of slow message processing. (60% fail)
