void
__initialize_hardware(void)
{
  // Call the CSMSIS system initialisation routine.
  SystemInit();

#if defined (__VFP_FP__) && !defined (__SOFTFP__)

  // Enable the Cortex-M4 FPU only when -mfloat-abi=hard.
  // Code taken from Section 7.1, Cortex-M4 TRM (DDI0439C)

  // Set bits 20-23 to enable CP10 and CP11 coprocessor
  SCB->CPACR |= (0xF << 20);

#endif // (__VFP_FP__) && !(__SOFTFP__)

  // Initialise the HAL Library; it must be the first
  // instruction to be executed in the main program.
  HAL_Init();

  // Warning: The HAL always initialises the system timer.
  // For this to work, the default SysTick_Handler must not hang
  // (see system/src/cortexm/exception_handlers.c)

  // Unless explicitly enabled by the application, we prefer
  // to keep the timer interrupts off.
  //HAL_SuspendTick();

  // Enable HSE Oscillator and activate PLL with HSE as source
  configure_system_clock();
}
Ejemplo n.º 2
0
void
__initialize_hardware(void)
{
  // Call the CSMSIS system initialisation routine.
  SystemInit();

#if defined (__VFP_FP__) && !defined (__SOFTFP__)

  // Enable the Cortex-M4 FPU only when -mfloat-abi=hard.
  // Code taken from Section 7.1, Cortex-M4 TRM (DDI0439C)

  // Set bits 20-23 to enable CP10 and CP11 coprocessor
  SCB->CPACR |= (0xF << 20);

#endif // (__VFP_FP__) && !(__SOFTFP__)

  // Initialise the HAL Library; it must be the first
  // instruction to be executed in the main program.
  HAL_Init();

  BSP_LED_Init(LED3);
  BSP_LED_Init(LED4);
  BSP_LED_Init(LED5);
  BSP_LED_Init(LED6);

  // Enable HSE Oscillator and activate PLL with HSE as source
  configure_system_clock();
}
void
__initialize_hardware(void)
{
  // Enable HSE Oscillator and activate PLL with HSE as source
  configure_system_clock();

  // Call the CSMSIS system clock routine to store the clock frequency
  // in the SystemCoreClock global RAM location.
  SystemCoreClockUpdate();

  // Initialise the HAL Library; it must be the first
  // instruction to be executed in the main program.
  HAL_Init();

  // Warning: The HAL always initialises the system timer.
  // For this to work, the default SysTick_Handler must not hang
  // (see system/src/cortexm/exception_handlers.c)

  // Unless explicitly enabled by the application, we prefer
  // to keep the timer interrupts off.
  HAL_SuspendTick();
}