|
| 1 | +--- |
| 2 | +title: Functional Safety for automotive software development |
| 3 | +weight: 2 |
| 4 | + |
| 5 | +### FIXED, DO NOT MODIFY |
| 6 | +layout: learningpathall |
| 7 | +--- |
| 8 | + |
| 9 | +## What is Functional Safety? |
| 10 | + |
| 11 | +[Functional Safety](https://en.wikipedia.org/wiki/Functional_safety) refers to a system's ability to detect potential faults and respond appropriately to ensure that the system remains in a safe state, preventing harm to individuals or damage to equipment. |
| 12 | + |
| 13 | +This is particularly important in **automotive, autonomous driving, medical devices, industrial control, robotics and aerospace** applications, where system failures can lead to severe consequences. |
| 14 | + |
| 15 | +In software development, Functional Safety focuses on minimizing risks through **software design, testing, and validation** to ensure that critical systems operate in a predictable, reliable, and verifiable manner. This means developers must consider: |
| 16 | +- **Error detection mechanisms** |
| 17 | +- **Exception handling** |
| 18 | +- **Redundancy design** |
| 19 | +- **Development processes compliant with safety standards** |
| 20 | + |
| 21 | +### Definition and Importance of Functional Safety |
| 22 | + |
| 23 | +The core of Functional Safety lies in **risk management**, which aims to reduce the impact of system failures. |
| 24 | + |
| 25 | +In autonomous vehicles, Functional Safety ensures that if sensor data is incorrect, the system can enter a **safe state**, preventing incorrect driving decisions. |
| 26 | + |
| 27 | +Three of core objectives of Functional Safety are: |
| 28 | +1. **Prevention** |
| 29 | + - Reducing the likelihood of errors through rigorous software development processes and testing. In the electric vehicle, the battery systems monitor temperature to prevent overheating. |
| 30 | +2. **Detection** |
| 31 | + - Quickly identifying errors using built-in diagnostic mechanisms (e.g., Built-in Self-Test, BIST). |
| 32 | +3. **Mitigation** |
| 33 | + - Controlling the impact of failures to ensure the overall safety of the system. |
| 34 | + |
| 35 | +This approach is critical in applications such as **autonomous driving, flight control, and medical implants**, where failures can result in **severe consequences**. |
| 36 | + |
| 37 | +### ISO 26262 Standard and Applications |
| 38 | + |
| 39 | +[ISO 26262](https://www.iso.org/standard/68383.html) is a functional safety standard specifically for **automotive electronics and software systems**. It defines a comprehensive safety lifecycle, covering all phases from **requirement analysis, design, development, testing, to maintenance**. |
| 40 | + |
| 41 | +Key Concepts of ISO 26262: |
| 42 | +- **ASIL (Automotive Safety Integrity Level)** |
| 43 | + - Evaluates the risk level of different system components (A, B, C, D, where **D represents the highest safety requirement**). |
| 44 | + - For example: ASIL A can be Dashboard light failure (low risk) and ASIL D is Brake system failure (high risk). |
| 45 | + https://en.wikipedia.org/wiki/Automotive_Safety_Integrity_Level |
| 46 | +- **HARA (Hazard Analysis and Risk Assessment)** |
| 47 | + - Analyzes hazards and assesses risks to determine necessary safety measures. |
| 48 | +- **Safety Mechanisms** |
| 49 | + - Includes error detection, fault tolerance, and fail-safe modes to ensure safe operation. |
| 50 | + |
| 51 | +List some of typical application scenarios: |
| 52 | +- **Autonomous Driving Systems**: |
| 53 | + - Ensures that even if sensors (e.g., LiDAR, radar, cameras) provide faulty data, the vehicle will not make dangerous decisions. |
| 54 | +- **Powertrain Control**: |
| 55 | + - Prevents braking system failures that could lead to loss of control. |
| 56 | +- **Battery Management System (BMS)**: |
| 57 | + - Prevents battery overheating or excessive discharge in electric vehicles. |
| 58 | + |
| 59 | +For more details, you can check this video: [What is Functional Safety?](https://www.youtube.com/watch?v=R0CPzfYHdpQ) |
| 60 | + |
| 61 | + |
| 62 | +### Safety Island |
| 63 | + |
| 64 | +In automotive systems, a **General ECU (Electronic Control Unit)** typically runs non-critical tasks such as infotainment or navigation, whereas a **Safety Island** is dedicated to executing safety-critical control logic (e.g., braking, steering) with strong isolation, redundancy, and determinism. |
| 65 | + |
| 66 | +| Feature | General ECU | Safety Island | |
| 67 | +|------------------------|----------------------------|--------------------------------------| |
| 68 | +| Purpose | Comfort / non-safety logic | Safety-critical decision making | |
| 69 | +| OS/Runtime | Linux, Android | RTOS, Hypervisor, or bare-metal | |
| 70 | +| Isolation | Soft partitioning | Hard isolation (hardware-enforced) | |
| 71 | +| Functional Safety Req | None to moderate | ISO 26262 ASIL-B to ASIL-D compliant | |
| 72 | +| Fault Handling | Best-effort recovery | Deterministic safe-state response | |
| 73 | + |
| 74 | +This contrast highlights why safety-focused software needs a dedicated hardware domain with certified execution behavior. |
| 75 | + |
| 76 | +**Safety Island** is an independent safety subsystem separate from the main processor. It is responsible for monitoring and managing system safety. If the main processor fails or becomes inoperable, Safety Island can take over critical safety functions such as **deceleration, stopping, and fault handling** to prevent catastrophic system failures. |
| 77 | + |
| 78 | +Key Functions of Safety Island |
| 79 | +- **Monitoring System Health** |
| 80 | + - Continuously monitors the operational status of the main processor (e.g., ADAS control unit, ECU) and detects potential errors or anomalies. |
| 81 | +- **Fault Detection and Isolation** |
| 82 | + - Independently evaluates and initiates emergency handling if the main processing unit encounters errors, overheating, computational failures, or unresponsiveness. |
| 83 | +- **Providing Essential Safety Functions** |
| 84 | + - Even if the main system crashes, Safety Island can still execute minimal safety operations, such as: |
| 85 | + - Autonomous Vehicles → Safe stopping (Fail-Safe Mode) |
| 86 | + - Industrial Equipment → Emergency power cutoff or speed reduction |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | +### Integration of Safety Island and Functional Safety |
| 92 | + |
| 93 | +Safety Island plays a critical role in Functional Safety by ensuring that the system can handle high-risk scenarios and minimize catastrophic failures. |
| 94 | + |
| 95 | +How Safety Island Enhances Functional Safety |
| 96 | +1. **Acts as an Independent Redundant Safety Layer** |
| 97 | + - Even if the main system fails, it can still operate independently. |
| 98 | +2. **Supports ASIL-D Safety Level** |
| 99 | + - Monitors ECU health status and executes emergency safety strategies (e.g., emergency braking). |
| 100 | +3. **Provides Independent Fault Detection and Recovery Mechanisms** |
| 101 | + - **Fail-Safe**: Activates a **safe mode**, such as limiting vehicle speed or switching to manual control. |
| 102 | + - **Fail-Operational**: Ensures that high-safety applications (e.g., aerospace systems) can continue operating under certain conditions. |
| 103 | + |
| 104 | +For more insights on **Arm's Functional Safety solutions**, you can refer to: [Arm Functional Safety Compute Blog](https://community.arm.com/arm-community-blogs/b/automotive-blog/posts/functional-safety-compute) |
| 105 | + |
| 106 | + |
| 107 | +### Impact of Functional Safety on Software Development Processes |
| 108 | + |
| 109 | +Functional Safety impacts **both hardware and software development**, particularly in areas such as requirement changes, version management, and testing validation. |
| 110 | +For example, in ASIL-D level applications, every code modification requires a complete impact analysis and regression testing to ensure that new changes do not introduce additional risks. |
| 111 | + |
| 112 | +List the Functional Safety Requirements in Software Development: |
| 113 | +- **Requirement Specification** |
| 114 | + - Clearly defining **safety-critical requirements** and conducting risk assessments. |
| 115 | +- **Safety-Oriented Programming** |
| 116 | + - Following **MISRA C, CERT C/C++ standards** and using static analysis tools to detect errors. |
| 117 | +- **Fault Handling Mechanisms** |
| 118 | + - Implementing **redundancy design and health monitoring** to handle anomalies. |
| 119 | +- **Testing and Verification** |
| 120 | + - Using **Hardware-in-the-Loop (HIL)** testing to ensure software safety in real hardware environments. |
| 121 | +- **Version Management and Change Control** |
| 122 | + - Using **Git, JIRA, Polarion** to track changes for safety audits. |
| 123 | + |
| 124 | +This learning path builds on the previous [learning path](https://learn.arm.com/learning-paths/automotive/openadkit1_container) and introduces how to incorporate Functional Safety design processes in the early stages of automotive software development. |
| 125 | +By establishing an ASIL Partitioning software development environment and leveraging [**SOAFEE**](https://www.soafee.io/) technologies, developers can enhance software consistency and maintainability in Functional Safety applications. |
| 126 | + |
0 commit comments