Skip to content

Commit 46ac925

Browse files
LMESTMadbridge
authored andcommitted
F1 CUBE V1.5.0
HAL V1.1.0 LL V1.1.0 CMSIS V4.2.0
1 parent a3f20bb commit 46ac925

File tree

138 files changed

+48740
-18064
lines changed

Some content is hidden

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

138 files changed

+48740
-18064
lines changed

targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/stm32f103xb.h

Lines changed: 402 additions & 833 deletions
Large diffs are not rendered by default.

targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/stm32f1xx.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
******************************************************************************
33
* @file stm32f1xx.h
44
* @author MCD Application Team
5-
* @version V4.1.0
6-
* @date 29-April-2016
5+
* @version V4.2.0
6+
* @date 31-March-2017
77
* @brief CMSIS STM32F1xx 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) 2016 STMicroelectronics</center></h2>
21+
* <h2><center>&copy; COPYRIGHT(c) 2017 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:
@@ -108,10 +108,10 @@
108108
#endif /* USE_HAL_DRIVER */
109109

110110
/**
111-
* @brief CMSIS Device version number V4.0.0
111+
* @brief CMSIS Device version number V4.2.0
112112
*/
113-
#define __STM32F1_CMSIS_VERSION_MAIN (0x04) /*!< [31:24] main version */
114-
#define __STM32F1_CMSIS_VERSION_SUB1 (0x01) /*!< [23:16] sub1 version */
113+
#define __STM32F1_CMSIS_VERSION_MAIN (0x04) /*!< [31:24] main version */
114+
#define __STM32F1_CMSIS_VERSION_SUB1 (0x02) /*!< [23:16] sub1 version */
115115
#define __STM32F1_CMSIS_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
116116
#define __STM32F1_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */
117117
#define __STM32F1_CMSIS_VERSION ((__STM32F1_CMSIS_VERSION_MAIN << 24)\

targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/system_stm32f1xx.c

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
******************************************************************************
33
* @file system_stm32f1xx.c
44
* @author MCD Application Team
5-
* @version V4.1.0
6-
* @date 29-April-2016
5+
* @version V4.2.0
6+
* @date 31-March-2017
77
* @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.
88
*
99
* 1. This file provides two functions and one global variable to be called from
@@ -52,7 +52,7 @@
5252
******************************************************************************
5353
* @attention
5454
*
55-
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
55+
* <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
5656
*
5757
* Redistribution and use in source and binary forms, with or without modification,
5858
* are permitted provided that the following conditions are met:
@@ -111,12 +111,12 @@
111111
*/
112112

113113
#if !defined (HSE_VALUE)
114-
#define HSE_VALUE ((uint32_t)8000000) /*!< Default value of the External oscillator in Hz.
114+
#define HSE_VALUE 8000000U /*!< Default value of the External oscillator in Hz.
115115
This value can be provided and adapted by the user application. */
116116
#endif /* HSE_VALUE */
117117

118118
#if !defined (HSI_VALUE)
119-
#define HSI_VALUE ((uint32_t)8000000) /*!< Default value of the Internal oscillator in Hz.
119+
#define HSI_VALUE 8000000U /*!< Default value of the Internal oscillator in Hz.
120120
This value can be provided and adapted by the user application. */
121121
#endif /* HSI_VALUE */
122122

@@ -128,7 +128,7 @@
128128
/*!< Uncomment the following line if you need to relocate your vector Table in
129129
Internal SRAM. */
130130
/* #define VECT_TAB_SRAM */
131-
#define VECT_TAB_OFFSET 0x0 /*!< Vector Table base offset field.
131+
#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
132132
This value must be a multiple of 0x200. */
133133

134134

@@ -156,13 +156,13 @@
156156
* Clock Definitions
157157
*******************************************************************************/
158158
#if defined(STM32F100xB) ||defined(STM32F100xE)
159-
uint32_t SystemCoreClock = 24000000; /*!< System Clock Frequency (Core Clock) */
159+
uint32_t SystemCoreClock = 24000000U; /*!< System Clock Frequency (Core Clock) */
160160
#else /*!< HSI Selected as System Clock source */
161-
uint32_t SystemCoreClock = 72000000; /*!< System Clock Frequency (Core Clock) */
161+
uint32_t SystemCoreClock = 72000000U; /*!< System Clock Frequency (Core Clock) */
162162
#endif
163163

164-
const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
165-
const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};
164+
const uint8_t AHBPrescTable[16U] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
165+
const uint8_t APBPrescTable[8U] = {0, 0, 0, 0, 1, 2, 3, 4};
166166

167167
/**
168168
* @}
@@ -204,42 +204,42 @@ void SystemInit (void)
204204
{
205205
/* Reset the RCC clock configuration to the default reset state(for debug purpose) */
206206
/* Set HSION bit */
207-
RCC->CR |= (uint32_t)0x00000001;
207+
RCC->CR |= 0x00000001U;
208208

209209
/* Reset SW, HPRE, PPRE1, PPRE2, ADCPRE and MCO bits */
210210
#if !defined(STM32F105xC) && !defined(STM32F107xC)
211-
RCC->CFGR &= (uint32_t)0xF8FF0000;
211+
RCC->CFGR &= 0xF8FF0000U;
212212
#else
213-
RCC->CFGR &= (uint32_t)0xF0FF0000;
213+
RCC->CFGR &= 0xF0FF0000U;
214214
#endif /* STM32F105xC */
215215

216216
/* Reset HSEON, CSSON and PLLON bits */
217-
RCC->CR &= (uint32_t)0xFEF6FFFF;
217+
RCC->CR &= 0xFEF6FFFFU;
218218

219219
/* Reset HSEBYP bit */
220-
RCC->CR &= (uint32_t)0xFFFBFFFF;
220+
RCC->CR &= 0xFFFBFFFFU;
221221

222222
/* Reset PLLSRC, PLLXTPRE, PLLMUL and USBPRE/OTGFSPRE bits */
223-
RCC->CFGR &= (uint32_t)0xFF80FFFF;
223+
RCC->CFGR &= 0xFF80FFFFU;
224224

225225
#if defined(STM32F105xC) || defined(STM32F107xC)
226226
/* Reset PLL2ON and PLL3ON bits */
227-
RCC->CR &= (uint32_t)0xEBFFFFFF;
227+
RCC->CR &= 0xEBFFFFFFU;
228228

229229
/* Disable all interrupts and clear pending bits */
230-
RCC->CIR = 0x00FF0000;
230+
RCC->CIR = 0x00FF0000U;
231231

232232
/* Reset CFGR2 register */
233-
RCC->CFGR2 = 0x00000000;
233+
RCC->CFGR2 = 0x00000000U;
234234
#elif defined(STM32F100xB) || defined(STM32F100xE)
235235
/* Disable all interrupts and clear pending bits */
236-
RCC->CIR = 0x009F0000;
236+
RCC->CIR = 0x009F0000U;
237237

238238
/* Reset CFGR2 register */
239-
RCC->CFGR2 = 0x00000000;
239+
RCC->CFGR2 = 0x00000000U;
240240
#else
241241
/* Disable all interrupts and clear pending bits */
242-
RCC->CIR = 0x009F0000;
242+
RCC->CIR = 0x009F0000U;
243243
#endif /* STM32F105xC */
244244

245245
#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
@@ -304,52 +304,52 @@ void SystemInit (void)
304304
*/
305305
void SystemCoreClockUpdate (void)
306306
{
307-
uint32_t tmp = 0, pllmull = 0, pllsource = 0;
307+
uint32_t tmp = 0U, pllmull = 0U, pllsource = 0U;
308308

309309
#if defined(STM32F105xC) || defined(STM32F107xC)
310-
uint32_t prediv1source = 0, prediv1factor = 0, prediv2factor = 0, pll2mull = 0;
310+
uint32_t prediv1source = 0U, prediv1factor = 0U, prediv2factor = 0U, pll2mull = 0U;
311311
#endif /* STM32F105xC */
312312

313313
#if defined(STM32F100xB) || defined(STM32F100xE)
314-
uint32_t prediv1factor = 0;
314+
uint32_t prediv1factor = 0U;
315315
#endif /* STM32F100xB or STM32F100xE */
316316

317317
/* Get SYSCLK source -------------------------------------------------------*/
318318
tmp = RCC->CFGR & RCC_CFGR_SWS;
319319

320320
switch (tmp)
321321
{
322-
case 0x00: /* HSI used as system clock */
322+
case 0x00U: /* HSI used as system clock */
323323
SystemCoreClock = HSI_VALUE;
324324
break;
325-
case 0x04: /* HSE used as system clock */
325+
case 0x04U: /* HSE used as system clock */
326326
SystemCoreClock = HSE_VALUE;
327327
break;
328-
case 0x08: /* PLL used as system clock */
328+
case 0x08U: /* PLL used as system clock */
329329

330330
/* Get PLL clock source and multiplication factor ----------------------*/
331331
pllmull = RCC->CFGR & RCC_CFGR_PLLMULL;
332332
pllsource = RCC->CFGR & RCC_CFGR_PLLSRC;
333333

334334
#if !defined(STM32F105xC) && !defined(STM32F107xC)
335-
pllmull = ( pllmull >> 18) + 2;
335+
pllmull = ( pllmull >> 18U) + 2U;
336336

337-
if (pllsource == 0x00)
337+
if (pllsource == 0x00U)
338338
{
339339
/* HSI oscillator clock divided by 2 selected as PLL clock entry */
340-
SystemCoreClock = (HSI_VALUE >> 1) * pllmull;
340+
SystemCoreClock = (HSI_VALUE >> 1U) * pllmull;
341341
}
342342
else
343343
{
344344
#if defined(STM32F100xB) || defined(STM32F100xE)
345-
prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1;
345+
prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1U;
346346
/* HSE oscillator clock selected as PREDIV1 clock entry */
347347
SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull;
348348
#else
349349
/* HSE selected as PLL clock entry */
350350
if ((RCC->CFGR & RCC_CFGR_PLLXTPRE) != (uint32_t)RESET)
351351
{/* HSE oscillator clock divided by 2 */
352-
SystemCoreClock = (HSE_VALUE >> 1) * pllmull;
352+
SystemCoreClock = (HSE_VALUE >> 1U) * pllmull;
353353
}
354354
else
355355
{
@@ -358,30 +358,30 @@ void SystemCoreClockUpdate (void)
358358
#endif
359359
}
360360
#else
361-
pllmull = pllmull >> 18;
361+
pllmull = pllmull >> 18U;
362362

363-
if (pllmull != 0x0D)
363+
if (pllmull != 0x0DU)
364364
{
365-
pllmull += 2;
365+
pllmull += 2U;
366366
}
367367
else
368368
{ /* PLL multiplication factor = PLL input clock * 6.5 */
369-
pllmull = 13 / 2;
369+
pllmull = 13U / 2U;
370370
}
371371

372-
if (pllsource == 0x00)
372+
if (pllsource == 0x00U)
373373
{
374374
/* HSI oscillator clock divided by 2 selected as PLL clock entry */
375-
SystemCoreClock = (HSI_VALUE >> 1) * pllmull;
375+
SystemCoreClock = (HSI_VALUE >> 1U) * pllmull;
376376
}
377377
else
378378
{/* PREDIV1 selected as PLL clock entry */
379379

380380
/* Get PREDIV1 clock source and division factor */
381381
prediv1source = RCC->CFGR2 & RCC_CFGR2_PREDIV1SRC;
382-
prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1;
382+
prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1U;
383383

384-
if (prediv1source == 0)
384+
if (prediv1source == 0U)
385385
{
386386
/* HSE oscillator clock selected as PREDIV1 clock entry */
387387
SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull;
@@ -390,8 +390,8 @@ void SystemCoreClockUpdate (void)
390390
{/* PLL2 clock selected as PREDIV1 clock entry */
391391

392392
/* Get PREDIV2 division factor and PLL2 multiplication factor */
393-
prediv2factor = ((RCC->CFGR2 & RCC_CFGR2_PREDIV2) >> 4) + 1;
394-
pll2mull = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> 8 ) + 2;
393+
prediv2factor = ((RCC->CFGR2 & RCC_CFGR2_PREDIV2) >> 4U) + 1U;
394+
pll2mull = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> 8U) + 2U;
395395
SystemCoreClock = (((HSE_VALUE / prediv2factor) * pll2mull) / prediv1factor) * pllmull;
396396
}
397397
}
@@ -405,7 +405,7 @@ void SystemCoreClockUpdate (void)
405405

406406
/* Compute HCLK clock frequency ----------------*/
407407
/* Get HCLK prescaler */
408-
tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)];
408+
tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4U)];
409409
/* HCLK clock frequency */
410410
SystemCoreClock >>= tmp;
411411
}
@@ -434,13 +434,13 @@ void SystemInit_ExtMemCtl(void)
434434
required, then adjust the Register Addresses */
435435

436436
/* Enable FSMC clock */
437-
RCC->AHBENR = 0x00000114;
437+
RCC->AHBENR = 0x00000114U;
438438

439439
/* Delay after an RCC peripheral clock enabling */
440440
tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_FSMCEN);
441441

442442
/* Enable GPIOD, GPIOE, GPIOF and GPIOG clocks */
443-
RCC->APB2ENR = 0x000001E0;
443+
RCC->APB2ENR = 0x000001E0U;
444444

445445
/* Delay after an RCC peripheral clock enabling */
446446
tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPDEN);
@@ -453,23 +453,23 @@ void SystemInit_ExtMemCtl(void)
453453
/*---------------- NE3 configuration ----------------------------------------*/
454454
/*---------------- NBL0, NBL1 configuration ---------------------------------*/
455455

456-
GPIOD->CRL = 0x44BB44BB;
457-
GPIOD->CRH = 0xBBBBBBBB;
456+
GPIOD->CRL = 0x44BB44BBU;
457+
GPIOD->CRH = 0xBBBBBBBBU;
458458

459-
GPIOE->CRL = 0xB44444BB;
460-
GPIOE->CRH = 0xBBBBBBBB;
459+
GPIOE->CRL = 0xB44444BBU;
460+
GPIOE->CRH = 0xBBBBBBBBU;
461461

462-
GPIOF->CRL = 0x44BBBBBB;
463-
GPIOF->CRH = 0xBBBB4444;
462+
GPIOF->CRL = 0x44BBBBBBU;
463+
GPIOF->CRH = 0xBBBB4444U;
464464

465-
GPIOG->CRL = 0x44BBBBBB;
466-
GPIOG->CRH = 0x444B4B44;
465+
GPIOG->CRL = 0x44BBBBBBU;
466+
GPIOG->CRH = 0x444B4B44U;
467467

468468
/*---------------- FSMC Configuration ---------------------------------------*/
469469
/*---------------- Enable FSMC Bank1_SRAM Bank ------------------------------*/
470470

471-
FSMC_Bank1->BTCR[4] = 0x00001091;
472-
FSMC_Bank1->BTCR[5] = 0x00110212;
471+
FSMC_Bank1->BTCR[4U] = 0x00001091U;
472+
FSMC_Bank1->BTCR[5U] = 0x00110212U;
473473
}
474474
#endif /* DATA_IN_ExtSRAM */
475475
#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */

targets/TARGET_STM/TARGET_STM32F1/TARGET_BLUEPILL_F103C8/device/system_stm32f1xx.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
******************************************************************************
33
* @file system_stm32f10x.h
44
* @author MCD Application Team
5-
* @version V4.1.0
6-
* @date 29-April-2016
5+
* @version V4.2.0
6+
* @date 31-March-2017
77
* @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File.
88
******************************************************************************
99
* @attention
1010
*
11-
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
11+
* <h2><center>&copy; COPYRIGHT(c) 2017 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:
@@ -67,8 +67,8 @@
6767
*/
6868

6969
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
70-
extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */
71-
extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */
70+
extern const uint8_t AHBPrescTable[16U]; /*!< AHB prescalers table values */
71+
extern const uint8_t APBPrescTable[8U]; /*!< APB prescalers table values */
7272

7373
/**
7474
* @}

0 commit comments

Comments
 (0)