2018-11-28 10:32 AM
Hello,
I'm generating code for a project targeting the stm32767zi Nucleo. When I run the generated code, I encounter an assert_failed due to the PLLR not being configure to the correct value. If I look at the generated SystemClock_Config() function in main.c, there is no code generated to configure the PLLR, but there is code to configure other aspects of the PLL such as PLLM,Q, etc. So I believe that this is the cause of the failure.
I'm using the default clock configuration, and using the latest version of CubeMX and the HAL.
Is there a reason that the PLLR is not being configured? Is this a bug, or is there a setting somewhere I need to change?
Thanks
2018-11-28 12:03 PM
Poorly tested and validated
As a rule of habit I initialize auto/local variables where I suspect there is opportunity for undefined operation.
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
2018-11-29 04:30 AM
In the latest version of Cube, the initialization structs are now initialized to zero, which is good. Unfortunately for this application the PLLR has a valid range of values between 2-7, so setting it to 0 still causes an assertion failure. In my application I think I can ignore this assertion failure, since I'm not using the DSI hardware which receives the output of the PLLR clock, but it would be nice if the generated code could be fixed so this assertion failure doesn't occur