65 #include "stm32f4xx.h"
67 #if !defined (HSE_VALUE)
68 #if defined(USE_STM32469I_DISCO_REVA)
69 #define HSE_VALUE ((uint32_t)25000000)
71 #define HSE_VALUE ((uint32_t)8000000)
75 #if !defined (HSI_VALUE)
76 #define HSI_VALUE ((uint32_t)16000000)
103 #define VECT_TAB_OFFSET 0x00
131 const uint8_t
AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
141 #if defined (DATA_IN_ExtSDRAM)
142 static void SystemInit_ExtMemCtl(
void);
163 #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
164 SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2));
168 RCC->CR |= (uint32_t)0x00000001;
171 RCC->CFGR = 0x00000000;
174 RCC->CR &= (uint32_t)0xFEF6FFFF;
177 RCC->PLLCFGR = 0x24003010;
180 RCC->CR &= (uint32_t)0xFFFBFFFF;
183 RCC->CIR = 0x00000000;
185 #if defined (DATA_IN_ExtSDRAM)
186 SystemInit_ExtMemCtl();
235 uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2;
281 #if defined (DATA_IN_ExtSDRAM)
290 void SystemInit_ExtMemCtl(
void)
292 register uint32_t tmpreg = 0, timeout = 0xFFFF;
293 register __IO uint32_t index;
297 RCC->AHB1ENR |= 0x000001FC;
300 GPIOC->AFR[0] = 0x0000000C;
301 GPIOC->AFR[1] = 0x00000000;
303 GPIOC->MODER = 0x00000002;
305 GPIOC->OSPEEDR = 0x00000003;
307 GPIOC->OTYPER = 0x00000000;
309 GPIOC->PUPDR = 0x00000000;
312 GPIOD->AFR[0] = 0x000000CC;
313 GPIOD->AFR[1] = 0xCC000CCC;
315 GPIOD->MODER = 0xA02A000A;
317 GPIOD->OSPEEDR = 0xF03F000F;
319 GPIOD->OTYPER = 0x00000000;
321 GPIOD->PUPDR = 0x00000000;
324 GPIOE->AFR[0] = 0xC00000CC;
325 GPIOE->AFR[1] = 0xCCCCCCCC;
327 GPIOE->MODER = 0xAAAA800A;
329 GPIOE->OSPEEDR = 0xFFFFC00F;
331 GPIOE->OTYPER = 0x00000000;
333 GPIOE->PUPDR = 0x00000000;
336 GPIOF->AFR[0] = 0x00CCCCCC;
337 GPIOF->AFR[1] = 0xCCCCC000;
339 GPIOF->MODER = 0xAA800AAA;
341 GPIOF->OSPEEDR = 0xFFC00FFF;
343 GPIOF->OTYPER = 0x00000000;
345 GPIOF->PUPDR = 0x00000000;
348 GPIOG->AFR[0] = 0x00CC00CC;
349 GPIOG->AFR[1] = 0xC000000C;
351 GPIOG->MODER = 0x80020A0A;
353 GPIOG->OSPEEDR = 0xC0030F0F;
355 GPIOG->OTYPER = 0x00000000;
357 GPIOG->PUPDR = 0x00000000;
360 GPIOH->AFR[0] = 0x0000CC00;
361 GPIOH->AFR[1] = 0xCCCCCCCC;
363 GPIOH->MODER = 0xAAAA00A0;
365 GPIOH->OSPEEDR = 0xFFFF00F0;
367 GPIOH->OTYPER = 0x00000000;
369 GPIOH->PUPDR = 0x00000000;
372 GPIOI->AFR[0] = 0xCCCCCCCC;
373 GPIOI->AFR[1] = 0x00000CC0;
375 GPIOI->MODER = 0x0028AAAA;
377 GPIOI->OSPEEDR = 0x003CFFFF;
379 GPIOI->OTYPER = 0x00000000;
381 GPIOI->PUPDR = 0x00000000;
385 RCC->AHB3ENR |= 0x00000001;
395 while((tmpreg != 0) && (timeout-- > 0))
401 for (index = 0; index<1000; index++);
406 while((tmpreg != 0) && (timeout-- > 0))
414 while((tmpreg != 0) && (timeout-- > 0))
422 while((tmpreg != 0) && (timeout-- > 0))