76#if !defined (HSE_VALUE)
77 #define HSE_VALUE 8000000U
81#if !defined (HSI_VALUE)
82 #define HSI_VALUE 8000000U
87#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
98#if defined(USER_VECT_TAB_ADDRESS)
102#if defined(VECT_TAB_SRAM)
103#define VECT_TAB_BASE_ADDRESS SRAM_BASE
105#define VECT_TAB_OFFSET 0x00000000U
108#define VECT_TAB_BASE_ADDRESS FLASH_BASE
110#define VECT_TAB_OFFSET 0x00000000U
142const uint8_t
AHBPrescTable[16U] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
153#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
154#ifdef DATA_IN_ExtSRAM
155 static void SystemInit_ExtMemCtl(
void);
177#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
178 #ifdef DATA_IN_ExtSRAM
179 SystemInit_ExtMemCtl();
184#if defined(USER_VECT_TAB_ADDRESS)
185 SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET;
226 uint32_t tmp = 0U, pllmull = 0U, pllsource = 0U;
228#if defined(STM32F105xC) || defined(STM32F107xC)
229 uint32_t prediv1source = 0U, prediv1factor = 0U, prediv2factor = 0U, pll2mull = 0U;
232#if defined(STM32F100xB) || defined(STM32F100xE)
233 uint32_t prediv1factor = 0U;
237 tmp = RCC->CFGR & RCC_CFGR_SWS;
250 pllmull = RCC->CFGR & RCC_CFGR_PLLMULL;
251 pllsource = RCC->CFGR & RCC_CFGR_PLLSRC;
253#if !defined(STM32F105xC) && !defined(STM32F107xC)
254 pllmull = ( pllmull >> 18U) + 2U;
256 if (pllsource == 0x00U)
263 #if defined(STM32F100xB) || defined(STM32F100xE)
264 prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1U;
269 if ((RCC->CFGR & RCC_CFGR_PLLXTPRE) != (uint32_t)RESET)
280 pllmull = pllmull >> 18U;
282 if (pllmull != 0x0DU)
291 if (pllsource == 0x00U)
300 prediv1source = RCC->CFGR2 & RCC_CFGR2_PREDIV1SRC;
301 prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1U;
303 if (prediv1source == 0U)
312 prediv2factor = ((RCC->CFGR2 & RCC_CFGR2_PREDIV2) >> 4U) + 1U;
313 pll2mull = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> 8U) + 2U;
332#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
339#ifdef DATA_IN_ExtSRAM
349void SystemInit_ExtMemCtl(
void)
351 __IO uint32_t tmpreg;
356 RCC->AHBENR = 0x00000114U;
359 tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_FSMCEN);
362 RCC->APB2ENR = 0x000001E0U;
365 tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPDEN);
375 GPIOD->CRL = 0x44BB44BBU;
376 GPIOD->CRH = 0xBBBBBBBBU;
378 GPIOE->CRL = 0xB44444BBU;
379 GPIOE->CRH = 0xBBBBBBBBU;
381 GPIOF->CRL = 0x44BBBBBBU;
382 GPIOF->CRH = 0xBBBB4444U;
384 GPIOG->CRL = 0x44BBBBBBU;
385 GPIOG->CRH = 0x444B4B44U;
390 FSMC_Bank1->BTCR[4U] = 0x00001091U;
391 FSMC_Bank1->BTCR[5U] = 0x00110212U;
void SystemInit(void)
Setup the microcontroller system Initialize the Embedded Flash Interface, the PLL and update the Syst...
void SystemCoreClockUpdate(void)
Update SystemCoreClock variable according to Clock Register Values. The SystemCoreClock variable cont...
const uint8_t AHBPrescTable[16U]
const uint8_t APBPrescTable[8U]