August 2019 AN3307 Rev 6 1/38
1
AN3307
Application note
Guidelines for obtaining IEC 60335
Class B certification for any STM32 application
Introduction
The role of safety has become very important for electronics applications. The level of safety
requirements for components used in electronic designs is steadily increasing. The
manufacturers of electronic devices include many new technical solutions in the design of
new components. Software techniques for improving safety are continuously being
developed.
The current safety recommendations and requirements are specified at worldwide level by
recognized international standards bodies such as IEC (International electrotechnical
commission) and come under the compliance, verification and certification process of
testing houses and authorities like VDE (Association for electrical, electronic and
information technologies). The certification process is closely associated with the
Electromagnetic compatibility (EMC) tests when the robustness of the system against the
noise emission and the noise sensitivity is tested for the compliance with international
standards.
The main purpose of this application note and its associated software
(a)
(STM32-CLASSB-SPL) is to facilitate and accelerate the user software development and
the certification processes for appliances which are subject to these requirements and
certifications and are based on some of the ST 32-bit family of microcontrollers.
There are three packages certified by VDE for the 32-bit ST microcontrollers covering the
STM32F0, STM32F1 and STM32F3 Series microcontrollers, referred to in this document as
STM32F. All the certified packages are based on dedicated CMSIS and standard peripheral
libraries (SPL) and all of them use similar principles described by this document, with focus
on the main differences. While using the hardware and firmware compatibility between ST
families, these packages can also be adapted for some other ST 32-bit microcontrollers not
certified for SPL (for example STM32F2, STM32F4 or STM32L1 Series)
(b)
.
a. All the Class B firmware packages are available upon request only, contact the nearest ST sales office.
b. STMicroelectronics is developing derivative firmware supporting new products step by step. Contact the local
ST sales office to obtain the latest information about available packages and plans for their certification.
www.st.com
Contents AN3307
2/38 AN3307 Rev 6
Contents
1 Package variation overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Main differences between STM32F packages
and their possible modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 Compliance with IEC and VDE standards . . . . . . . . . . . . . . . . . . . . . . . 11
3.1 Generic tests included in the STM32F firmware library . . . . . . . . . . . . . . 12
3.2 Application-specific tests not included in the ST firmware library . . . . . . . 14
4 Class B software package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1 Basic software principles used . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1.1 Fail Safe mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1.2 Class B variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1.3 Class B flow control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 Package organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.2.1 Projects included in the package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.2.2 Tool-specific integration of the library . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.2.3 Application demonstration example . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3 Package configuration and debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3.1 Configuration control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3.2 Verbose diagnostic mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3.3 Debugging the package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5 Class B solution structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.1 Integrating the software into the user application . . . . . . . . . . . . . . . . . . . 22
5.2 Description of startup self tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.2.1 CPU startup self-test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.2.2 Watchdog startup self-test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.2.3 Flash complete checksum self-test . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.2.4 Full RAM March C-/X self-test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.2.5 Clock startup self-test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
5.3 Periodic runtime self-test initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.4 Description of periodic runtime self-tests . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.4.1 Runtime self-test structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31