How arm-examples/safety-example-infineon-t2g works
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: TrafficLight.cproject.yml M7-0 safety image · T2G.csolution.yml Traffic-light solution · HTTP_Server_CGI.c HTTP fault-injection CGI · Board_TL.clayer.yml M7-0 board layer
Components 21
Safety traffic-light firmware
Three-image multicore application.
- Traffic-light solution · Assembles the M0+, M7-0, and M7-1 images.
App/T2G.csolution.yml - M0+ boot image · Prepares processor execution.
App/CM0p_Boot/Boot.cproject.yml - M7-0 safety image · Hosts the safety traffic-light application.
App/CM7_0_TrafficLight/TrafficLight.cproject.yml - M7-1 blinky image · Replaceable independent non-safety workload.
App/CM7_1_Blinky/Blinky.cproject.yml - Class 0 operation · Normal traffic-light operation and verification.
App/CM7_0_TrafficLight/SafetyClass0/NormalOperation.c - Class 1 communications · Communications and web control.
App/CM7_0_TrafficLight/SafetyClass1/Communication.c - Class 2 safe mode · Protected safe-mode behavior.
App/CM7_0_TrafficLight/SafetyClass2/SafeModeOperation.c - Fault, watchdog and MPU contracts · Centralizes fault definitions, reset reasoning, watchdog, and zones.
App/CM7_0_TrafficLight/System/faults.c - Keil RTX runtime · CMSIS runtime configuration for the safety image.
App/CM7_0_TrafficLight/RTE/CMSIS/RTX_Config.c - HTTP fault-injection CGI · Local test-control interface for fault injection and recovery exercises.
App/CM7_0_TrafficLight/SafetyClass1/HTTP_Server_CGI.c - HTTP and Ethernet config
App/CM7_0_TrafficLight/RTE/Network/Net_Config_HTTP_Server.h
Board integration
T2G device, Ethernet, and safety hardware bindings.
- Generated device config · Establishes clocks, pins, peripherals, and routing.
Board/KIT_T2G-B-H_LITE/Device_Configurator/GeneratedSource/cycfg.c - M0+ board layer
Board/KIT_T2G-B-H_LITE/Cortex-M0p/Board.clayer.yml - M7-0 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
Board/KIT_T2G-B-H_LITE/Cortex-M7-0/TrafficLight/hw_watchdog.c - Ethernet MAC and PHY · 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 · Builds boot plus M7-0 Ethernet validation workload.
Test/CMSIS_DV.csolution.yml - Ethernet DV workload · Tests the repository-provided Ethernet board driver.
Test/CM7_0_CMSIS_DV/CMSIS_DV.cproject.yml - DV Ethernet config
Test/CM7_0_CMSIS_DV/RTE/CMSIS_Driver_Validation/DV_ETH_Config.h
Build and HIL delivery
- Release build workflow · Builds release artifacts.
.github/workflows/Build_T2G_Release.yaml - Driver-validation HIL · Runs pyOCD-based validation on self-hosted hardware.
.github/workflows/Run_CMSIS_DV.yaml
Connections 25
- 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