Skip to content

Commit fa8529d

Browse files
committed
STM32F4 : refactor stm32f4xx_hal_conf.h and map ST HAL assert into MBED assert
1 parent 2257d4b commit fa8529d

File tree

17 files changed

+36
-7223
lines changed

17 files changed

+36
-7223
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_B96B_F446VE/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F401VC/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F429ZI/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_DISCO_F469NI/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_ELMO_F411RE/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_F429_F439/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_DRAGONFLY_F411RE/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F405RG/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_MTS_MDOT_F411RE/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F401RE/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F446RE/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F446ZE/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407VG/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.

targets/TARGET_STM/TARGET_STM32F4/TARGET_UBLOX_EVK_ODIN_W2/device/stm32f4xx_hal_conf.h

Lines changed: 0 additions & 449 deletions
This file was deleted.
Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
******************************************************************************
33
* @file stm32f4xx_hal_conf.h
44
* @author MCD Application Team
5-
* @version V1.4.4
6-
* @date 22-January-2016
7-
* @brief HAL configuration template file.
8-
* This file should be copied to the application folder and renamed
9-
* to stm32f4xx_hal_conf.h.
5+
* @version V1.5.0
6+
* @date 06-May-2016
7+
* @brief HAL configuration file.
108
******************************************************************************
119
* @attention
1210
*
@@ -35,7 +33,7 @@
3533
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3634
*
3735
******************************************************************************
38-
*/
36+
*/
3937

4038
/* Define to prevent recursive inclusion -------------------------------------*/
4139
#ifndef __STM32F4xx_HAL_CONF_H
@@ -50,9 +48,9 @@
5048

5149
/* ########################## Module Selection ############################## */
5250
/**
53-
* @brief This is the list of modules to be used in the HAL driver
51+
* @brief This is the list of modules to be used in the HAL driver
5452
*/
55-
#define HAL_MODULE_ENABLED
53+
#define HAL_MODULE_ENABLED
5654
#define HAL_ADC_MODULE_ENABLED
5755
#define HAL_CAN_MODULE_ENABLED
5856
#define HAL_CRC_MODULE_ENABLED
@@ -95,15 +93,16 @@
9593
#define HAL_HCD_MODULE_ENABLED
9694
#define HAL_FMPI2C_MODULE_ENABLED
9795
#define HAL_SPDIFRX_MODULE_ENABLED
96+
#define HAL_DFSDM_MODULE_ENABLED
9897
#define HAL_LPTIM_MODULE_ENABLED
9998

10099
/* ########################## HSE/HSI Values adaptation ##################### */
101100
/**
102101
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
103102
* This value is used by the RCC HAL module to compute the system frequency
104-
* (when HSE is used as system clock source, directly or through the PLL).
103+
* (when HSE is used as system clock source, directly or through the PLL).
105104
*/
106-
#if !defined (HSE_VALUE)
105+
#if !defined (HSE_VALUE)
107106
#define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */
108107
#endif /* HSE_VALUE */
109108

@@ -114,7 +113,7 @@
114113
/**
115114
* @brief Internal High Speed oscillator (HSI) value.
116115
* This value is used by the RCC HAL module to compute the system frequency
117-
* (when HSI is used as system clock source, directly or through the PLL).
116+
* (when HSI is used as system clock source, directly or through the PLL).
118117
*/
119118
#if !defined (HSI_VALUE)
120119
#define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/
@@ -123,7 +122,7 @@
123122
/**
124123
* @brief Internal Low Speed oscillator (LSI) value.
125124
*/
126-
#if !defined (LSI_VALUE)
125+
#if !defined (LSI_VALUE)
127126
#define LSI_VALUE ((uint32_t)32000U) /*!< LSI Typical Value in Hz*/
128127
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
129128
The real value may vary depending on the variations
@@ -141,8 +140,8 @@
141140

142141
/**
143142
* @brief External clock source for I2S peripheral
144-
* This value is used by the I2S HAL module to compute the I2S clock source
145-
* frequency, this source is inserted directly through I2S_CKIN pad.
143+
* This value is used by the I2S HAL module to compute the I2S clock source
144+
* frequency, this source is inserted directly through I2S_CKIN pad.
146145
*/
147146
#if !defined (EXTERNAL_CLOCK_VALUE)
148147
#define EXTERNAL_CLOCK_VALUE ((uint32_t)12288000U) /*!< Value of the Internal oscillator in Hz*/
@@ -154,7 +153,7 @@
154153
/* ########################### System Configuration ######################### */
155154
/**
156155
* @brief This is the HAL system configuration section
157-
*/
156+
*/
158157
#define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */
159158
#define TICK_INT_PRIORITY ((uint32_t)0x0FU) /*!< tick interrupt priority */
160159
#define USE_RTOS 0U
@@ -164,7 +163,7 @@
164163

165164
/* ########################## Assert Selection ############################## */
166165
/**
167-
* @brief Uncomment the line below to expanse the "assert_param" macro in the
166+
* @brief Uncomment the line below to expanse the "assert_param" macro in the
168167
* HAL drivers code
169168
*/
170169
/* #define USE_FULL_ASSERT 1U */
@@ -181,17 +180,17 @@
181180
#define MAC_ADDR4 0U
182181
#define MAC_ADDR5 0U
183182

184-
/* Definition of the Ethernet driver buffers size and count */
183+
/* Definition of the Ethernet driver buffers size and count */
185184
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
186185
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
187186
#define ETH_RXBUFNB ((uint32_t)4U) /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
188187
#define ETH_TXBUFNB ((uint32_t)4U) /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
189188

190189
/* Section 2: PHY configuration section */
191190

192-
/* DP83848 PHY Address*/
191+
/* DP83848 PHY Address*/
193192
#define DP83848_PHY_ADDRESS 0x01U
194-
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
193+
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
195194
#define PHY_RESET_DELAY ((uint32_t)0x000000FFU)
196195
/* PHY Configuration delay */
197196
#define PHY_CONFIG_DELAY ((uint32_t)0x00000FFFU)
@@ -203,7 +202,7 @@
203202

204203
#define PHY_BCR ((uint16_t)0x0000U) /*!< Transceiver Basic Control Register */
205204
#define PHY_BSR ((uint16_t)0x0001U) /*!< Transceiver Basic Status Register */
206-
205+
207206
#define PHY_RESET ((uint16_t)0x8000U) /*!< PHY Reset */
208207
#define PHY_LOOPBACK ((uint16_t)0x4000U) /*!< Select loop-back mode */
209208
#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100U) /*!< Set the full-duplex mode at 100 Mb/s */
@@ -218,13 +217,13 @@
218217
#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020U) /*!< Auto-Negotiation process completed */
219218
#define PHY_LINKED_STATUS ((uint16_t)0x0004U) /*!< Valid link established */
220219
#define PHY_JABBER_DETECTION ((uint16_t)0x0002U) /*!< Jabber condition detected */
221-
220+
222221
/* Section 4: Extended PHY Registers */
223222

224223
#define PHY_SR ((uint16_t)0x0010U) /*!< PHY status register Offset */
225224
#define PHY_MICR ((uint16_t)0x0011U) /*!< MII Interrupt Control Register */
226225
#define PHY_MISR ((uint16_t)0x0012U) /*!< MII Interrupt Status and Misc. Control Register */
227-
226+
228227
#define PHY_LINK_STATUS ((uint16_t)0x0001U) /*!< PHY Link mask */
229228
#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */
230229
#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */
@@ -246,7 +245,7 @@
246245

247246
/* Includes ------------------------------------------------------------------*/
248247
/**
249-
* @brief Include module's header file
248+
* @brief Include module's header file
250249
*/
251250

252251
#ifdef HAL_RCC_MODULE_ENABLED
@@ -260,7 +259,7 @@
260259
#ifdef HAL_DMA_MODULE_ENABLED
261260
#include "stm32f4xx_hal_dma.h"
262261
#endif /* HAL_DMA_MODULE_ENABLED */
263-
262+
264263
#ifdef HAL_CORTEX_MODULE_ENABLED
265264
#include "stm32f4xx_hal_cortex.h"
266265
#endif /* HAL_CORTEX_MODULE_ENABLED */
@@ -278,7 +277,7 @@
278277
#endif /* HAL_CRC_MODULE_ENABLED */
279278

280279
#ifdef HAL_CRYP_MODULE_ENABLED
281-
#include "stm32f4xx_hal_cryp.h"
280+
#include "stm32f4xx_hal_cryp.h"
282281
#endif /* HAL_CRYP_MODULE_ENABLED */
283282

284283
#ifdef HAL_DMA2D_MODULE_ENABLED
@@ -300,7 +299,7 @@
300299
#ifdef HAL_FLASH_MODULE_ENABLED
301300
#include "stm32f4xx_hal_flash.h"
302301
#endif /* HAL_FLASH_MODULE_ENABLED */
303-
302+
304303
#ifdef HAL_SRAM_MODULE_ENABLED
305304
#include "stm32f4xx_hal_sram.h"
306305
#endif /* HAL_SRAM_MODULE_ENABLED */
@@ -315,8 +314,8 @@
315314

316315
#ifdef HAL_PCCARD_MODULE_ENABLED
317316
#include "stm32f4xx_hal_pccard.h"
318-
#endif /* HAL_PCCARD_MODULE_ENABLED */
319-
317+
#endif /* HAL_PCCARD_MODULE_ENABLED */
318+
320319
#ifdef HAL_SDRAM_MODULE_ENABLED
321320
#include "stm32f4xx_hal_sdram.h"
322321
#endif /* HAL_SDRAM_MODULE_ENABLED */
@@ -396,7 +395,7 @@
396395
#ifdef HAL_HCD_MODULE_ENABLED
397396
#include "stm32f4xx_hal_hcd.h"
398397
#endif /* HAL_HCD_MODULE_ENABLED */
399-
398+
400399
#ifdef HAL_DSI_MODULE_ENABLED
401400
#include "stm32f4xx_hal_dsi.h"
402401
#endif /* HAL_DSI_MODULE_ENABLED */
@@ -417,6 +416,10 @@
417416
#include "stm32f4xx_hal_spdifrx.h"
418417
#endif /* HAL_SPDIFRX_MODULE_ENABLED */
419418

419+
#ifdef HAL_DFSDM_MODULE_ENABLED
420+
#include "stm32f4xx_hal_dfsdm.h"
421+
#endif /* HAL_DFSDM_MODULE_ENABLED */
422+
420423
#ifdef HAL_LPTIM_MODULE_ENABLED
421424
#include "stm32f4xx_hal_lptim.h"
422425
#endif /* HAL_LPTIM_MODULE_ENABLED */
@@ -427,13 +430,12 @@
427430
* @brief The assert_param macro is used for function's parameters check.
428431
* @param expr: If expr is false, it calls assert_failed function
429432
* which reports the name of the source file and the source
430-
* line number of the call that failed.
433+
* line number of the call that failed.
431434
* If expr is true, it returns no value.
432435
* @retval None
433436
*/
434-
#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__))
435-
/* Exported functions ------------------------------------------------------- */
436-
void assert_failed(uint8_t* file, uint32_t line);
437+
#include "mbed_assert.h"
438+
#define assert_param(expr) MBED_ASSERT(expr)
437439
#else
438440
#define assert_param(expr) ((void)0)
439441
#endif /* USE_FULL_ASSERT */
@@ -444,6 +446,6 @@
444446
#endif
445447

446448
#endif /* __STM32F4xx_HAL_CONF_H */
447-
449+
448450

449451
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

0 commit comments

Comments
 (0)