@@ -164,23 +164,22 @@ WEAK void SystemClock_Config(void)
164164 RCC_OscInitTypeDef RCC_OscInitStruct;
165165 RCC_ClkInitTypeDef RCC_ClkInitStruct;
166166
167- /* * Initializes the CPU, AHB and APB busses clocks
168- */
169- RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE ;
170- RCC_OscInitStruct.HSEState = RCC_HSE_ON ;
167+ /* Initializes the CPU, AHB and APB busses clocks */
168+ RCC_OscInitStruct. OscillatorType = RCC_OSCILLATORTYPE_HSI;
169+ RCC_OscInitStruct.HSIState = RCC_HSI_ON ;
170+ RCC_OscInitStruct.HSICalibrationValue = 16 ;
171171 RCC_OscInitStruct.PLL .PLLState = RCC_PLL_ON;
172- RCC_OscInitStruct.PLL .PLLSource = RCC_PLLSOURCE_HSE ;
173- RCC_OscInitStruct.PLL .PLLM = 8 ;
174- RCC_OscInitStruct.PLL .PLLN = 240 ;
172+ RCC_OscInitStruct.PLL .PLLSource = RCC_PLLSOURCE_HSI ;
173+ RCC_OscInitStruct.PLL .PLLM = 13 ;
174+ RCC_OscInitStruct.PLL .PLLN = 195 ;
175175 RCC_OscInitStruct.PLL .PLLP = RCC_PLLP_DIV2;
176176 RCC_OscInitStruct.PLL .PLLQ = 5 ;
177177 if (HAL_RCC_OscConfig (&RCC_OscInitStruct) != HAL_OK)
178178 {
179- while ( 1 );
179+ _Error_Handler (__FILE__, __LINE__ );
180180 }
181181
182- /* *Initializes the CPU, AHB and APB busses clocks
183- */
182+ /* Initializes the CPU, AHB and APB busses clocks */
184183 RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
185184 |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
186185 RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
@@ -190,15 +189,13 @@ WEAK void SystemClock_Config(void)
190189
191190 if (HAL_RCC_ClockConfig (&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK)
192191 {
193- while ( 1 );
192+ _Error_Handler (__FILE__, __LINE__ );
194193 }
195194
196- /* *Configure the Systick interrupt time
197- */
195+ /* Configure the Systick interrupt time */
198196 HAL_SYSTICK_Config (HAL_RCC_GetHCLKFreq ()/1000 );
199197
200- /* *Configure the Systick
201- */
198+ /* Configure the Systick */
202199 HAL_SYSTICK_CLKSourceConfig (SYSTICK_CLKSOURCE_HCLK);
203200
204201 /* SysTick_IRQn interrupt configuration */
0 commit comments