Use HSE
This commit is contained in:
		@ -236,9 +236,8 @@ void SystemClock_Config(void) {
 | 
			
		||||
  /** Initializes the RCC Oscillators according to the specified parameters
 | 
			
		||||
   * in the RCC_OscInitTypeDef structure.
 | 
			
		||||
   */
 | 
			
		||||
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
 | 
			
		||||
  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
 | 
			
		||||
  RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
 | 
			
		||||
  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
 | 
			
		||||
  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
 | 
			
		||||
  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
 | 
			
		||||
  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
 | 
			
		||||
    Error_Handler();
 | 
			
		||||
@ -248,7 +247,7 @@ void SystemClock_Config(void) {
 | 
			
		||||
   */
 | 
			
		||||
  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK |
 | 
			
		||||
                                RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
 | 
			
		||||
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
 | 
			
		||||
  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSE;
 | 
			
		||||
  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
 | 
			
		||||
  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
 | 
			
		||||
  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
 | 
			
		||||
@ -256,6 +255,10 @@ void SystemClock_Config(void) {
 | 
			
		||||
  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK) {
 | 
			
		||||
    Error_Handler();
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /** Enables the Clock Security System
 | 
			
		||||
   */
 | 
			
		||||
  HAL_RCC_EnableCSS();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
@ -548,6 +551,7 @@ static void MX_GPIO_Init(void) {
 | 
			
		||||
  GPIO_InitTypeDef GPIO_InitStruct = {0};
 | 
			
		||||
 | 
			
		||||
  /* GPIO Ports Clock Enable */
 | 
			
		||||
  __HAL_RCC_GPIOH_CLK_ENABLE();
 | 
			
		||||
  __HAL_RCC_GPIOC_CLK_ENABLE();
 | 
			
		||||
  __HAL_RCC_GPIOA_CLK_ENABLE();
 | 
			
		||||
  __HAL_RCC_GPIOB_CLK_ENABLE();
 | 
			
		||||
 | 
			
		||||
@ -77,6 +77,7 @@ void NMI_Handler(void)
 | 
			
		||||
  /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
 | 
			
		||||
 | 
			
		||||
  /* USER CODE END NonMaskableInt_IRQn 0 */
 | 
			
		||||
  HAL_RCC_NMI_IRQHandler();
 | 
			
		||||
  /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
 | 
			
		||||
  while (1) {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user