STM32CubeMX V5.3.0 does not generate correct code for SystemClock_Config()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-11 3:18 PM
Anyone aware of this problem and any workaround, other than manually changing the generated file? Specifically, ​ RCC_OscInitStruct.PLL.PLLR, RCC_OscInitStruct.PLL.PLLP and
RCC_OscInitStruct.PLL.PLLR are not being configured correctly, causing the first call to HAL_GetTick() inside HAL_RCC_OscConfig() to crash.
- Labels:
-
RCC
-
STM32CubeMX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-11 5:39 PM
For what STM32 part? Trying to narrow this down a bit.
Make sure SystemClock_Config() zeros out the local/auto variable.
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
‎2019-09-12 6:07 AM
​Sorry Clive. It's the STM32G070CB. And to be more specific, these parameters were configured on the Clock Configuration Tab in Cube as:
RCC_OscInitStruct.PLL.PLLN = 9
RCC_OscInitStruct.PLL.PLLP = 3
RCC_OscInitStruct.PLL.PLLR = 3,
but the code generated:
RCC_OscInitStruct.PLL.PLLN = 8
RCC_OscInitStruct.PLL.PLLP = 2
RCC_OscInitStruct.PLL.PLLR = 2.
HOWEVER, in trying to pull this information together for you this morning, Cube generated the correct code this time. ??? I have been quite careful to save the project before generating code, but "Generate Code" saves the project anyway. So, I am not sure what is going on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-25 7:24 AM
​Resolved
