# arm-examples/safety-example-infineon-t2g architecture

> Architecture diagram of the GitHub repository arm-examples/safety-example-infineon-t2g, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arm-examples/safety-example-infineon-t2g
- Repository: https://github.com/arm-examples/safety-example-infineon-t2g

## Overview

#### Purpose and solution entry points
This is a Keil Studio/CMSIS-Toolbox workspace for the Infineon KIT_T2G-B-H_LITE multicore board. It has two independently selectable CMSIS solutions:
- Safety traffic-light application: `App/T2G.csolution.yml`
- Ethernet CMSIS-Driver validation: `Test/CMSIS_DV.csolution.yml`

The application demonstrates FuSa RTS-style process isolation, MPU zones, safety classes, watchdog/fault recovery, and an Ethernet-served fault-injection UI. The test solution validates the board Ethernet driver.

#### Multicore application topology
`App/T2G.csolution.yml` assembles three firmware images for distinct processors:
- Cortex-M0+ boot/setup image: `App/CM0p_Boot/Boot.cproject.yml`, `App/CM0p_Boot/app_main.c`
- Cortex-M7-0 safety-critical traffic-light image: `App/CM7_0_TrafficLight/TrafficLight.cproject.yml`, `App/CM7_0_TrafficLight/app_main.c`
- Cortex-M7-1 independent non-safety blinky image: `App/CM7_1_Blinky/Blinky.cproject.yml`, `App/CM7_1_Blinky/app_main.c`

Boot is a hard boundary: the M0+ prepares processor execution, while M7-0 hosts the safety application and M7-1 is explicitly replaceable non-safety workload.

#### Traffic-light safety partitioning
The M7-0 application is organized by FuSa RTS safety class:
- Class 0 normal operation and operation checks: `App/CM7_0_TrafficLight/SafetyClass0/NormalOperation.c`, `App/CM7_0_TrafficLight/SafetyClass0/OperationVerification.c`
- Class 1 communications and web control: `App/CM7_0_TrafficLight/SafetyClass1/Communication.c`, `App/CM7_0_TrafficLight/SafetyClass1/Web.c`
- Class 2 safe-mode behavior: `App/CM7_0_TrafficLight/SafetyClass2/SafeModeOperation.c`

The key control flow is normal operation plus verification; injected or detected faults transition handling toward protected safe-mode operation. System-level fault definitions, reset reasoning, watchdog contracts, and MPU zone declarations are centralized under `App/CM7_0_TrafficLight/System/faults.c`, `App/CM7_0_TrafficLight/System/hw_watchdog.h`, and `App/CM7_0_TrafficLight/System/zones.h`.

#### Network and fault-injection boundary
Ethernet/networking exposes a local HTTP CGI interface, separating external test control from safety logic:
- CGI request handling: `App/CM7_0_TrafficLight/SafetyClass1/HTTP_Server_CGI.c`
- Static/browser assets: `App/CM7_0_TrafficLight/SafetyClass1/Web/index.cgi`, `App/CM7_0_TrafficLight/SafetyClass1/Web/refresh.cgx`
- CMSIS network configuration: `App/CM7_0_TrafficLight/RTE/Network/Net_Config_HTTP_Server.h`, `App/CM7_0_TrafficLight/RTE/Network/Net_Config_ETH_0.h`

The web interface is intended to inject faults and exercise recovery, not to serve as the application’s primary runtime.

#### Board and hardware integration
Board code binds CMSIS application projects to the CYT4BF8CDS/T2G device, startup sequence, memory layout, and physical Ethernet:
- Board layers: `Board/KIT_T2G-B-H_LITE/Cortex-M7-0/Board_TL.clayer.yml`, `Board/KIT_T2G-B-H_LITE/Cortex-M0p/Board.clayer.yml`
- Traffic-light-specific low-level facilities: `Board/KIT_T2G-B-H_LITE/Cortex-M7-0/TrafficLight/hw_watchdog.c`, `Board/KIT_T2G-B-H_LITE/Cortex-M7-0/TrafficLight/zones.c`
- Ethernet MAC and DP83825I PHY: `Board/KIT_T2G-B-H_LITE/EMAC_T2G.c`, `Board/KIT_T2G-B-H_LITE/PHY_DP83825I.c`

Generated device configuration establishes clocks, pins, peripherals, and routing: `Board/KIT_T2G-B-H_LITE/Device_Configurator/GeneratedSource/cycfg.c` and `Board/KIT_T2G-B-H_LITE/Device_Configurator/GeneratedSource/cycfg_peripherals.c`.

#### Driver validation path
The test solution builds a boot image plus a Cortex-M7-0 CMSIS Driver Validation workload:
- `Test/CM0p_Boot/Boot.cproject.yml`
- `Test/CM7_0_CMSIS_DV/CMSIS_DV.cproject.yml`
- `Test/CM7_0_CMSIS_DV/RTE/CMSIS_Driver_Validation/DV_ETH_Config.h`

It exercises the repository-provided Ethernet board driver rather than a vendor-supplied CMSIS Ethernet driver.

#### Runtimes and delivery
Firmware uses CMSIS components and Keil RTX configuration (`App/CM7_0_TrafficLight/RTE/CMSIS/RTX_Config.c`), with FuSa RTS as the intended safety runtime context. Builds use CMSIS-Toolbox, CMake, Arm Compiler for Embedded (AC6), and tool dependencies declared in `vcpkg-configuration.json`. GitHub Actions build release and driver-validation artifacts; self-hosted hardware runners support pyOCD-based HIL execution via `.github/workflows/Build_T2G_Release.yaml` and `.github/workflows/Run_CMSIS_DV.yaml`.

Main entry points: [`App/CM7_0_TrafficLight/TrafficLight.cproject.yml`](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/TrafficLight.cproject.yml) (M7-0 safety image), [`App/T2G.csolution.yml`](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/T2G.csolution.yml) (Traffic-light solution), [`App/CM7_0_TrafficLight/SafetyClass1/HTTP_Server_CGI.c`](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/SafetyClass1/HTTP_Server_CGI.c) (HTTP fault-injection CGI), [`Board/KIT_T2G-B-H_LITE/Cortex-M7-0/Board_TL.clayer.yml`](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Board/KIT_T2G-B-H_LITE/Cortex-M7-0/Board_TL.clayer.yml) (M7-0 board layer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Safety traffic-light firmware"]
  node_app_solution["Traffic-light solution<br/>CMSIS solution<br/>[T2G.csolution.yml]"]
  node_m0_boot{{"M0+ boot image<br/>firmware image<br/>[Boot.cproject.yml]"}}
  node_m7_safety{{"M7-0 safety image<br/>firmware image"}}
  node_m7_blinky{{"M7-1 blinky image<br/>firmware image"}}
  node_class0["Class 0 operation<br/>FuSa RTS partition<br/>[NormalOperation.c]"]
  node_class1["Class 1 communications<br/>FuSa RTS partition<br/>[Communication.c]"]
  node_class2["Class 2 safe mode<br/>FuSa RTS partition"]
  node_fault_system["Fault, watchdog and MPU contracts<br/>safety system<br/>[faults.c]"]
  node_rtx["Keil RTX runtime<br/>RTOS configuration<br/>[RTX_Config.c]"]
  node_http_cgi["HTTP fault-injection CGI<br/>network boundary<br/>[HTTP_Server_CGI.c]"]
  node_network_config["HTTP and Ethernet config<br/>CMSIS network config"]
end

subgraph group_board["Board integration"]
  node_device_config["Generated device config<br/>device configuration<br/>[cycfg.c]"]
  node_board_m0["M0+ board layer<br/>[Board.clayer.yml]"]
  node_board_m7["M7-0 board layer"]
  node_board_safety_hw["Watchdog and MPU hardware<br/>board safety facilities<br/>[hw_watchdog.c]"]
  node_ethernet_driver["Ethernet MAC and PHY<br/>board Ethernet driver<br/>[EMAC_T2G.c]"]
end

subgraph group_validation["Ethernet driver validation"]
  node_dv_solution["CMSIS Driver Validation<br/>CMSIS solution"]
  node_dv_workload{{"Ethernet DV workload<br/>validation firmware"}}
  node_dv_eth_config["DV Ethernet config<br/>validation config<br/>[DV_ETH_Config.h]"]
end

subgraph group_delivery["Build and HIL delivery"]
  node_release_ci["Release build workflow<br/>GitHub Actions workflow"]
  node_hil_ci["Driver-validation HIL<br/>GitHub Actions workflow<br/>[Run_CMSIS_DV.yaml]"]
end

node_app_solution -->|"builds"| node_m0_boot
node_app_solution -->|"builds"| node_m7_safety
node_app_solution -->|"builds"| node_m7_blinky
node_m0_boot -->|"boots"| node_m7_safety
node_m7_safety -->|"contains"| node_class0
node_m7_safety -->|"contains"| node_class1
node_m7_safety -->|"contains"| node_class2
node_m7_safety -->|"uses safety contracts"| node_fault_system
node_m7_safety -->|"runs with"| node_rtx
node_class0 -->|"fault transition"| node_class2
node_class1 -->|"hosts"| node_http_cgi
node_http_cgi -->|"injects faults"| node_fault_system
node_network_config -->|"configures"| node_http_cgi
node_http_cgi -->|"uses network path"| node_ethernet_driver
node_board_m0 -->|"supports"| node_m0_boot
node_board_m7 -->|"supports"| node_m7_safety
node_device_config -->|"configures hardware"| node_board_m0
node_device_config -->|"configures hardware"| node_board_m7
node_board_safety_hw -->|"implements contracts"| node_fault_system
node_board_m7 -->|"integrates"| node_ethernet_driver
node_dv_solution -->|"builds"| node_dv_workload
node_dv_workload -->|"uses"| node_dv_eth_config
node_dv_workload -->|"validates"| node_ethernet_driver
node_release_ci -->|"builds"| node_app_solution
node_hil_ci -->|"runs"| node_dv_solution

click node_app_solution "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/T2G.csolution.yml"
click node_m0_boot "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM0p_Boot/Boot.cproject.yml"
click node_m7_safety "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/TrafficLight.cproject.yml"
click node_m7_blinky "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_1_Blinky/Blinky.cproject.yml"
click node_class0 "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/SafetyClass0/NormalOperation.c"
click node_class1 "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/SafetyClass1/Communication.c"
click node_class2 "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/SafetyClass2/SafeModeOperation.c"
click node_fault_system "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/System/faults.c"
click node_rtx "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/RTE/CMSIS/RTX_Config.c"
click node_http_cgi "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/SafetyClass1/HTTP_Server_CGI.c"
click node_network_config "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/RTE/Network/Net_Config_HTTP_Server.h"
click node_device_config "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Board/KIT_T2G-B-H_LITE/Device_Configurator/GeneratedSource/cycfg.c"
click node_board_m0 "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Board/KIT_T2G-B-H_LITE/Cortex-M0p/Board.clayer.yml"
click node_board_m7 "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Board/KIT_T2G-B-H_LITE/Cortex-M7-0/Board_TL.clayer.yml"
click node_board_safety_hw "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Board/KIT_T2G-B-H_LITE/Cortex-M7-0/TrafficLight/hw_watchdog.c"
click node_ethernet_driver "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Board/KIT_T2G-B-H_LITE/EMAC_T2G.c"
click node_dv_solution "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Test/CMSIS_DV.csolution.yml"
click node_dv_workload "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Test/CM7_0_CMSIS_DV/CMSIS_DV.cproject.yml"
click node_dv_eth_config "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Test/CM7_0_CMSIS_DV/RTE/CMSIS_Driver_Validation/DV_ETH_Config.h"
click node_release_ci "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/.github/workflows/Build_T2G_Release.yaml"
click node_hil_ci "https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/.github/workflows/Run_CMSIS_DV.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_solution,node_m0_boot,node_m7_safety,node_m7_blinky,node_class0,node_class1,node_class2,node_fault_system,node_rtx,node_http_cgi,node_network_config toneBlue
class node_device_config,node_board_m0,node_board_m7,node_board_safety_hw,node_ethernet_driver toneAmber
class node_dv_solution,node_dv_workload,node_dv_eth_config toneMint
class node_release_ci,node_hil_ci toneRose
```

## Components

### Safety traffic-light firmware

Three-image multicore application.

- [Traffic-light solution](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/T2G.csolution.yml): CMSIS solution · Assembles the M0+, M7-0, and M7-1 images. · `App/T2G.csolution.yml`
- [M0+ boot image](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM0p_Boot/Boot.cproject.yml): firmware image · Prepares processor execution. · `App/CM0p_Boot/Boot.cproject.yml`
- [M7-0 safety image](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/TrafficLight.cproject.yml): firmware image · Hosts the safety traffic-light application. · `App/CM7_0_TrafficLight/TrafficLight.cproject.yml`
- [M7-1 blinky image](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_1_Blinky/Blinky.cproject.yml): firmware image · Replaceable independent non-safety workload. · `App/CM7_1_Blinky/Blinky.cproject.yml`
- [Class 0 operation](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/SafetyClass0/NormalOperation.c): FuSa RTS partition · Normal traffic-light operation and verification. · `App/CM7_0_TrafficLight/SafetyClass0/NormalOperation.c`
- [Class 1 communications](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/SafetyClass1/Communication.c): FuSa RTS partition · Communications and web control. · `App/CM7_0_TrafficLight/SafetyClass1/Communication.c`
- [Class 2 safe mode](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/SafetyClass2/SafeModeOperation.c): FuSa RTS partition · Protected safe-mode behavior. · `App/CM7_0_TrafficLight/SafetyClass2/SafeModeOperation.c`
- [Fault, watchdog and MPU contracts](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/System/faults.c): safety system · Centralizes fault definitions, reset reasoning, watchdog, and zones. · `App/CM7_0_TrafficLight/System/faults.c`
- [Keil RTX runtime](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/RTE/CMSIS/RTX_Config.c): RTOS configuration · CMSIS runtime configuration for the safety image. · `App/CM7_0_TrafficLight/RTE/CMSIS/RTX_Config.c`
- [HTTP fault-injection CGI](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/SafetyClass1/HTTP_Server_CGI.c): network boundary · Local test-control interface for fault injection and recovery exercises. · `App/CM7_0_TrafficLight/SafetyClass1/HTTP_Server_CGI.c`
- [HTTP and Ethernet config](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/App/CM7_0_TrafficLight/RTE/Network/Net_Config_HTTP_Server.h): CMSIS network config · `App/CM7_0_TrafficLight/RTE/Network/Net_Config_HTTP_Server.h`

### Board integration

T2G device, Ethernet, and safety hardware bindings.

- [Generated device config](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Board/KIT_T2G-B-H_LITE/Device_Configurator/GeneratedSource/cycfg.c): device configuration · Establishes clocks, pins, peripherals, and routing. · `Board/KIT_T2G-B-H_LITE/Device_Configurator/GeneratedSource/cycfg.c`
- [M0+ board layer](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Board/KIT_T2G-B-H_LITE/Cortex-M0p/Board.clayer.yml): board layer · `Board/KIT_T2G-B-H_LITE/Cortex-M0p/Board.clayer.yml`
- [M7-0 board layer](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Board/KIT_T2G-B-H_LITE/Cortex-M7-0/Board_TL.clayer.yml): board layer · Binds the traffic-light image to T2G board support. · `Board/KIT_T2G-B-H_LITE/Cortex-M7-0/Board_TL.clayer.yml`
- [Watchdog and MPU hardware](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Board/KIT_T2G-B-H_LITE/Cortex-M7-0/TrafficLight/hw_watchdog.c): board safety facilities · `Board/KIT_T2G-B-H_LITE/Cortex-M7-0/TrafficLight/hw_watchdog.c`
- [Ethernet MAC and PHY](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Board/KIT_T2G-B-H_LITE/EMAC_T2G.c): board Ethernet driver · EMAC_T2G with DP83825I PHY. · `Board/KIT_T2G-B-H_LITE/EMAC_T2G.c`

### Ethernet driver validation

Independent CMSIS Driver Validation solution.

- [CMSIS Driver Validation](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Test/CMSIS_DV.csolution.yml): CMSIS solution · Builds boot plus M7-0 Ethernet validation workload. · `Test/CMSIS_DV.csolution.yml`
- [Ethernet DV workload](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Test/CM7_0_CMSIS_DV/CMSIS_DV.cproject.yml): validation firmware · Tests the repository-provided Ethernet board driver. · `Test/CM7_0_CMSIS_DV/CMSIS_DV.cproject.yml`
- [DV Ethernet config](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/Test/CM7_0_CMSIS_DV/RTE/CMSIS_Driver_Validation/DV_ETH_Config.h): validation config · `Test/CM7_0_CMSIS_DV/RTE/CMSIS_Driver_Validation/DV_ETH_Config.h`

### Build and HIL delivery

- [Release build workflow](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/.github/workflows/Build_T2G_Release.yaml): GitHub Actions workflow · Builds release artifacts. · `.github/workflows/Build_T2G_Release.yaml`
- [Driver-validation HIL](https://github.com/arm-examples/safety-example-infineon-t2g/blob/main/.github/workflows/Run_CMSIS_DV.yaml): GitHub Actions workflow · Runs pyOCD-based validation on self-hosted hardware. · `.github/workflows/Run_CMSIS_DV.yaml`

## Connections

- Traffic-light solution → M0+ boot image: builds
- Traffic-light solution → M7-0 safety image: builds
- Traffic-light solution → M7-1 blinky image: builds
- M0+ boot image → M7-0 safety image: boots
- M7-0 safety image → Class 0 operation: contains
- M7-0 safety image → Class 1 communications: contains
- M7-0 safety image → Class 2 safe mode: contains
- M7-0 safety image → Fault, watchdog and MPU contracts: uses safety contracts
- M7-0 safety image → Keil RTX runtime: runs with
- Class 0 operation → Class 2 safe mode: fault transition
- Class 1 communications → HTTP fault-injection CGI: hosts
- HTTP fault-injection CGI → Fault, watchdog and MPU contracts: injects faults
- HTTP and Ethernet config → HTTP fault-injection CGI: configures
- HTTP fault-injection CGI → Ethernet MAC and PHY: uses network path
- M0+ board layer → M0+ boot image: supports
- M7-0 board layer → M7-0 safety image: supports
- Generated device config → M0+ board layer: configures hardware
- Generated device config → M7-0 board layer: configures hardware
- Watchdog and MPU hardware → Fault, watchdog and MPU contracts: implements contracts
- M7-0 board layer → Ethernet MAC and PHY: integrates
- CMSIS Driver Validation → Ethernet DV workload: builds
- Ethernet DV workload → DV Ethernet config: uses
- Ethernet DV workload → Ethernet MAC and PHY: validates
- Release build workflow → Traffic-light solution: builds
- Driver-validation HIL → CMSIS Driver Validation: runs
