Skip to content

Commit b9a61de

Browse files
committed
STM32F2: alignment with other families
1 parent f449a61 commit b9a61de

File tree

17 files changed

+186
-207
lines changed

17 files changed

+186
-207
lines changed

targets/TARGET_STM/TARGET_STM32F2/CMakeLists.txt

Lines changed: 7 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
if("NUCLEO_F207ZG" IN_LIST MBED_TARGET_LABELS)
5-
add_subdirectory(TARGET_NUCLEO_F207ZG)
5+
add_subdirectory(TARGET_STM32F207xG)
66
endif()
77

88
target_sources(mbed-core
@@ -15,73 +15,15 @@ target_sources(mbed-core
1515
serial_device.c
1616
spi_api.c
1717

18-
device/stm32f2xx_hal.c
19-
device/stm32f2xx_hal_adc.c
20-
device/stm32f2xx_hal_adc_ex.c
21-
device/stm32f2xx_hal_can.c
22-
device/stm32f2xx_hal_cortex.c
23-
device/stm32f2xx_hal_crc.c
24-
device/stm32f2xx_hal_cryp.c
25-
device/stm32f2xx_hal_dac.c
26-
device/stm32f2xx_hal_dac_ex.c
27-
device/stm32f2xx_hal_dcmi.c
28-
device/stm32f2xx_hal_dma.c
29-
device/stm32f2xx_hal_dma_ex.c
30-
device/stm32f2xx_hal_eth.c
31-
device/stm32f2xx_hal_flash.c
32-
device/stm32f2xx_hal_flash_ex.c
33-
device/stm32f2xx_hal_gpio.c
34-
device/stm32f2xx_hal_hash.c
35-
device/stm32f2xx_hal_hcd.c
36-
device/stm32f2xx_hal_i2c.c
37-
device/stm32f2xx_hal_i2s.c
38-
device/stm32f2xx_hal_irda.c
39-
device/stm32f2xx_hal_iwdg.c
40-
device/stm32f2xx_hal_mmc.c
41-
device/stm32f2xx_hal_nand.c
42-
device/stm32f2xx_hal_nor.c
43-
device/stm32f2xx_hal_pccard.c
44-
device/stm32f2xx_hal_pcd.c
45-
device/stm32f2xx_hal_pcd_ex.c
46-
device/stm32f2xx_hal_pwr.c
47-
device/stm32f2xx_hal_pwr_ex.c
48-
device/stm32f2xx_hal_rcc.c
49-
device/stm32f2xx_hal_rcc_ex.c
50-
device/stm32f2xx_hal_rng.c
51-
device/stm32f2xx_hal_rtc.c
52-
device/stm32f2xx_hal_rtc_ex.c
53-
device/stm32f2xx_hal_sd.c
54-
device/stm32f2xx_hal_smartcard.c
55-
device/stm32f2xx_hal_spi.c
56-
device/stm32f2xx_hal_sram.c
57-
device/stm32f2xx_hal_tim.c
58-
device/stm32f2xx_hal_tim_ex.c
59-
device/stm32f2xx_hal_uart.c
60-
device/stm32f2xx_hal_usart.c
61-
device/stm32f2xx_hal_wwdg.c
62-
device/stm32f2xx_ll_adc.c
63-
device/stm32f2xx_ll_crc.c
64-
device/stm32f2xx_ll_dac.c
65-
device/stm32f2xx_ll_dma.c
66-
device/stm32f2xx_ll_exti.c
67-
device/stm32f2xx_ll_fsmc.c
68-
device/stm32f2xx_ll_gpio.c
69-
device/stm32f2xx_ll_i2c.c
70-
device/stm32f2xx_ll_pwr.c
71-
device/stm32f2xx_ll_rcc.c
72-
device/stm32f2xx_ll_rng.c
73-
device/stm32f2xx_ll_rtc.c
74-
device/stm32f2xx_ll_sdmmc.c
75-
device/stm32f2xx_ll_spi.c
76-
device/stm32f2xx_ll_tim.c
77-
device/stm32f2xx_ll_usart.c
78-
device/stm32f2xx_ll_usb.c
79-
device/stm32f2xx_ll_utils.c
80-
device/system_stm32f2xx.c
8118
)
8219

20+
add_subdirectory(STM32Cube_FW)
21+
8322
target_include_directories(mbed-core
8423
INTERFACE
8524
.
86-
device
25+
./STM32Cube_FW
26+
./STM32Cube_FW/CMSIS
27+
./STM32Cube_FW/STM32F2xx_HAL_Driver
28+
./STM32Cube_FW/STM32F2xx_HAL_Driver/Legacy
8729
)

targets/TARGET_STM/TARGET_STM32F2/STM32Cube_FW/CMSIS/stm32f2xx.h

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
* @author MCD Application Team
55
* @version V2.2.0
66
* @date 17-March-2017
7-
* @brief CMSIS STM32F2xx Device Peripheral Access Layer Header File.
7+
* @brief CMSIS STM32F2xx Device Peripheral Access Layer Header File.
88
*
99
* The file is the unique include file that the application programmer
1010
* is using in the C source code, usually in main.c. This file contains:
1111
* - Configuration section that allows to select:
1212
* - The STM32F2xx device used in the target application
13-
* - To use or not the peripheral’s drivers in application code(i.e.
14-
* code will be based on direct access to peripheral’s registers
15-
* rather than drivers API), this option is controlled by
13+
* - To use or not the peripheral’s drivers in application code(i.e.
14+
* code will be based on direct access to peripheral’s registers
15+
* rather than drivers API), this option is controlled by
1616
* "#define USE_HAL_DRIVER"
17-
*
17+
*
1818
******************************************************************************
1919
* @attention
2020
*
@@ -52,14 +52,14 @@
5252
/** @addtogroup stm32f2xx
5353
* @{
5454
*/
55-
55+
5656
#ifndef __STM32F2xx_H
5757
#define __STM32F2xx_H
5858

5959
#ifdef __cplusplus
60-
extern "C" {
60+
extern "C" {
6161
#endif /* __cplusplus */
62-
62+
6363
/** @addtogroup Library_configuration_section
6464
* @{
6565
*/
@@ -70,32 +70,32 @@ extern "C" {
7070
#if !defined (STM32F2)
7171
#define STM32F2
7272
#endif /* STM32F2 */
73-
73+
7474
/* Uncomment the line below according to the target STM32 device used in your
75-
application
75+
application
7676
*/
7777
#if !defined (STM32F205xx) && !defined (STM32F215xx) && !defined (STM32F207xx) && !defined (STM32F217xx)
7878

79-
/* #define STM32F205xx */ /*!< STM32F205RG, STM32F205VG, STM32F205ZG, STM32F205RF, STM32F205VF, STM32F205ZF,
80-
STM32F205RE, STM32F205VE, STM32F205ZE, STM32F205RC, STM32F205VC, STM32F205ZC,
81-
STM32F205RB and STM32F205VB Devices */
82-
/* #define STM32F215xx */ /*!< STM32F215RG, STM32F215VG, STM32F215ZG, STM32F215RE, STM32F215VE and STM32F215ZE Devices */
83-
#define STM32F207xx /*!< STM32F207VG, STM32F207ZG, STM32F207IG, STM32F207VF, STM32F207ZF, STM32F207IF,
79+
/* #define STM32F205xx */ /*!< STM32F205RG, STM32F205VG, STM32F205ZG, STM32F205RF, STM32F205VF, STM32F205ZF,
80+
STM32F205RE, STM32F205VE, STM32F205ZE, STM32F205RC, STM32F205VC, STM32F205ZC,
81+
STM32F205RB and STM32F205VB Devices */
82+
/* #define STM32F215xx */ /*!< STM32F215RG, STM32F215VG, STM32F215ZG, STM32F215RE, STM32F215VE and STM32F215ZE Devices */
83+
/* #define STM32F207xx */ /*!< STM32F207VG, STM32F207ZG, STM32F207IG, STM32F207VF, STM32F207ZF, STM32F207IF,
8484
STM32F207VE, STM32F207ZE, STM32F207IE, STM32F207VC, STM32F207ZC and STM32F207IC Devices */
85-
/* #define STM32F217xx */ /*!< STM32F217VG, STM32F217ZG, STM32F217IG, STM32F217VE, STM32F217ZE and STM32F217IE Devices */
86-
85+
/* #define STM32F217xx */ /*!< STM32F217VG, STM32F217ZG, STM32F217IG, STM32F217VE, STM32F217ZE and STM32F217IE Devices */
86+
8787
#endif
88-
88+
8989
/* Tip: To avoid modifying this file each time you need to switch between these
9090
devices, you can define the device in your toolchain compiler preprocessor.
9191
*/
9292
#if !defined (USE_HAL_DRIVER)
9393
/**
9494
* @brief Comment the line below if you will not use the peripherals drivers.
95-
In this case, these drivers will not be included and the application code will
96-
be based on direct access to peripherals registers
95+
In this case, these drivers will not be included and the application code will
96+
be based on direct access to peripherals registers
9797
*/
98-
#define USE_HAL_DRIVER
98+
/*#define USE_HAL_DRIVER */
9999
#endif /* USE_HAL_DRIVER */
100100

101101
/**
@@ -119,15 +119,15 @@ extern "C" {
119119
*/
120120

121121
#if defined(STM32F205xx)
122-
#include "stm32f205xx.h"
122+
#include "stm32f205xx.h"
123123
#elif defined(STM32F215xx)
124-
#include "stm32f215xx.h"
124+
#include "stm32f215xx.h"
125125
#elif defined(STM32F207xx)
126-
#include "stm32f207xx.h"
126+
#include "stm32f207xx.h"
127127
#elif defined(STM32F217xx)
128-
#include "stm32f217xx.h"
128+
#include "stm32f217xx.h"
129129
#else
130-
#error "Please select first the target STM32F2xx device used in your application (in stm32f2xx.h file)"
130+
#error "Please select first the target STM32F2xx device used in your application (in stm32f2xx.h file)"
131131
#endif
132132

133133
/**
@@ -136,21 +136,24 @@ extern "C" {
136136

137137
/** @addtogroup Exported_types
138138
* @{
139-
*/
140-
typedef enum {
141-
RESET = 0,
142-
SET = !RESET
139+
*/
140+
typedef enum
141+
{
142+
RESET = 0,
143+
SET = !RESET
143144
} FlagStatus, ITStatus;
144145

145-
typedef enum {
146-
DISABLE = 0,
147-
ENABLE = !DISABLE
146+
typedef enum
147+
{
148+
DISABLE = 0,
149+
ENABLE = !DISABLE
148150
} FunctionalState;
149151
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
150152

151-
typedef enum {
152-
ERROR = 0,
153-
SUCCESS = !ERROR
153+
typedef enum
154+
{
155+
ERROR = 0,
156+
SUCCESS = !ERROR
154157
} ErrorStatus;
155158

156159
/**
@@ -175,15 +178,15 @@ typedef enum {
175178

176179
#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
177180

178-
#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
181+
#define POSITION_VAL(VAL) (__CLZ(__RBIT(VAL)))
179182

180183

181184
/**
182185
* @}
183186
*/
184-
187+
185188
#if defined (USE_HAL_DRIVER)
186-
#include "stm32f2xx_hal.h"
189+
#include "stm32f2xx_hal.h"
187190
#endif /* USE_HAL_DRIVER */
188191

189192
#ifdef __cplusplus
@@ -199,7 +202,7 @@ typedef enum {
199202
/**
200203
* @}
201204
*/
202-
205+
203206

204207

205208

targets/TARGET_STM/TARGET_STM32F2/TARGET_STM32F207xG/system_stm32f2xx.h renamed to targets/TARGET_STM/TARGET_STM32F2/STM32Cube_FW/CMSIS/system_stm32f2xx.h

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* @author MCD Application Team
55
* @version V2.2.0
66
* @date 17-March-2017
7-
* @brief CMSIS Cortex-M3 Device System Source File for STM32F2xx devices.
7+
* @brief CMSIS Cortex-M3 Device System Source File for STM32F2xx devices.
88
******************************************************************************
99
* @attention
1010
*
@@ -32,26 +32,26 @@
3232
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
3333
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3434
*
35-
******************************************************************************
36-
*/
35+
******************************************************************************
36+
*/
3737

3838
/** @addtogroup CMSIS
3939
* @{
4040
*/
4141

4242
/** @addtogroup stm32f2xx_system
4343
* @{
44-
*/
45-
44+
*/
45+
4646
/**
4747
* @brief Define to prevent recursive inclusion
4848
*/
4949
#ifndef __SYSTEM_STM32F2XX_H
5050
#define __SYSTEM_STM32F2XX_H
5151

5252
#ifdef __cplusplus
53-
extern "C" {
54-
#endif
53+
extern "C" {
54+
#endif
5555

5656
/** @addtogroup STM32F2xx_System_Includes
5757
* @{
@@ -65,14 +65,14 @@ extern "C" {
6565
/** @addtogroup STM32F2xx_System_Exported_types
6666
* @{
6767
*/
68-
/* This variable is updated in three ways:
69-
1) by calling CMSIS function SystemCoreClockUpdate()
70-
2) by calling HAL API function HAL_RCC_GetSysClockFreq()
71-
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
72-
Note: If you use this function to configure the system clock; then there
73-
is no need to call the 2 first functions listed above, since SystemCoreClock
74-
variable is updated automatically.
75-
*/
68+
/* This variable is updated in three ways:
69+
1) by calling CMSIS function SystemCoreClockUpdate()
70+
2) by calling HAL API function HAL_RCC_GetSysClockFreq()
71+
3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
72+
Note: If you use this function to configure the system clock; then there
73+
is no need to call the 2 first functions listed above, since SystemCoreClock
74+
variable is updated automatically.
75+
*/
7676
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
7777

7878
extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */
@@ -101,10 +101,9 @@ extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */
101101
/** @addtogroup STM32F2xx_System_Exported_Functions
102102
* @{
103103
*/
104-
104+
105105
extern void SystemInit(void);
106106
extern void SystemCoreClockUpdate(void);
107-
extern void SetSysClock(void);
108107
/**
109108
* @}
110109
*/
@@ -118,8 +117,8 @@ extern void SetSysClock(void);
118117
/**
119118
* @}
120119
*/
121-
120+
122121
/**
123122
* @}
124-
*/
123+
*/
125124
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)