Course contentsShow
← Embedded Systems & Computer Architecture
Lesson 657 of 9369. Embedded Systems Reliability and SafetyFree lesson

Constructing Graceful Degradation Strategies

You will design system fallback states that allow critical functionality to persist even when non-essential modules encounter unrecoverable errors.

In this lesson, you will learn how to design system fallback states that ensure your embedded device maintains core mission-critical functionality, even when non-essential modules suffer unrecoverable hardware or software failures.

The Philosophy of "Fail-Safe, Not Fail-Stop"

When a failure occurs in an embedded system—such as a sensor interface timing out or a memory-mapped I/O peripheral returning corrupted data—the traditional "fail-stop" approach is to trigger a system reset or enter a hard-lock state. While safe, this is often unnecessary and hurts availability. Instead, graceful degradation isolates the failing module and transitions the system into a restricted "limp-home" mode.

To implement this, you must categorize your system functionality into Core (e.g., flight stability, basic communication) and Auxiliary (e.g., telemetry logging, UI updates). When a critical error is detected in an auxiliary module, the system should disable that specific task rather than allowing the fault to propagate to the core control loop.

Implementing Fallback States

Consider a flight controller that manages both motor output and GPS navigation. If the GPS module encounters an unrecoverable I/O error, the system shouldn't crash; it should discard the GPS input and rely solely on the Inertial Measurement Unit (IMU).

typedef enum {
    SYSTEM_NORMAL,
    SYSTEM_DEGRADED_NO_GPS,
    SYSTEM_CRITICAL_HALT
} system_state_t;

void control_loop(void) {
    if (gps_is_faulty()) {
        current_state = SYSTEM_DEGRADED_NO_GPS;
        // Disable GPS processing, rely on IMU dead reckoning
        run_imu_only_flight_mode();
    } else {
        run_full_autonomous_mode();
    }
}

By decoupling the dependencies between modules, you create a "safety partition." Your error-handling return codes (taught in lesson 25) act as the trigger for these state transitions. By prioritizing the Safety Integrity Level (lesson 17) of each module, you determine exactly which features are shed first. The goal is to ensure that the system provides the highest possible level of utility given the current health of the hardware components.

Key Takeaway: Graceful degradation requires a pre-defined state machine that sheds non-essential functionality upon detecting a failure, prioritizing the persistence of safety-critical operations over full system capability.