ST STM32CubeF4 User manual

July 2016 DocID026161 Rev 4 1/111
UM1743
User manual
STM32CubeF4 demonstration platform
Introduction
The STM32Cube initiative was originated by STMicroelectronics to ease developers’ life by
reducing development efforts, time and cost. STM32Cube covers the STM32 portfolio.
The STM32CubeF4 demonstration platform comes on top of the STM32Cube as a firmware
package that offers a full set of software components based on a modules architecture that
makes it possible to re-use them separately in standalone applications.
All these modules are managed by the STM32CubeF4 demonstration kernel, with the
possibility of dynamically add new modules and access the common resources (storage,
graphical components and widgets, memory management, Real-Time operating system).
The STM32CubeF4 demonstration platform is built around the powerful graphical library
STemWin and the FreeRTOS real time operating system. It uses almost the whole STM32
capability to offer a large scope of usage based on the STM32Cube HAL BSP and several
middleware components.
The architecture is defined with the goal of making from the STM32CubeF4 demonstration
core an independent central component that can be used with several RTOS and third party
firmware libraries, through several abstraction layers inserted between the STM32CubeF4
demonstration core and the modules and libraries working around it.
The STM32CubeF4 demonstration platform supports STM32F4xx devices and runs on
STM324x9I-EVAL, STM324xG-EVAL, STM32F429I-Discovery, STM32446E-EVAL,
STM32F479I-EVAL, STM32F469I-DISCO and STM32F412G-Discovery boards.
www.st.com

Contents UM1743
2/111 DocID026161 Rev 4
Contents
1 STM32Cube overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2 Global architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 Kernel description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11
3.2 Kernel initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3 Kernel processes and tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.4 Kernel graphical aspect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.5 ST widget add-ons . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5.1 ST animated icon view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5.2 ST slider skin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.6 Kernel menu management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.7 Modules manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.8 Direct open feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
3.9 Backup and settings configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.10 Storage units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.11 Clock and date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.12 Memory management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.13 Demonstration repository . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.14 Kernel components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.15 Kernel core files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.16 Hardware settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4 How to create a new module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.1 Creating the graphical aspect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.2 Graphics customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.3 Module implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
4.4 Adding a module to the main desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.5 Module's direct open . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5 Demonstration customization and configuration . . . . . . . . . . . . . . . . 40

DocID026161 Rev 4 3/111
UM1743 Contents
4
5.1 LCD configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.2 Layers management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.3 Touchscreen calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
5.4 BSP customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.4.1 SDRAM configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5.4.2 Touch screen configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
6 Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.1 Multi buffering features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.2 Multi layers feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
6.3 Hardware acceleration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
7 Footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.1 Kernel footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.2 Module footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.3 STemWin features resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.3.1 JPEG decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.3.2 GUI components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
8 Demonstration functional description
(STM324x9I-EVAL, STM324xG-EVAL,
STM32F429I-Discovery and STM32446E-EVAL) . . . . . . . . . . . . . . . . . . 52
8.1 Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
8.1.1 CPU usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
8.1.2 Kernel log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
8.1.3 Process viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
8.2 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
8.2.1 System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
8.2.2 File browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
8.2.3 Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
8.2.4 Benchmark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.2.5 Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.2.6 Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
8.2.7 USB mass storage device (USBD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
8.2.8 Camera . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
8.2.9 Image viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

Contents UM1743
4/111 DocID026161 Rev 4
9 Demonstration functional description
(STM32F479I-EVAL and STM32F469I-DISCO) . . . . . . . . . . . . . . . . . . . . 77
9.1 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
9.1.1 Audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
9.1.2 Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
9.1.3 Audio recorder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
9.1.4 VNC server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
9.1.5 Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
9.1.6 Garden control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
9.1.7 Home Alarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
9.1.8 System information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
10 Demonstration functional description
(STM32F412GDISCO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
10.1 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
10.1.1 Audio player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
10.1.2 Audio recorder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
10.1.3 Video module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
10.1.4 Analog clock module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
10.1.5 USB devices module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
10.1.6 System information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
11 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

DocID026161 Rev 4 5/111
UM1743 List of tables
5
List of tables
Table 1. File system interface: physical storage control functions . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Table 2. File system interface APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Table 3. APIs from the RTC module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
Table 4. APIs from the memory manager module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Table 5. Kernel components list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Table 6. Kernel core files list. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Table 7. Jumpers for different demonstration boards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Table 8. LCD frame buffer locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Table 9. Camera frame buffer locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Table 10. Kernel files footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Table 11. Modules footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Table 12. RAM requirements for some JPEG resolutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Table 13. MemoSTemWin components memory requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Table 14. Widget memory requirements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Table 15. Available settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Table 16. Data structure for audio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Table 17. Audio module controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Table 18. Video module controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Table 19. Batch files description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Table 20. Variables description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Table 21. Parameters description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
Table 22. Data structure for USBD module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Table 23. USBD module controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Table 24. Camera module controls. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Table 25. Image viewer module controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Table 26. Image viewer module controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Table 27. Video module controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Table 28. Batch file description. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Table 29. Variable description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Table 30. Parameters description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Table 31. Audio module controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Table 32. VNC server module controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Table 33. Audio player module controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Table 34. Audio recorder module controls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Table 35. Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

List of figures UM1743
6/111 DocID026161 Rev 4
List of figures
Figure 1. STM32Cube block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 2. STM32Cube architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 3. Kernel components and services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 4. Startup window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
Figure 5. Startup window for STM32446E-EVAL , STM32F479I-EVAL,
STM32F469I-DISCO and STM32F412G-DISCO demonstrations . . . . . . . . . . . . . . . . . . . 14
Figure 6. Main desktop window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Figure 7. Main desktop window for STM32446E-EVAL demonstration . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 8. Main desktop window for STM32479I-EVAL demonstration. . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 9. Main desktop window for STM32469I-DISCO demonstration . . . . . . . . . . . . . . . . . . . . . . 15
Figure 10. Main desktop window for STM32412G-DISCO demonstration. . . . . . . . . . . . . . . . . . . . . . 16
Figure 11. Icon view widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 12. Slider skin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Figure 13. Status bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 14. Status bar for STM32446E-EVAL demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
Figure 15. Icon view widget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 16. Icon view widget for STM32446E-EVAL demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 17. Functionalities and properties of modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 18. Starting file execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 19. Starting file execution for STM32446E-EVAL demonstration . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 20. Available storage units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Figure 21. Software architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Figure 22. Detection of storage units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 23. Detection of storage units for STM32446E-EVAL demonstration. . . . . . . . . . . . . . . . . . . . 27
Figure 24. Setting the time and the date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Figure 25. Setting the time and the date for STM32446E-EVAL demonstration . . . . . . . . . . . . . . . . . 29
Figure 26. Memory heap for STM32CubeF4 demonstration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 27. Folder structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 28. STM32Cube demonstration boards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Figure 29. GUI Builder overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Figure 30. Graphics customization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Figure 31. Direct open from file browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Figure 32. LCDConf location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Figure 33. k_calibration.c location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Figure 34. Calibration steps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 35. SDRAM initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Figure 36. Touch screen initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Figure 37. Example of tearing effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Figure 38. Independent layer management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Figure 39. CPU usage display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
Figure 40. CPU usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Figure 41. Example of Log messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
Figure 42. Process viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Figure 43. Demonstration global information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Figure 44. Demonstration general settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Figure 45. Clock setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Figure 46. File browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Figure 47. File browser module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58

DocID026161 Rev 4 7/111
UM1743 List of figures
8
Figure 48. File opening from browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
Figure 49. File properties display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Figure 50. Reversi game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Figure 51. Benchmarking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Figure 52. Audio player module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Figure 53. Audio player module startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Figure 54. Video player module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Figure 55. Video player module startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Figure 56. EMF generation environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Figure 57. JPEG2Movie overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Figure 58. EMF file generation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Figure 59. USBD module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Figure 60. USBD module startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Figure 61. Camera module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Figure 62. Camera module startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Figure 63. Image viewer architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Figure 64. Image viewer startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
Figure 65. Audio player module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Figure 66. Audio player module performance mechanisms. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Figure 67. Start audio player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Figure 68. Adding audio files to the playlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Figure 69. Equalizer and loudness frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Figure 70. Background mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
Figure 71. Hardware connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Figure 72. Video player module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Figure 73. Video player module performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Figure 74. Start video player . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
Figure 75. Adding files to the playlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Figure 76. Warning popup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Figure 77. Video is playing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Figure 78. Hiding control keys and other information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Figure 79. EMF generation format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Figure 80. JPEG2Movie overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Figure 81. EMF file generation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Figure 82. Audio recorder module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Figure 83. Audio recorder module startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Figure 84. Start Audio recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Figure 85. Stop Audio recording . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Figure 86. Play the recorded wave file. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Figure 87. Hardware connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Figure 88. Video player module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Figure 89. VNC server module startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Figure 90. Enable / Disable secure mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Figure 91. Start VNC server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Figure 92. IP address assigned . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
Figure 93. Run VNC Client . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Figure 94. Background mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Figure 95. Hardware connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Figure 96. Reversi game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Figure 97. Garden control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
Figure 98. Home alarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Figure 99. Watching a room. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98

List of figures UM1743
8/111 DocID026161 Rev 4
Figure 100. System information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Figure 101. Audio player module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Figure 102. Audio player module startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Figure 103. Audio recorder module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
Figure 104. Audio recorder module startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Figure 105. Video recorder module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Figure 106. Video recorder module startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Figure 107. Analog clock module startup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Figure 108. Analog clock setting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Figure 109. USBD module architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Figure 110. USBD module startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
Figure 111. Connection of an USB device. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Figure 112. System information module startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

DocID026161 Rev 4 9/111
UM1743 STM32Cube overview
110
1 STM32Cube overview
The STM32Cube initiative was originated by STMicroelectronics to ease developers’ life by
reducing development efforts, time and cost. STM32Cube covers the STM32 portfolio.
STM32Cube Version 1.x includes:
•The STM32CubeMX, a graphical software configuration tool that allows to generate C
initialization code using graphical wizards.
•A comprehensive embedded software platform, delivered per series (such as
STM32CubeF4 for STM32F4 series)
– The STM32CubeF4 HAL, an STM32 abstraction layer embedded software,
ensuring maximized portability across STM32 portfolio
– A consistent set of middleware components such as RTOS, USB, TCP/IP,
Graphics
– All embedded software utilities coming with a full set of examples.
Figure 1. STM32Cube block diagram

Global architecture UM1743
10/111 DocID026161 Rev 4
2 Global architecture
The STM32CubeF4 demonstration is composed of a central kernel based on a set of
firmware and hardware services offered by the STM32Cube middleware and the several
evaluation and discovery boards and a set of modules mounted on the kernel and built in a
modular architecture. Each module can be reused separately in a standalone application.
The full set of modules is managed by the Kernel which provides access to all common
resources and facilitates the addition of new modules as shown in Figure 2.
Each module should provide the following functionalities and proprieties:
1. Icon and graphical aspect characteristics.
2. Method to startup the module.
3. Method to close down safety the module (example: Hot unplug for Unit Storage)
4. Method to manage low power mode
5. The module application core ( main module process)
6. Specific configuration
7. Error management
Figure 2. STM32Cube architecture

DocID026161 Rev 4 11/111
UM1743 Kernel description
110
3 Kernel description
3.1 Overview
The role of the demonstration kernel is mainly to provide a generic platform that control and
monitor all the application processes, the kernel provides a set of friendly user APIs and
services that allow to the user modules to have access to all the hardware and firmware
resources and provide the following tasks and services:
•Hardware and modules initialization:
– BSP initialization (LEDs, SDRAM, Touch screen, CRC, SRAM, RTC, QSPI and
audio)
– GUI initialization and Touch screen calibration
•Memory management
•Kernel log
•Graphical resources and main menu management.
•Storage managements (USB Disk flash and microSD)
•System monitoring and settings
•Time and date resources management
•File browsing and contextual menu
•CPU utilities (CPU usage, running tasks)
Figure 3. Kernel components and services

Kernel description UM1743
12/111 DocID026161 Rev 4
3.2 Kernel initialization
The first task of the kernel is to initialize the hardware and firmware resources to make them
available to its internal processes and the modules around it. The kernel starts by initializing
the HAL, system clocks and then the hardware resources needed during the middleware
components:
•LEDs and Touchscreen
•SDRAM/SRAM
•Backup SRAM
•RTC
•Quad-SPI Flash memory
•Audio Interface
Note: Not all the hardware resources can be used in all demonstration platforms, according to the
availability and to the integrated modules.
Once the low level resources are initialized, the kernel performs the STemWin GUI library
initialization and prepares the following common services:
•Memory manager
•Storage units
•Modules manager
•Kernel Log
Upon full initialization phase, the kernel adds and links the system and user modules to the
demonstration core.
3.3 Kernel processes and tasks
The kernel is composed of two main tasks managed by FreeRTOS through the CMSIS-OS
wrapping layer:
•GUI Thread: this task Initializes the demonstration main menu and then handles the
graphical background task when requested by the STemWin;

DocID026161 Rev 4 13/111
UM1743 Kernel description
110
•Timer Callback: this is the callback of the Timer managing periodically the touch screen
state, the Timer callback is called periodically each 40 milliseconds.
3.4 Kernel graphical aspect
The STM32CubeF4 demonstration is built around the STemWin Graphical Library, based on
SEGGER emWin one. STemWin is a professional graphical stack library, enabling Graphical
User Interfaces (GUI) building up with any STM32, any LCD and any LCD controller, taking
benefit from STM32 hardware accelerations, whenever possible.
The graphical aspect of the STM32CubeF4 demonstration is divided into two main graphical
components:
•the startup window (Figure 4 and Figure 5), showing the progress of the hardware and
software initialization;
•the main desktop (shown in figures 6, 7, 8and 9), that handles the main demonstration
menu and the many kernel and module controls.
Figure 4. Startup window

Kernel description UM1743
16/111 DocID026161 Rev 4
Figure 10. Main desktop window for STM32412G-DISCO demonstration
3.5 ST widget add-ons
Note: This section is applicable only for STM32F479I-EVAL and STM32F469I-DISCO
demonstrations.
The ST_addons binary file provided with STM32F4 demonstration contains new widgets
based on STemWin graphical library:
•ST animated icon view
•ST slider skin
3.5.1 ST animated icon view
A new icon view widget is delivered with STM32F4 demonstration based on STemWin
graphical library.
The new widget offers the possibility to turn all the modules icons in the menu after startup
with a configured number of frames and configured a delay between each frame.
The new icon view (see Figure 11) offers also the possibility to configure the module name
with two different colors and fonts.
Figure 11. Icon view widget

DocID026161 Rev 4 17/111
UM1743 Kernel description
110
3.5.2 ST slider skin
A new slider skin is delivered with STM32F4 demonstration based on STemWin graphical
library. The new skin offers the possibility to change the slider color and the behavior as
shown in Figure 12.
Figure 12. Slider skin
3.6 Kernel menu management
The main demonstration menu is initialized and launched by the GUI thread. Before the
initialization of the menu the following actions are performed:
•Draw the background image.
•Create the status bar (not applicable for STM32F479I-EVAL, STM32F469I-DISCO and
STM32F412G-DISCO demonstrations).
•Restore general settings from backup memory.
•Setup the main desktop callback to manage main window messages.
The main desktop is built around two main graphical components:
•The status bar (Figure 13 and Figure 14): indicates the storage units connection status,
current time and date and a system button to allow to get system information like
(running task, CPU load, and kernel log).
•The icon view widget (Figure 15 and Figure 16): contains the icons associated to
added modules. User can launch a module by a simple click on the module icon.

DocID026161 Rev 4 19/111
UM1743 Kernel description
110
Figure 15. Icon view widget
Figure 16. Icon view widget for STM32446E-EVAL demonstration
A module is launched on simple click on the associated icon by calling to the startup
function in the module structure; this is done when a WM_NOTIFICATION_RELEASED
message arrives to the desktop callback with ID_ICONVIEW_MENU:
069

Kernel description UM1743
20/111 DocID026161 Rev 4
3.7 Modules manager
The modules are managed by the kernel; the latter is responsible of initializing the modules,
initializing hardware and GUI resources relative to the modules and initializing the common
resources such as the storage Unit, the graphical widgets and the system menu.
Each module should provide the following functionalities and proprieties:
1. Icon and graphical component structure.
2. Method to startup the module.
3. Method to close down safety the module (example: Hot unplug for MS flash disk)
4. Method to manage low power mode (optional)
5. The Application task
6. The module background process (optional)
7. Remote control method (optional)
8. Specific configuration
9. Error management
Table of contents
Other ST Motherboard manuals

ST
ST STLINK-V3SET User manual

ST
ST NUCLEO-H745ZI-Q User manual

ST
ST SPC58XXADPT144S REV.B User manual

ST
ST L9679E-EVB User manual

ST
ST STLink User manual

ST
ST STUSB02E User manual

ST
ST STEVAL-ISW001V1 User manual

ST
ST NUCLEO-WL55JC STM32WL User manual

ST
ST STEVAL-BLUEMIC-1 User manual

ST
ST STM32H757I-EVAL User manual

ST
ST STEVAL-ISC004V1 User manual

ST
ST STM32U5 User manual

ST
ST EVAL-L9177A User manual

ST
ST EVAL-L99MOD5xXP User manual

ST
ST NUCLEO-F207ZG User manual

ST
ST EVAL-RHRPMPOL01 User manual

ST
ST SPC58XXADPT144S REV.B User manual

ST
ST FP-SNS-6LPNODE1 User manual

ST
ST STM3221G-EVAL User manual

ST
ST UM2313 User manual