2021-12-22 07:23 AM
I have an STM32F415VG custom board with a 25MHz external oscillator.
I created an empty project with CubeMX setting the clock to use HSE+PLL to have 72MHz SYSCLK. Nothing else is enabled except the Serial Wire Debug port.
I import the project in KEIL, build and load it.
When I run it, the SystemClock_Config function crashes, loosing debuger connection.
I debugged the funcion and found out that the issue arises right after the instruction
/* Enable the main PLL. */
__HAL_RCC_PLL_ENABLE();
inside the HAL_RCC_OscConfig(&RCC_OscInitStruct) function.
What could be the issue? I neve experienced this.
N.B. We have previously used this board for another project and never had an issue like that, the clock config just worked.
2021-12-22 07:36 AM
Looks like a clock configuration issue.
Is HSE_VALUE set to 25000000?
Are wait states sufficient?
2021-12-22 07:38 AM
Yes HSE is set to proper value. About wait states i'm using default value provided by CubeMX.
2021-12-22 07:48 AM
This happened to me once when i forgot to put in place the external XTAL, and also remmember another time i placed the wrong capacitor value (100nF instead of 22pF)
Did you discarded damaged board?
2021-12-23 02:11 AM
The board was just working as is with another software project.