2018-04-22 10:53 PM
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?
2018-04-23 12:04 AM
It is a bug in CubeMX that has been reported/described numerous times, hopefully it will be fixed in 4.26
2018-04-23 01:36 AM
Hello
hiwszjq
,As said by Clive, this is an issue on CubeMX version 4.25: The
PLLM parameter
is not generated for the STM32L4 MCUs.
This is already reported internally and will be fixed in the next releases of CubeMX.
Sorry for any inconvenience this may have caused.
Khouloud.
2018-04-23 02:18 AM
but i can't find solution on google & baidu(Chinese Searching Engine), and i just start to learn STM32.
2018-04-23 06:10 AM
Hi Zhou
This will be fixed next release. As a workaround, you can use the RCC LL Driver where the PLLM is well configured..
2018-04-23 08:26 AM
thankyou.i will try it
2018-04-23 10:12 AM
Just paste in the missing line, as needed, or run without PLL if you're continually rebuilding with CubeMX
2018-05-07 02:58 AM
the 4.25.1 will be available this week fixing this issue, stay tuned
2018-05-18 05:00 AM
Hello,
The PLLM code generation for STM32L4 Series is now fixed on
.Khouloud.