In this lesson, you will learn how to bridge the gap between microscopic physical hardware degradation and the macroscopic system-level failures observed in your firmware.
When an embedded system hangs or produces silent data corruption, the root cause is often a physical failure mode that violates the assumptions made by your software. While we previously discussed software-level crash handling, we must now understand the "physics of failure" to determine if a bug is a logical error or a permanent hardware degradation.
Common Physical Failure Modes
- Electromigration (EM): At high current densities, momentum transfer from electrons to metal atoms causes atoms to migrate, eventually creating voids (open circuits) or hillocks (short circuits) in your PCB traces or on-die interconnects. In a running system, this manifests as intermittent timing violations that cause sporadic
HardFaultexceptions. - Negative Bias Temperature Instability (NBTI): Primarily affecting PMOS transistors, this mechanism increases the threshold voltage () over time, slowing down logic gates. If a signal path relies on a tight timing margin, NBTI can cause the gate to miss its setup time window, leading to a state-dependent bit flip.
- Dielectric Breakdown (TDDB): The insulating layers in your silicon slowly degrade due to voltage stress. As these insulators thin, leakage currents increase, leading to increased power consumption and thermal runaway.
Impact on System State
These mechanisms rarely cause a clean "on-off" failure. Instead, they produce latent faults. For instance, an NBTI-induced delay might only cause a failure when the processor runs at its maximum frequency under high ambient temperature, but pass all logic tests at boot time.
Consider a register-mapped hardware interface. If physical degradation alters the timing of a volatile read:
// If hardware timing has degraded due to NBTI, this might
// return transient data instead of the stable register value.
uint32_t status = *(volatile uint32_t*)REG_BASE;
if (status != EXPECTED_VAL) {
// Is this a logic bug (1-10) or a hardware failure (26)?
handle_error();
}
By categorizing these modes, you can differentiate between a repeatable firmware bug (like memory corruption) and hardware wear-out that necessitates a device replacement rather than a software patch.
Key Takeaway: Hardware failure modes like electromigration and NBTI manifest as timing-dependent errors that violate your software's assumptions, transforming physical degradation into seemingly erratic firmware behavior.