UM1549 User Manual: STM32 Demonstration Builder
UM1549 User Manual: STM32 Demonstration Builder
UM1549 User Manual: STM32 Demonstration Builder
Introduction
The STM32 family of 32-bit Flash microcontrollers based on the ARM Cortex M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines high performance, real-time capabilities, digital signal processing, and lowpower, low-voltage operation, while maintaining full integration and ease of development. The unparalleled and large range of STM32 devices, based on an industry-standard core and accompanied by a vast choice of tools and software, makes this family of products the ideal choice, both for small projects and for entire platform decisions. The STM32 Demonstration Builder platform is a completely new way to deliver a demonstration that can also be fully or partially reused in real applications. It relies on a full set of software components, coming in flexible licensing schemes allowing easy reuse and redistribution. All these components are organized within a module architecture that allows them to be reused separately in standalone applications. The versatility of the STM32 Demonstration Builder platform allows the dynamic addition of modules, granting access to common resources, including storage, graphical components and widgets, and memory management. The STM32 Demonstration Builder platform is built around the STM32 graphical library and the FreeRTOS real-time operating system, and uses almost the entire STM32 capability to offer a large scope of usage. This Demonstration supports STM32F2xx and STM32F4xx devices and runs on STM3220G-EVAL and STM3240G-EVAL evaluation boards from STMicroelectronics. This document describes the usage of the demonstration and the different included modules. For more details about the demonstration builder architecture, please refer to the UM1550. Table 1. Applicable tools
Type Evaluation tools Part numbers STM3220G-EVAL,STM3240G-EVAL
August 2012
1/47
www.st.com
Contents
UM1549
Contents
1 2 STM32 Demonstration Builder applications and features . . . . . . . . . . . 7 Development platform overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1 2.2 2.3 Hardware resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Software resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Firmware architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2/47
UM1549 6.1.3
6.2 6.3
Hardware configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.1 7.2 Required accessories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Jumper configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3/47
List of tables
UM1549
List of tables
Table 1. Table 2. Table 3. Table 4. Applicable tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Image formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Configuring the jumpers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4/47
UM1549
List of figures
List of figures
Figure 1. Figure 2. Figure 3. Figure 4. Figure 5. Figure 6. Figure 7. Figure 8. Figure 9. Figure 10. Figure 11. Figure 12. Figure 13. Figure 14. Figure 15. Figure 16. Figure 17. Figure 18. Figure 19. Figure 20. Figure 21. Figure 22. Figure 23. Figure 24. Figure 25. Figure 26. Figure 27. Figure 28. Figure 29. Figure 30. Figure 31. Figure 32. Figure 33. Figure 34. Figure 35. Figure 36. Figure 37. Figure 38. Figure 39. Figure 40. Figure 41. Figure 42. Figure 43. Figure 44. Figure 45. Figure 46. Figure 47. Figure 48. Development platform overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Hardware description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 STM32 software and hardware resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Firmware architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 Startup window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Initialization of kernel resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 Module applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Connectivity group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Multimedia group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Utilities group . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 System module functionalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 System Info window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Upgrade window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Bootloader startup window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Bootloader process window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Calendar module functionalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Digital clock window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Calendar window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Settings for time, date and alarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Storage units. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 Drive browser window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 File Manager error window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Content of selected drive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Contextual menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 Events log window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Info and credits window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Audio player tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Audio process flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 Audio player functionalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Audio player graphical interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Audio player settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Switching to background mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Audio equalizer window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25 Audio recorder tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Audio recorder user interface window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Audio recorder user interface recording progress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Image browser tasks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Image browser functionalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Image browser graphical user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Image effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 Browser settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 File browser window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Camera module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Camera module functionalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Camera capture window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Camera settings window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Camera viewer window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Ethernet module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5/47
List of figures Figure 49. Figure 50. Figure 51. Figure 52. Figure 53. Figure 54. Figure 55. Figure 56. Figure 57. Figure 58. Figure 59. Figure 60. Figure 61. Figure 62. Figure 63. Figure 64. Figure 65. Figure 66. Figure 67. Figure 68. Figure 69.
UM1549
Ethernet module functionalities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 DHCP server reply window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Ethernet initialization failure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Settings menu window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Connecting the board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Viewing an image in the web browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Static system information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Dynamic system information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 IP-CAM feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Distant Control: home page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Distant Control: Running tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 USB device module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 USB device functionalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Mass storage application status page . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 USB HID device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 USB settings window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Serial module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Serial module functionalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Serial terminal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Serial settings window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 Hardware configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
6/47
UM1549
An audio player with playlist and equalizer feature supporting the WAV audio format. An image browser capable of supporting and resizing BMP and JPEG formats and that can be used as background wallpaper. An audio recorder that allows voice recording in several formats and allows them to be stored in the SD card or the USB Flash disk with the possibility of playing back the recorded sample. A web server that allows communicating remotely with the board. The distant host can retrieve video streams from the board (IP Cam) and obtain system information. A clock and calendar to obtain the time, date and a set of alarms. USB device applications with a mass storage application based on the embedded SD card, HID application with touch pad. Serial: a graphical interface that allows text to be sent through the RS-232. System: features to obtain system information, set the general development platform settings and upgrade the firmware through the boot loader. A camera that can capture photos and save them in the predefined storage unit in BMP or JPEG format.
The STM32 Demonstration Builder platform also embeds a log console that allows you to track kernel and module messages as well as a file browser that allows you to explore the different storage units and directly launch the image browser and the audio player from selected files, depending on the file extension. Note: Throughout this document, STM32xxG-EVAL is used to refer to the STM322xG-EVAL board when the STM32F2xx device is used, and to the STM324xG-EVAL board when the STM32F4xx device is used.
7/47
UM1549
2
Figure 1.
Distant control. cont streaming Camera stre General app and system info f Clock and calendar c and alarm
2.1
Hardware resources
The development platform firmware essentially uses the following two major peripherals, both of which are major features of the STM32F2xx and STM32F4xx devices.
Ethernet (web server) USB on-the-go: the USB OTG FS is used in Host mode for the audio and image media storage while the USB OTG HS is used for the USB Human interface device and mass storage applications. User interface: color display, LEDs, event input (keys, touch screen). MicroSD via the SDIO interface for the USB device media storage application. I2S IP for the audio (wav) player. Digital camera interface (DCMI) for the camera application. RTC IP for the clock application.
The firmware makes use of other STM32 peripherals for development platform purposes.
Some other STM32 hardware features are used globally by the development platform application and the software environment (for example, the SysTick timer for RTOS, I2C for the I/O expander used by the touch screen...).
8/47
UM1549
Development platform overview The camera application also uses the external SRAM embedded on the STM32xxG-EVAL board to store the camera frames via the DMA before they are output to the display through the GUI.
Figure 2.
Hardware description
HS USB mass storage host
Web server
Camera image flow on LCD(FSMC) HS USB mass storage and HID devices
2.2
Software resources
Figure 3 shows the different software and hardware resources used in the STM32 Demonstration Builder platform.
9/47
UM1549
2.3
Firmware architecture
The development platform is built with a modular architecture based on a FreeRTOS realtime operating system and STM32 graphical library. The system configuration and the standard peripheral settings and configuration are made through the STM32F2xx/STM32F4xx standard peripheral libraries. Data used by the application is stored in the external USB Flash disk and the embedded MicroSD Flash through a FAT file system (FatFS).
10/47
The development platform application is built using the following software components.
STM32F2xx Standard Peripherals Library STM32F4xx DSP and Standard Peripherals Library STM32 USB USB On-The-Go Host and Device Library STM32 graphical library and extension STM32 Audio Engine - Equalizer Library STM32 Audio Engine - Loudness Control Library STM32 Audio Engine - Mixer Library FreeRTOS LibJpeg library FatFS file system LwIP TCP/IP stack
11/47
UM1549
3
3.1
Once the STM32 is running and the basic peripherals are initialized, the other kernel resources are started (USB host, RTC and backup). Figure 6. Initialization of kernel resources
12/47
UM1549
3.2
MS30292V1
Modules Zone: launches the module startup handler. System Time and Date: the update of the time and date are done by the kernel background task and can be re-adjusted in the Calendar Modules > Settings menu. Group Zone: contains the groups of modules. A group is a set of modules that have the same functions.
Note:
3.2.1
Ethernet module: allows remote communication with the board over TCP/IP. The distant host can get video streams from the board (IP Cam) as well as system information. USB Device: set of USB applications based on the mass storage class using the embedded SD card and HID class using the embedded touchscreen. Serial: a graphical interface that allows sending ASCII characters through the RS-232.
13/47
UM1549
3.2.2
Audio Player: playlist feature supporting WAV audio formats. Image Browser: capable of supporting and resizing BMP and JPEG formats and that can be used as background wallpaper. Audio Recorder : allows voice recording in the WAV format and saving it in the SD card or the USB Flash disk with the possibility of playing back the recorded sample. Camera: allows capturing a photo and saving it in the predefined storage unit in BMP or JPEG format.
3.2.3
System: used to obtain system information, set the general development platform settings and upgrade the firmware through the boot loader. Log: displays the kernel and module messages. Files: system tool used to browse the different storage units and directly launch the image browser or the audio player from the selected file depending on the file extension. Calendar: used to get the time and date and to set alarms. Credits: shows license information.
14/47
UM1549
Description of the demonstration startup process The Utilities and Multimedia group modules are described in more depth in Chapter 4 and Chapter 5.
15/47
UM1549
4
4.1
System Info: provides hardware and firmware revision information, such as board, core, STM32 device, current CPU speed and memory system size. Figure 12. System Info window
Firmware Upgrade: used to launch the firmware upgrade using the DFU protocol from the bootloader.
16/47
When the Upgrade button is activated, the Demonstration Builder application jumps to the internal boot ROM memory (system memory) of the STM32 device. For more information about the boot loader, refer to AN260 "STM32 microcontroller system memory boot mode". Since the Demonstration Builder application runs in un-privileged mode, the jump process should be performed within an interrupt handler (supervisor mode). The jump is performed in the systick handler after cleaning up the resources shared with the boot loader code, in this case the USB OTG core. Figure 14. Bootloader startup window
Once the boot loader is running, the Demonstration Builder application stops running and the upgrade module freezes. The board should be reset after the upgrade process. Note that during the firmware download, the upgrade page shows the following message. Figure 15. Bootloader process window
Bootloader running...
17/47
Description of Utilities group applications Settings: general system settings allow you to:
UM1549
Enable/disable the distant control feature for the modules supporting it. Enable/disable the background feature for the modules supporting it. Enable/disable the low-power mode. Enable/disable the LCD power saving.
Note:
Enabling the distant control feature will automatically enable the background feature. the background module feature can not be disabled when one of the background process is currently running.
4.2
Calendar module
The main menu of the calendar module shows the following features and functionalities. Figure 16. Calendar module functionalities
Digital clock: shows the clock and the date. Figure 17. Digital clock window
Calendar : shows the current time and date in a calendar format with the possibility of changes months.
18/47
The calendar module is based on the RTC peripheral and the calendar widget is added as an extension to the STM32 embedded graphical library. For more information on the calendar widget, refer to UM1550 "STM32 Demonstration Builder Development Guide". Settings: used to set the time, the date and the alarm. Figure 19. Settings for time, date and alarm
After setting the correct time and date, if an alarm is required the user can check the Enable/Modify Alarm box. Validate the new settings by clicking the Save & Quit button, or cancel the whole operation by clicking the Cancel button. Note: To ease modification, the alarm time always takes the same setting as the time. The calendar module is based on the RTC peripheral. If the RTC startup failed (an RTC initialization failure message is seen in the startup screen or in the log console in run-time), the time is set to 00:00:00 and the date is set to January 1st, 2000.
4.3
19/47
UM1549
SDIO driver
FS driver
The USB disk Flash unit is identified as Unit 0 and available only if a USB disk Flash is connected to the USB FS connector. The MicroSD Flash is identified as Unit 1 and available only if the MicroSD card is connected. The units are mounted during the startup phase of the Demonstration builder application, and are automatically detected when the physical media is connected to the board. The File Managers main menu shows the two units seen by the system as logical drives. Figure 21. Drive browser window
The two storage units can be used to play audio files, display images or save captured images from the camera. The two units are initialized during the Demonstration Builders startup phase, and are available to all the modules during the Demonstration Builders run time using the direct access feature implemented in the audio, image browser and camera modules. For more details about the direct access feature, refer to UM1550 "STM32 Demonstration Builder developer guide". When trying to open a drive which is not ready or not present on the slot/connector, the following screen is displayed showing the failure of the browser to open the selected medium.
20/47
If the media is connected and ready, the content of the selected drive is displayed as a list. Figure 23. Content of selected drive
File Browser [USB:\] Folder 1
Folder icon
Folder 2 Folder 3
Scroll bar
File icon
Folder 4 File1.ex t OK
The Up folder icon allows you to return to the parent folder. The Folder icon allows you to browse the selected folder. If the File icon is selected, a contextual menu is displayed on the top right of the selected file and indicates the possible actions relative to the file extension. Figure 24. Contextual menu
File Browser [USB:\] Folder 1 Folder 2 Folder 3 Folder 4 File1.ext Display Delete Cancel OK
If the selected file extension is "bmp" or "jpg", the first item in the contextual menu is Display. If the extension is "wav", the first item in the contextual menu is Play. If the file is not supported by any module application, the first item is omitted and only the Delete and Cancel actions are displayed.
21/47
UM1549
The scroll bar appears automatically when the number of available items on a folder exceeds the maximum possible displayed lines and disappears when it is not the case.
4.4
Log module
The log module is a system utility that saves the system and module messages in the console cache. The scroll bar allows you to parse the entire message list in the cache. Figure 25. Events log window
The console module exports the macro CONSOLE_LOG (msg) to allow any module to log event messages in the console. If the console cache is full, the first messages at the top of the cache are removed and the new messages are added at the bottom.
4.5
Credits module
The credits module is a system utility that allows you to view the license agreement of the various firmware components. Figure 26. Info and credits window
22/47
UM1549
5
5.1
Audio player GUI task: updates the GUI information (progress bar, status..) Audio player buffering task: reads an audio frame from the mass storage device, decodes it, and then performs pre-processing (equalizer, loudness) if any. This task is gated by the I2S DMA end-of-transfer interrupt.
DMA
SDIO driver
I2S
FS driver
Audio DAC
File system
Amplifier
FS driver
The transfer from the decoded buffers to the I2S interface is performed through the DMA. As such, the CPU is free to execute other tasks in parallel. Figure 28. Audio process flow
I2S
Synchronization process
MS30294V1
23/47
UM1549
While the DMA is outputting a buffer, the application manages the read/decode process of other buffers. Multi-buffering is used for this module. The audio player can be launched from the parent group or from the file manager module when an audio file is selected. The module is based on the I2S peripheral and the WAV decoder layer. The main menu of the audio player module shows the following features and functionalities. Figure 29. Audio player functionalities
Audio Player : a graphical interface that controls the audio playback actions. Figure 30. Audio player graphical interface
Volume level Progress time Playlist/file tags Exit/background Equalize/loudness Playback control Add file Toggle playlist/tags Repeat
MS30295V1
Settings: used to modify the configuration of the audio player and enable/disable related features. Figure 31. Audio player settings
24/47
UM1549
Description of Multimedia group applications The audio player supports a background feature. The graphical interface can be deactivated while the audio process runs in background mode, thus allowing another module to run simultaneously. To switch to background mode, the user must click on the exit button (see Figure 30). A contextual menu appears. Figure 32. Switching to background mode
Close: turns off the audio player. Background: disables the graphical interface and keeps the audio background process running. Cancel: abandons the user action.
To restore the graphical interface, the user has to relaunch the audio player from the multimedia group or select an audio file in the file browser and click on play in the contextual menu as described in Section 4.3: File manager module. The user can adjust the loudness and the equalizer settings by activating the audio equalizer frame. Figure 33. Audio equalizer window
Four frequency bands are handled by the equalizer: 1 kHz, 3 kHz and 18 kHz, and may be adjusted between -5 db and 5 db.
25/47
UM1549
5.1.1
Full user interface for equalizer and loudness: GUI, touch screen. File browser: SD card and USB key. Playlist management. Playback features: Play, Pause, Stop, Fast Forward/Rewind, Next, Previous, Repeat Single/All, Volume, Mute, Progress Bar File information display (title, artist, album) Graphic equalizer Background playing (multi-task)
5.1.2
Sample rate: 8 to 96 kHz. Channel number: stereo/mono Audio data format: 16 bits
5.2
Audio recorder GUI task: updates the GUI information (progress bar, status). Audio recorder buffering task: gets the recorded frame from the ADC peripheral (triggered by a timer), encodes it and writes it to the storage unit (USB disk Flash).
FS driver
Recording process
File system
Filter
ADC
FS driver
TIM
The audio recorder does not have a main menu and the recording interface frame is displayed when the application is launched from the multimedia group frame.
26/47
UM1549
Description of Multimedia group applications Figure 35. Audio recorder user interface window
When the recording process is started, the audio recorders action buttons change so as to allow the user to control the progress. Figure 36. Audio recorder user interface recording progress
Elapsed time
Stop recording and save file Pause current recording Stop recording and remove recorded data from the storage unit
5.3
27/47
UM1549
FS driver
File system
Image effects
The module can be launched from the parent group or from the file manager module (see Section 4.3: File manager module) when an image file is selected. The main menu of the image browser module shows the following features and functionalities. Figure 38. Image browser functionalities
Image browser : the image browser frame allows you to display the available images in the selected folder, after decoding, scaling and applying the image effect. The forward and backward actions are available only if the automatic advance checkbox is unchecked in the settings frame.
28/47
UM1549
Description of Multimedia group applications Figure 39. Image browser graphical user interface
Display zone : 240 x 180
Forward button
Backward button
MS30299V1
Image effects: the image effects frame allows you to apply an effect on the displayed image. The available effect are: Normal, Bluish, Greenish, Reddish and Black & White. Figure 40. Image effects
Settings: the settings frame allows you to select the source folder for the image browser and to configure it so as to enable/disable the automatic advance feature. If the automatic advance feature is enabled, you can select the image display delay among the following predefined values: 2 seconds, 5 seconds and 10 seconds.
29/47
UM1549
Display delay
Folder browser
MS31100V1
The Folder Browser action uses the file manager module to explore the storage units and select the source folder through the FILMGR_DirectEx method using the direct access feature. For more information about the direct access feature, refer to UM1550 "STM32 Demonstration Builder Developer Guide". A contextual menu is displayed when each folder icon is clicked that enables the user to either select, browse or cancel. Figure 42. File browser window
Select: sets the selected folder as the source path for the images. Browse: shows the content of the selected folder. The Image browser supports the following image formats. Table 2. Image formats
Resolution BMP JPEG 160 x 120 to 1024 x 768 160 x 120 to 1024 x 768 Compression No Yes Bpp 16/24 16/24
30/47
UM1549
5.4
Camera module
The camera module retrieves the raw data and displays it on the LCD with the possibility of saving the captured frame in a BMP or JPEG format in the storage units. The destination folder and the capture image format can be selected and configured in the camera setting frame. The camera module uses the DCMI interface (16 bits) to capture the data frame from the camera and put it in the external SRAM in QVGA mode (320 x 240), after applying the image effect defined in the settings frame. Once the data is in the external SRAM, it is resized to QQVGA 160x120 format and displayed in the camera capture display zone. If the capture is activated, the DCMI is temporary suspended and the last available image on the external SRAM is converted into a 24-bit Bpp format and then encoded and saved to a BMP or JPEG format in the destination folder following the parameters set in the camera settings frame. Figure 43. Camera module
Image effects Camera capture process Image Format selector SDIO driver
JPEG encoder
FS driver
Image display
FS driver
For the JPEG encoder, the LibJpeg library is called and the following parameters are used.
For the BMP format, a bmp header with the following parameters is added to the top of the raw data (24 bits) and then saved to the selected storage unit.
The main menu of the camera module shows the following features and functionalities.
31/47
UM1549
Capture: displays the frames captured by the camera and allows the user to capture photos and save them in the storage units. The user interface also offers the possibility of modifying the brightness of the camera. When the captured image is saved, the name of the file is displayed at the top of the image display frame. Figure 45. Camera capture window
Settings: used to select the image format to be saved in the storage units, the image effects and the destination folder. Figure 46. Camera settings window
Viewer : displays the last captured images available in the camera capture folder. The forward and backward actions allow you to navigate within the available images. The
32/47
UM1549
Description of Multimedia group applications camera viewer is an image browser feature that uses the same graphical resources as the image browser modules and that is accessible through the IMAGE_CameraView. Figure 47. Camera viewer window
33/47
UM1549
6
6.1
Static system information: general information about STM32 devices stored in the STM32 Flash using a local file system. Dynamic system information: information about RTOS tasks and their status. IP-CAM feature: sends video frames captured using the DCMI interface over the Ethernet interface. TCP/IP stack based on LWIP needed to transfer the data over Ethernet. FreeRTOS real-time operating system. Image capturing sensor and storage data feature to store data in the external SRAM.
When the system is first turned on, the camera is configured as per the parameters selected by the user. The webserver application consists of four tasks: one for TCP/IP activity, one for the DHCP startup, one for the Ethernet module GUI update and the last for preparing the data and the image to be transferred over Ethernet. Figure 48. Ethernet module
To begin with, the LWIP task is initialized, followed by the initialization of the HTTP. Here the application runs as an HTTP web server. For HTTP, the reserved port number is 80. As such, the application binds to port number 80 that the server "listens to" or expects to receive requests from a Web client. The application runs the scheduler which periodically monitors the respective tasks. For the IP-CAM feature, the camera provides the inverted image in the buffer in RGB565 format. To display the image perfectly, the application should swap the image row-wise. The main menu of the Ethernet module shows the following features and functionalities.
34/47
UM1549
Web Server : starts by showing the initialization frame to indicate the following:
Ethernet initialization status and speed. DHCP process status1- waiting for DHCP server reply IP address assigned by DHCP server. Static IP address. Ethernet cable connection/disconnection status. Running process information.
If the initialization phase failed (unplugged cable, connection cannot be established), the initialization frame indicates an error asking the user to check the hardware connection. Figure 51. Ethernet initialization failure
Once the initialization phase has been completed, and an IP address has been assigned to the STM32xxG-EVAL board, the user can connect to the application through a web browser.
35/47
Description of Connectivity group applications Settings: enables/disables the DHCP protocol and the IP-CAM image format. Figure 52. Settings menu window
UM1549
Distant Control: when clicked, the Ethernet main menu is closed and the Ethernet web server/remote control starts working as a background task.
6.1.1
ensure the camera is perfectly fitted on the board. ensure that all the jumpers are correctly connected. connect the board to the LAN (local area network) using an Ethernet cable or connect the board directly to the PC using an Ethernet switch/hub to test the functionality of the board as shown in Figure 53.
MS31102V1
Once the IP address is assigned (through DHCP or assigned statically), the user can view the image captured by the camera through a computer on the network using a standard web browser. To obtain the system information data or the image in a web browser, you must type the IP address of the board in the address bar of the browser as shown in Figure 54.
36/47
UM1549
Description of Connectivity group applications Figure 54. Viewing an image in the web browser
6.1.2
Webserver functions
The webserver holds the following functions. Static system information: general information about STM32 devices stored in the STM32 Flash using a local file system. Figure 55. Static system information
37/47
Description of Connectivity group applications Dynamic system information: information about RTOS tasks and their status. Figure 56. Dynamic system information
UM1549
IP-CAM feature: sends captured video frames using the DCMI interface over the Ethernet interface. Figure 57. IP-CAM feature
6.1.3
38/47
UM1549
Description of Connectivity group applications Figure 58. Distant Control: home page
Running tasks information: information about RTOS tasks and their status. This page allows you to get dynamic information about RTOS running tasks and their status, including name, status, priority, stack memory and number. Figure 59. Distant Control: Running tasks
39/47
UM1549
6.2
Application
SDIO
MSC class
HID class
IO expander
MS31103V1
The main menu of the USB device module shows the following features and functionalities. Figure 61. USB device functionalities
Mass storage: launches the mass storage application and shows the status page to indicate the MicroSDs connection state and the USBs power and configuration states.
40/47
UM1549
Description of Connectivity group applications Figure 62. Mass storage application status page
Touch Pad: launches the HID application and shows the status page to indicate the USB power and configuration state. Figure 63. USB HID device
The touchpad is a touch-sensitive interface zone that senses the position of a user's finger to provide cursor movement. Settings: allows changing the mass storage media buffer size to enhance the write and read performance. Also used to define the HIDs polling time. Figure 64. USB settings window
41/47
UM1549
6.3
Serial module
The serial module allows the user to send an alphanumeric ASCII text through the USART peripheral. Figure 65. Serial module
Virtual keyboard
USART
MS31106V1
The main menu of the serial module shows the following features and functionalities. Note: The Serial module shares some H/W resources with the SD card. Launching the serial terminal will close all the processes using the SD. Figure 66. Serial module functionalities
Serial Terminal: a graphical interface with an alphanumeric virtual keyboard with lowercase and uppercase support, used to send ASCII characters to the host over the USART peripheral. Figure 67. Serial terminal
Send text
MS31104V1
42/47
UM1549
Description of Connectivity group applications Settings: used to change the configuration of the serial communication. Figure 68. Serial settings window
43/47
Hardware configuration
UM1549
Hardware configuration
Figure 69. Hardware configuration
MicroSD connector USB FS connector Ethernet connector USART connector USB HS connector ST Link/USB connector JLink connector
MS31105V1
7.1
Required accessories
In addition to the STM32xxG-EVAL board, the Demonstration Builder requires the following accessories (provided with the EVAL board package):
USB Flash disk. MicroSD card. Headphones with male jack connector. Micro-AB to standard receptacle A connector. Micro-AB to standard plug A connector.
44/47
UM1549
Hardware configuration
7.2
Jumper configuration
Table 3.
Jumper JP5 JP6 JP8 JP16 JP19 JP31 SW1 SW1
45/47
Revision history
UM1549
Revision history
Table 4.
Date 06-Aug-2012
46/47
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (ST) reserve the right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any time, without notice. All ST products are sold pursuant to STs terms and conditions of sale. Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no liability whatsoever relating to the choice, selection or use of the ST products and services described herein. No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN STS TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. UNLESS EXPRESSLY APPROVED IN WRITING BY TWO AUTHORIZED ST REPRESENTATIVES, ST PRODUCTS ARE NOT RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USERS OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries. Information in this document supersedes and replaces all information previously supplied. The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.
2012 STMicroelectronics - All rights reserved STMicroelectronics group of companies Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan Malaysia - Malta - Morocco - Philippines - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America www.st.com
47/47