2017-09-20 03:35 AM
Hi guys.
I'm working in a STM32L476JGY based project using the board STEVAL-STLCS02V1.
The code generated by the Cube using the default clock configuration 'forgets' initialize the M value of the PLL struct, see original code:
/** System Clock Configuration
*/void SystemClock_Config(void){RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_PeriphCLKInitTypeDef PeriphClkInit;/**Initializes the CPU, AHB and APB busses clocks
*/ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI; RCC_OscInitStruct.MSIState = RCC_MSI_ON; RCC_OscInitStruct.MSICalibrationValue = 0; RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_MSI; RCC_OscInitStruct.PLL.PLLN = 40; RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV7; RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2; RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); }...
it's very strange that the call to HAL_RCC_OscConfig returns with a HAL_OK, but later, when the function tries to configure the PPLSAI1 it fails and the system is blocked on the _Error_Handler loop.
I fixed the problem initializing the M value on the PLL adding the following line:
RCC_OscInitStruct.PLL.PLLM = 1; // STM32CubeMX forgets that line.
#steval-stlcs02v1 #stm32l476jgyx #systemclock_config #stm32cubemx-4.22.1Solved! Go to Solution.
2018-02-06 05:33 AM
Hi
Ramon.Isidre
,Sorry for my late reply.
Regarding the issue about 'PLLM is no more generated', it was fixed in the CubeMx version 4.23 asmentioned in the Release note of STM32CubeMX
/external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fcontent%2Fccc%2Fresource%2Ftechnical%2Fdocument%2Frelease_note%2Fb2%2F02%2F4b%2Fe3%2F81%2F32%2F49%2Fc4%2FDM001076pdf%2Ffiles%2FDM001076pdf%2Fjcr%3Acontent%2Ftranslations%2Fen.DM001076pdf
.You can upgrade with the latest CubeMX release (version4.24).
Best Regards,
Jeanne
2017-10-03 08:49 AM
Hello
isidresole
,This issue is already
raised internally to CubeMx team
and itwill be fixed in our next release.Thank you for your contribution.
Best Regards,
Imen
2018-02-06 05:33 AM
Hi
Ramon.Isidre
,Sorry for my late reply.
Regarding the issue about 'PLLM is no more generated', it was fixed in the CubeMx version 4.23 asmentioned in the Release note of STM32CubeMX
/external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fcontent%2Fccc%2Fresource%2Ftechnical%2Fdocument%2Frelease_note%2Fb2%2F02%2F4b%2Fe3%2F81%2F32%2F49%2Fc4%2FDM001076pdf%2Ffiles%2FDM001076pdf%2Fjcr%3Acontent%2Ftranslations%2Fen.DM001076pdf
.You can upgrade with the latest CubeMX release (version4.24).
Best Regards,
Jeanne
2018-02-06 11:05 AM
Great News Jeanne
THanks.