Skip to content

Commit d7a196e

Browse files
committed
Merge pull request #1826 from jeromecoutant/PR_UpdateF0_driver_v1_5_0
[STM32F0] update Cube driver to v1.5.0
2 parents 5c60eb6 + 7f88761 commit d7a196e

File tree

116 files changed

+25796
-22160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+25796
-22160
lines changed

hal/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/stm32f051x8.h

Lines changed: 2587 additions & 2267 deletions
Large diffs are not rendered by default.

hal/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/stm32f0xx.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
******************************************************************************
33
* @file stm32f0xx.h
44
* @author MCD Application Team
5-
* @version V2.2.2
6-
* @date 26-June-2015
5+
* @version V2.2.3
6+
* @date 29-January-2016
77
* @brief CMSIS STM32F0xx Device Peripheral Access Layer Header File.
88
*
99
* The file is the unique include file that the application programmer
@@ -18,7 +18,7 @@
1818
******************************************************************************
1919
* @attention
2020
*
21-
* <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
21+
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
2222
*
2323
* Redistribution and use in source and binary forms, with or without modification,
2424
* are permitted provided that the following conditions are met:
@@ -95,7 +95,7 @@
9595
/* #define STM32F072xB */ /*!< STM32F072x8, STM32F072xB Devices (STM32F072xx microcontrollers where the Flash memory ranges between 64 and 128 Kbytes) */
9696
/* #define STM32F078xx */ /*!< STM32F078xx Devices (STM32F078xx microcontrollers where the Flash memory is 128 Kbytes) */
9797
/* #define STM32F030xC */ /*!< STM32F030xC Devices (STM32F030xC microcontrollers where the Flash memory is 256 Kbytes) */
98-
/* #define STM32F091xC */ /*!< STM32F091xC Devices (STM32F091xx microcontrollers where the Flash memory is 256 Kbytes) */
98+
/* #define STM32F091xC */ /*!< STM32F091xB, STM32F091xC Devices (STM32F091xx microcontrollers where the Flash memory ranges between 128 and 256 Kbytes) */
9999
/* #define STM32F098xx */ /*!< STM32F098xx Devices (STM32F098xx microcontrollers where the Flash memory is 256 Kbytes) */
100100
#endif
101101

@@ -112,17 +112,17 @@
112112
#endif /* USE_HAL_DRIVER */
113113

114114
/**
115-
* @brief CMSIS Device version number V2.2.2
116-
*/
117-
#define __STM32F0xx_CMSIS_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */
118-
#define __STM32F0xx_CMSIS_DEVICE_VERSION_SUB1 (0x02) /*!< [23:16] sub1 version */
119-
#define __STM32F0xx_CMSIS_DEVICE_VERSION_SUB2 (0x02) /*!< [15:8] sub2 version */
120-
#define __STM32F0xx_CMSIS_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */
121-
#define __STM32F0xx_CMSIS_DEVICE_VERSION ((__CMSIS_DEVICE_VERSION_MAIN << 24)\
122-
|(__CMSIS_DEVICE_HAL_VERSION_SUB1 << 16)\
123-
|(__CMSIS_DEVICE_HAL_VERSION_SUB2 << 8 )\
124-
|(__CMSIS_DEVICE_HAL_VERSION_RC))
125-
115+
* @brief CMSIS Device version number V2.2.3
116+
*/
117+
#define __STM32F0_DEVICE_VERSION_MAIN (0x02) /*!< [31:24] main version */
118+
#define __STM32F0_DEVICE_VERSION_SUB1 (0x02) /*!< [23:16] sub1 version */
119+
#define __STM32F0_DEVICE_VERSION_SUB2 (0x03) /*!< [15:8] sub2 version */
120+
#define __STM32F0_DEVICE_VERSION_RC (0x00) /*!< [7:0] release candidate */
121+
#define __STM32F0_DEVICE_VERSION ((__STM32F0_DEVICE_VERSION_MAIN << 24)\
122+
|(__STM32F0_DEVICE_VERSION_SUB1 << 16)\
123+
|(__STM32F0_DEVICE_VERSION_SUB2 << 8 )\
124+
|(__STM32F0_DEVICE_VERSION_RC))
125+
126126
/**
127127
* @}
128128
*/

hal/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/system_stm32f0xx.c

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
******************************************************************************
33
* @file system_stm32f0xx.c
44
* @author MCD Application Team
5-
* @version V2.2.2
6-
* @date 26-June-2015
5+
* @version V2.2.3
6+
* @date 29-January-2016
77
* @brief CMSIS Cortex-M0 Device Peripheral Access Layer System Source File.
88
*
99
* 1. This file provides two functions and one global variable to be called from
@@ -42,7 +42,7 @@
4242
******************************************************************************
4343
* @attention
4444
*
45-
* <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
45+
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
4646
*
4747
* Redistribution and use in source and binary forms, with or without modification,
4848
* are permitted provided that the following conditions are met:
@@ -82,6 +82,7 @@
8282
*/
8383

8484
#include "stm32f0xx.h"
85+
8586
/**
8687
* @}
8788
*/
@@ -107,6 +108,10 @@
107108
This value can be provided and adapted by the user application. */
108109
#endif /* HSI_VALUE */
109110

111+
#if !defined (HSI48_VALUE)
112+
#define HSI48_VALUE ((uint32_t)48000000) /*!< Default value of the HSI48 Internal oscillator in Hz.
113+
This value can be provided and adapted by the user application. */
114+
#endif /* HSI48_VALUE */
110115
/**
111116
* @}
112117
*/
@@ -171,60 +176,60 @@ void SystemInit(void)
171176
{
172177
/* Reset the RCC clock configuration to the default reset state ------------*/
173178
/* Set HSION bit */
174-
RCC->CR |= (uint32_t)0x00000001;
179+
RCC->CR |= (uint32_t)0x00000001U;
175180

176181
#if defined (STM32F051x8) || defined (STM32F058x8)
177182
/* Reset SW[1:0], HPRE[3:0], PPRE[2:0], ADCPRE and MCOSEL[2:0] bits */
178-
RCC->CFGR &= (uint32_t)0xF8FFB80C;
183+
RCC->CFGR &= (uint32_t)0xF8FFB80CU;
179184
#else
180185
/* Reset SW[1:0], HPRE[3:0], PPRE[2:0], ADCPRE, MCOSEL[2:0], MCOPRE[2:0] and PLLNODIV bits */
181-
RCC->CFGR &= (uint32_t)0x08FFB80C;
186+
RCC->CFGR &= (uint32_t)0x08FFB80CU;
182187
#endif /* STM32F051x8 or STM32F058x8 */
183188

184189
/* Reset HSEON, CSSON and PLLON bits */
185-
RCC->CR &= (uint32_t)0xFEF6FFFF;
190+
RCC->CR &= (uint32_t)0xFEF6FFFFU;
186191

187192
/* Reset HSEBYP bit */
188-
RCC->CR &= (uint32_t)0xFFFBFFFF;
193+
RCC->CR &= (uint32_t)0xFFFBFFFFU;
189194

190195
/* Reset PLLSRC, PLLXTPRE and PLLMUL[3:0] bits */
191-
RCC->CFGR &= (uint32_t)0xFFC0FFFF;
196+
RCC->CFGR &= (uint32_t)0xFFC0FFFFU;
192197

193198
/* Reset PREDIV[3:0] bits */
194-
RCC->CFGR2 &= (uint32_t)0xFFFFFFF0;
199+
RCC->CFGR2 &= (uint32_t)0xFFFFFFF0U;
195200

196201
#if defined (STM32F072xB) || defined (STM32F078xx)
197202
/* Reset USART2SW[1:0], USART1SW[1:0], I2C1SW, CECSW, USBSW and ADCSW bits */
198-
RCC->CFGR3 &= (uint32_t)0xFFFCFE2C;
203+
RCC->CFGR3 &= (uint32_t)0xFFFCFE2CU;
199204
#elif defined (STM32F071xB)
200205
/* Reset USART2SW[1:0], USART1SW[1:0], I2C1SW, CECSW and ADCSW bits */
201-
RCC->CFGR3 &= (uint32_t)0xFFFFCEAC;
206+
RCC->CFGR3 &= (uint32_t)0xFFFFCEACU;
202207
#elif defined (STM32F091xC) || defined (STM32F098xx)
203208
/* Reset USART3SW[1:0], USART2SW[1:0], USART1SW[1:0], I2C1SW, CECSW and ADCSW bits */
204-
RCC->CFGR3 &= (uint32_t)0xFFF0FEAC;
209+
RCC->CFGR3 &= (uint32_t)0xFFF0FEACU;
205210
#elif defined (STM32F030x6) || defined (STM32F030x8) || defined (STM32F031x6) || defined (STM32F038xx) || defined (STM32F030xC)
206211
/* Reset USART1SW[1:0], I2C1SW and ADCSW bits */
207-
RCC->CFGR3 &= (uint32_t)0xFFFFFEEC;
212+
RCC->CFGR3 &= (uint32_t)0xFFFFFEECU;
208213
#elif defined (STM32F051x8) || defined (STM32F058xx)
209214
/* Reset USART1SW[1:0], I2C1SW, CECSW and ADCSW bits */
210-
RCC->CFGR3 &= (uint32_t)0xFFFFFEAC;
215+
RCC->CFGR3 &= (uint32_t)0xFFFFFEACU;
211216
#elif defined (STM32F042x6) || defined (STM32F048xx)
212217
/* Reset USART1SW[1:0], I2C1SW, CECSW, USBSW and ADCSW bits */
213-
RCC->CFGR3 &= (uint32_t)0xFFFFFE2C;
218+
RCC->CFGR3 &= (uint32_t)0xFFFFFE2CU;
214219
#elif defined (STM32F070x6) || defined (STM32F070xB)
215220
/* Reset USART1SW[1:0], I2C1SW, USBSW and ADCSW bits */
216-
RCC->CFGR3 &= (uint32_t)0xFFFFFE6C;
221+
RCC->CFGR3 &= (uint32_t)0xFFFFFE6CU;
217222
/* Set default USB clock to PLLCLK, since there is no HSI48 */
218-
RCC->CFGR3 |= (uint32_t)0x00000080;
223+
RCC->CFGR3 |= (uint32_t)0x00000080U;
219224
#else
220225
#warning "No target selected"
221226
#endif
222227

223228
/* Reset HSI14 bit */
224-
RCC->CR2 &= (uint32_t)0xFFFFFFFE;
229+
RCC->CR2 &= (uint32_t)0xFFFFFFFEU;
225230

226231
/* Disable all interrupts */
227-
RCC->CIR = 0x00000000;
232+
RCC->CIR = 0x00000000U;
228233

229234
/* Enable SYSCFGENR in APB2EN, needed for 1st call of NVIC_SetVector, to copy vectors from flash to ram */
230235
RCC->APB2ENR |= RCC_APB2ENR_SYSCFGEN;

hal/targets/cmsis/TARGET_STM/TARGET_STM32F0/TARGET_DISCO_F051R8/system_stm32f0xx.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
******************************************************************************
33
* @file system_stm32f0xx.h
44
* @author MCD Application Team
5-
* @version V2.2.2
6-
* @date 26-June-2015
5+
* @version V2.2.3
6+
* @date 29-January-2016
77
* @brief CMSIS Cortex-M0 Device System Source File for STM32F0xx devices.
88
******************************************************************************
99
* @attention
1010
*
11-
* <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
11+
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
1212
*
1313
* Redistribution and use in source and binary forms, with or without modification,
1414
* are permitted provided that the following conditions are met:
@@ -73,7 +73,8 @@
7373
is no need to call the 2 first functions listed above, since SystemCoreClock
7474
variable is updated automatically.
7575
*/
76-
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
76+
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
77+
extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */
7778

7879
/**
7980
* @}

0 commit comments

Comments
 (0)