
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