50 #if !defined (HSE_VALUE)
51 #define HSE_VALUE ((uint32_t)25000000)
54 #if !defined (HSI_VALUE)
55 #define HSI_VALUE ((uint32_t)16000000)
82 #define VECT_TAB_OFFSET 0x00
111 const uint8_t
AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
121 #if defined (DATA_IN_ExtSDRAM)
122 static void SystemInit_ExtMemCtl(
void);
143 #if (__FPU_PRESENT == 1) && (__FPU_USED == 1)
144 SCB->CPACR |= ((3UL << 10*2)|(3UL << 11*2));
148 RCC->CR |= (uint32_t)0x00000001;
151 RCC->CFGR = 0x00000000;
154 RCC->CR &= (uint32_t)0xFEF6FFFF;
157 RCC->PLLCFGR = 0x24003010;
160 RCC->CR &= (uint32_t)0xFFFBFFFF;
163 RCC->CIR = 0x00000000;
165 #if defined (DATA_IN_ExtSDRAM)
166 SystemInit_ExtMemCtl();
215 uint32_t tmp = 0, pllvco = 0, pllp = 2, pllsource = 0, pllm = 2;
261 #if defined (DATA_IN_ExtSDRAM)
270 void SystemInit_ExtMemCtl(
void)
272 register uint32_t tmpreg = 0, timeout = 0xFFFF;
273 register __IO uint32_t index;
277 RCC->AHB1ENR |= 0x000001F8;
280 GPIOD->AFR[0] = 0x000000CC;
281 GPIOD->AFR[1] = 0xCC000CCC;
283 GPIOD->MODER = 0xA02A000A;
285 GPIOD->OSPEEDR = 0xF03F000F;
287 GPIOD->OTYPER = 0x00000000;
289 GPIOD->PUPDR = 0x50150005;
292 GPIOE->AFR[0] = 0xC00000CC;
293 GPIOE->AFR[1] = 0xCCCCCCCC;
295 GPIOE->MODER = 0xAAAA800A;
297 GPIOE->OSPEEDR = 0xFFFFC00F;
299 GPIOE->OTYPER = 0x00000000;
301 GPIOE->PUPDR = 0x55554005;
304 GPIOF->AFR[0] = 0x00CCCCCC;
305 GPIOF->AFR[1] = 0xCCCCC000;
307 GPIOF->MODER = 0xAA800AAA;
309 GPIOF->OSPEEDR = 0xFFC00FFF;
311 GPIOF->OTYPER = 0x00000000;
313 GPIOF->PUPDR = 0x55400555;
316 GPIOG->AFR[0] = 0x00CC0CCC;
317 GPIOG->AFR[1] = 0xC000000C;
319 GPIOG->MODER = 0x80020A2A;
321 GPIOG->OSPEEDR = 0xC0030F3F;
323 GPIOG->OTYPER = 0x00000000;
325 GPIOG->PUPDR = 0x40010515;
328 GPIOH->AFR[0] = 0x00C0CC00;
329 GPIOH->AFR[1] = 0xCCCCCCCC;
331 GPIOH->MODER = 0xAAAA08A0;
333 GPIOH->OSPEEDR = 0xFFFF0CF0;
335 GPIOH->OTYPER = 0x00000000;
337 GPIOH->PUPDR = 0x55550450;
340 GPIOI->AFR[0] = 0xCCCCCCCC;
341 GPIOI->AFR[1] = 0x00000CC0;
343 GPIOI->MODER = 0x0028AAAA;
345 GPIOI->OSPEEDR = 0x003CFFFF;
347 GPIOI->OTYPER = 0x00000000;
349 GPIOI->PUPDR = 0x00145555;
352 RCC->AHB3ENR |= 0x00000001;
362 while((tmpreg != 0) && (timeout-- > 0))
368 for (index = 0; index<1000; index++);
373 while((tmpreg != 0) && (timeout-- > 0))
381 while((tmpreg != 0) && (timeout-- > 0))
389 while((tmpreg != 0) && (timeout-- > 0))