ModusToolbox™ Safety Test Library (mtb-stl) - IEC 60730 Class B Compliance for Industrial and Home Appliance Safety

August 10, 2026 · View on GitHub

Overview

The ModusToolbox™ Safety Test Library (mtb-stl) provides functional safety APIs to implement overall safety of a system that depends on automatic protection suitable for use in industrial environments and home appliances. STL is created in compliance with IEC 60730 Class B and IEC 61508 SIL 2 standards and is scalable to different MCUs.

Features

  • IEC 60730 Class B and IEC 61508 SIL 2 compliant self-test routines
  • CPU register and execution tests
  • SRAM and Flash memory tests
  • Clock frequency monitoring
  • Interrupt functionality verification
  • Scalable architecture for different MCU families
  • Minimal runtime overhead
  • Pre-certified library components

When to use

Use mtb-stl when developing safety-critical applications that require IEC 60730 Class B or IEC 61508 SIL 2 compliance for industrial control systems, home appliances, or other safety-critical products. The library is provided as source code that integrates with your application — you control which self-test functions to call during startup, runtime, or both. The pre-certified STL library components and supported device certifications help enable your system-level functional safety certification. You are responsible for calling the appropriate test functions at the correct points in your application and defining error handling strategies when tests fail. Infineon provides the STL middleware library and code examples in source form to support your integration.

How to use

This section assumes that the environment is configured to use the board support package (BSP) for your kit and the ModusToolbox™ software is installed on your machine.

1. Add mtb-stl library to the project

Add the mtb-stl library using the Library Manager.

2. Include the header

Include SelfTest.h in any source file that calls STL APIs:

#include "SelfTest.h"

3. Call self-test routines

Invoke the relevant self-test functions at startup or periodically in your application. The functions return OK_STATUS on success or an error code on failure.

Detailed integration examples are split into dedicated guides:

Industry Standards and Compliance

MISRA-C:2012 compliance

STL source is documented with MISRA-specific deviations at the relevant declaration or implementation site. Project-wide deviations that apply across the library are listed below.

Verification environment

ComponentNameVersion
Test SpecificationMISRA-C:2012 Guidelines for the use of the C language in critical systemsMarch 2013
MISRA Checking ToolCoverity Static Analysis Tool2022.12.0

Project deviations

MISRA Rule/DirectiveDeviation ClassRule ClassRule/Directive DescriptionDescription of Deviation(s)
4.3DRAssembly language shall be encapsulated and isolated.SRAM STL drivers contain C syntax within assembly code.
3.1RRThe character sequences /* and // shall not be used within a comment.Allow Doxygen-style comments.
5.5RRIdentifiers shall be distinct from macro names.The CAT2 PDL header cyip_can.h declares a struct field named ERROR_STATUS, matching the STL's return-status macro of the same name.
8.3RRAll declarations of an object or function shall use the same names and type qualifiers.During code analysis, the same source files are compiled multiple times with device-specific options. Identifiers remain unique for each specific run.
8.5RRAn external object or function shall be declared once in one and only one file.During code analysis, the same source files are compiled multiple times with device-specific options. Identifiers remain unique for each specific run.
8.6RRAn identifier with external linkage shall have exactly one external definition.During code analysis, the same source files are compiled multiple times with device-specific options. Identifiers remain unique for each specific run.
13.2RRThe value of an expression and its persistent side effects shall be the same under all permitted evaluation orders and shall be independent from thread interleaving.Clock self-test code performs a read-modify-write on a volatile counter/status shared with an ISR.

Release Notes and Changelog

  • RELEASE.md - Detailed release notes for all versions

License

This software is provided under the Infineon End User License Agreement (EULA). Use, reproduction, and distribution are permitted solely as described in the accompanying license agreement. The software may not be used in life-critical applications without explicit written approval from Infineon.

  • LICENSE - Infineon End User License Agreement

Copyright

(c) 2023-2026, Infineon Technologies AG, or an affiliate of Infineon Technologies AG. All rights reserved.