Getting started
4.2
Developing your own application
This section describes the successive steps to create your own application using
STM32CubeF2.
1.
Creating your project: to create a new project you can either start from the Template
project provided for each board under \Projects\<STM32xx_xxx>\Templates or
from any available project under \Projects\<STM32xx_xxx>\Examples or
\Projects\<STM32xx_xxx>\Applications.
Note: <STM32xx_xxx> refers to the board name, for exampleSTM322xG_EVAL.
The Template project provides an empty main loop function. It is a good starting point
to get familiar with the project settings for STM32CubeF2. It has the following
characteristics:
a)
b)
c)
d)
Note:
If you copy an existing project to another location make sure to update the include paths.
2.
Adding the Middleware to your project (optional): the available Middleware stacks
are USB Host and Device Libraries, STemWin, FreeRTOS, FatFS, LwIP, and
PolarSSL. To know which source files you need to add in the project files list refer to the
documentation provided for each Middleware.
For a better view of the sources files to be added and the include paths, look at the
Applications available under
\Projects\STM32xx_xxx\Applications\<MW_Stack>, where <MW_Stack>
refers to the Middleware stack, for example USB_Device.
3.
Configuring the firmware components: the HAL and Middleware components offer a
set of build time configuration options using macros "#define" declared in a header file.
A template configuration file is provided within each component, it has to be copied to
the project folder (usually the configuration file is named xxx_conf_template.h.
Make sure to remove the word "_template" when copying the file to the project folder.
The configuration file provides enough information to know the impact of each
14/19
It contains the sources of HAL, CMSIS and BSP drivers which are the minimum
required components to develop a code on a given board.
It contains the include paths for all the firmware components.
It defines the STM32F2 device supported, allowing to configure the CMSIS and
HAL drivers accordingly.
It provides ready-to use user files preconfigured as, for example:
- HAL is initialized.
- SysTick ISR implemented for HAL_Delay() purpose.
- System clock is configured with the maximum frequency of the device
DocID026120 Rev 2
UM1739
Need help?
Do you have a question about the STM32F2 Series and is the answer not in the manual?
Questions and answers