Nucleo-L476 HSI configuration
I use Stm32cubemx generate code with nucleo-l476 board.it run well if i use sw4stm32, but if i compile it using Clion with gcc, it will hand in HAL_RCC_ClockConfig(). After debugging and searching, i found the reasion should be missing one line.
origin is :
/**Initializes the CPU, AHB and APB busses clocks
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue =16;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLN = 10;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV7;
RCC_OscInitStruct.PLL.PLLQ =
RCC_PLLQ_DIV2
;
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
it should be :
/**Initializes the CPU, AHB and APB busses clocks
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue =16;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLM = 1;
RCC_OscInitStruct.PLL.PLLN =
10;RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV7;
RCC_OscInitStruct.PLL.PLLQ =
RCC_PLLQ_DIV2
;
RCC_OscInitStruct.PLL.PLLR
=RCC_PLLR_DIV2;is it a bug? or because my poor knowledge?
