![]() |
STM32Cube
Version 2.0
Create Projects for STM32F2 Series with STM32Cube HAL and STM32CubeMX
|
The STM32 Device Family Pack (DFP) adds several Software Components and User Code Templates that give you easy access to the STM32Cube HAL. The DFP adds also CMSIS-Drivers for all relevant peripherals that are easy to configure using the classic RTE_Device.h configuration files. The implementation is prepared for the STM32CubeMX configuration utility that gives better visibility to device constrains (to avoid resource conflicts with I/O pins and DMA).
The following table lists the Software Components that are part of the STM32 DFP and essential for STM32Cube.
Component | Description |
---|---|
::Board Support | Board Support interfaces for I/O hardware of several evaluation boards. |
::CMSIS Driver | Unified device drivers compliant to the CMSIS-Driver specification. These drivers are implemented using the functions of the STM32Cube HAL. |
::Device:Startup | Startup and system file for the STM32 device series. |
::Device:STM32Cube Framework | Configuration setup for the STM32Cube. The component "Classic" adds the RTE_Device.h file that is used for configuration of CMSIS-Drivers. |
::Device:STM32Cube HAL | STM32Cube Hardware Abstraction Layer (HAL) for the STM32 device as provided by ST Microelectronics. |
The following table lists the User Code Templates that are part of the STM32 DFP and help you to setup projects quickly. These template files are derived from original STM32Cube files (except Flash templates).
Component | Template Name | Description |
---|---|---|
::Device:STM32Cube Framework:Classic | MCU Specific HAL Initialization / De-Initialization | Adds stm32f2xx_hal_msp.c for microcontroller specific peripheral initialization and de-initialization for STM32Cube HAL. |
Exception Handlers and Peripheral IRQ | Adds stm32f2xx_it.c, stm32f2xx_it.h for overwriting default exception handlers. | |
'main' module for STM32Cube | Adds main.c, main.h for the user application main routine. | |
::Device:Startup | Flash Option Bytes | Configuration file for the Flash option bytes that allows Read/Write protect and user configuration. |
Flash One-Time programmable Bytes | Configuration file for the on-time programmable bytes in the Flash ROM. |
The complete STM32Cube firmware is included in the STM32 Device Family Pack with identical directory structure.
To provide the CMSIS-Pack and CMSIS-Driver specific functionality, the following directories are added:
Directory or File | Description |
---|---|
.\CMSIS\Driver | Source code of the CMSIS-Driver implementations. |
.\CMSIS\Flash | CMSIS-Pack Flash algorithms for the various STM32 devices. |
.\CMSIS\SVD | CMSIS-SVD files for the various STM32 devices. |
.\MDK\Boards | Board support files including interfaces, example projects, and documentation. |
.\MDK\CubeMX | Adaptation files and interface for STM32CubeMX. |
.\MDK\Device | File Templates for Flash Option Byte programming. |
.\MDK\Templates | User Code Templates (see details below). |
.\Documents | Documentation of the STM32 Cube HAL and User Manuals and Datasheets for the various STM32 devices to allow easy access in the IDE. |
Keil.STM32F2xx_DFP.pdsc | CMSIS-Pack package description file for the STM32 Device Family Pack. |
Details**
The directory .\MDK\Templates contains several user code template files that are taken from the STM32Cube framework. Some of these files are modified as described below.
File | Change Description |
---|---|
.\Inc\main.h | STM32Cube HAL 'main' header file (unmodified). |
.\Src\main.c | STM32Cube HAL 'main' source code with additions for CMSIS-RTOS. When CMSIS-RTOS RTX is used, the functions HAL_GetTick, HAL_InitTick gets modified to avoid a conflict with the RTOS SystemTick IRQ function. |
.\Inc\stm32f2xx_it.h | STM32Cube HAL Exception Handlers and Peripheral IRQ (unmodified). |
.\Src\stm32f2xx_it.c | STM32Cube HAL Exception Handlers and Peripheral IRQ with additions for CMSIS-RTOS. When CMSIS-RTOS RTX is used, then the handlers for SVC_Handler, PendSV_Handler, and SysTick_Handler are omitted to avoid conflicts with CMSIS-RTOS RTX that already provides service for these exceptions. |
.\Src\stm32f2xx_hal_msp.c | MCU Specific HAL Initialization / De-Initialization for the STM32Cube HAL (unmodified). This file is typically generated by the STM32CubeMX configuration utility but can also be user configured. |
.\Src\stm32f2xx_hal_conf.h | STM32Cube HAL configuration header file. Modified to support configuration via the Run-Time Environment (RTE) Manager. |