Skip to content

Commit

Permalink
Fixed USB clock
Browse files Browse the repository at this point in the history
  • Loading branch information
hletrd committed May 5, 2023
1 parent 91ed1fe commit 71aa341
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions bootloader/F4/Src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,16 @@ void SystemClock_Config(void)
__HAL_RCC_PWR_CLK_ENABLE();
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);

/* Initializes the CPU, AHB and APB busses clocks (100 MHz) */
/* Initializes the CPU, AHB and APB busses clocks (96 MHz) */
/* USB clock as 48MHz */
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 6;
RCC_OscInitStruct.PLL.PLLN = 100;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 4;
RCC_OscInitStruct.PLL.PLLN = 192;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
RCC_OscInitStruct.PLL.PLLQ = 8;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
_Error_Handler(__FILE__, __LINE__);
}
Expand Down

0 comments on commit 71aa341

Please sign in to comment.