[bug report] STM32CubeMX RCC initialization on STM32L4x misses PLLM and triggers assert error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-03-20 7:18 AM
On STM32L476RETx
void SystemClock_Config(void){
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct; RCC_PeriphCLKInitTypeDef PeriphClkInit;// ...
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|
RCC_OSCILLATORTYPE_LSE|RCC_OSCILLATORTYPE_MSI;
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = 16;
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
RCC_OscInitStruct.MSICalibrationValue = 0;
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
// NO RCC_OscInitStruct.PLL.PLLM initialization !
// should be = 1 but is = 0 by default so it triggers assert_failed and _Error_Handler
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;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
_Error_Handler(__FILE__, __LINE__);
}
}
Thanks
Romain
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-05-10 9:45 AM
Hi
Lamothe.Romain
,CubeMX version 4.1
(in which thisissue is resolved) isavailable now on ST Website.
Regards,
Houda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-03-22 9:18 AM
Approved, I have the same issue (CubeMX 4.25.0).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-03-22 5:19 PM
And if you dont use full assert, and build it, your system core clock speed starts at half speed, then goes down each time you hit the reset button. Got it as low as 11mhz, from 40. When it should have been 80.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-03-22 5:42 PM
Would also strongly recommend the use of the RCC_OscInitTypeDef RCC_OscInitStruct = {0}; form to ensure that the auto/local variable actually gets initialized to something predictable, normal behaviour exposes random stack content.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-03 11:19 AM
This issue is a CubeMX problem.
4.24 produces the correct RCC PLLM
4.25 does not.
I posted something to tech support a while back on a previous version, maybe 4.22, that does not produce RCC PLLM in the main.c initialization when you are using the PLL as a system clock. I use MSI to PLL for my system clock.
4.23 produces RCC PLLM and I think 4.21.1 does as well.
I don't advise using this as a work around but rather a test. IF you go into the .ioc file and change
MxDb.Version=DB.4.0.250
to
MxDb.Version=DB.4.0.240
then the PLLM initialization will come back.
I generated 3 projects using the same source for import to verify that PLLM is generated using 4.24 and 4.23.
According to the CubeMX change log there were a lot of changes when they went from 4.23 to 4.24 so I'm hesitant to use 4.24 and 4.25 doesn't work so I'm still using MXCube 4.23 until they get the PLLM generation figured out.
Roman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-04 6:47 AM
Hello,
You are right, PLLM parameter
is no more generate for STM32L4 in the CubeMX
version 4.25
.T
hisCubeMX bug passed internally to CubeMx team -again- for fix as it seems to be a regression issue after being fixed in version 4.23 and in version 4.25 for L4+ (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
).Sorry for such inconvenience.
Best Regards,
Imen
Thanks
Imen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-12 1:58 AM
Hello Motla,
Thanks for your feedback
The issue will be fixed next CubeMX release.
Please feel free to contact me for further details.
Best regards,
Houda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-04-12 7:45 AM
Hello Houda,
Are there any other STM32L4xx issues if I were to use CubeMX 4.25 besides it omitting the PLLM setting?
Roman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-05-10 9:45 AM
Hi
Lamothe.Romain
,CubeMX version 4.1
(in which thisissue is resolved) isavailable now on ST Website.
Regards,
Houda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-05-10 12:20 PM
Wonderful,
Thanks,
Roman Marjamaa
Marjamaa Engineering Inc.
395 Co Rd 110 N
Mound, MN 55364
Direct: (612) 999-8263
Mobile: (612) 345-1492
Fax: (855) 627-5364
www.marjamaaengineering.com<http://www.marjamaaengineering.com/>;
All information contained in this email is to be treated as “confidential� or “proprietary� and shall not be shared
outside the terms of the Agreement between Marjamaa Engineering Inc. and the Recipients of this email.
