2020-03-17 05:45 AM
Hello guys,
I got a "STM32F407-DISC1" board and if I configure the external oscillator, it goes into "error_handling:
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLM = 8;
RCC_OscInitStruct.PLL.PLLN = 336;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
RCC_OscInitStruct.PLL.PLLQ = 7;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
Afterwards program stops and does not continue. What do I need to change in my code? or is it due to a hardware failure?
Cheers
2020-03-19 05:05 PM
Maybe you're trying to change the PLL while it's already enabled. Who knows. You're not providing much info.
2020-03-19 10:42 PM
+1
...or ditch Cube altogether and write the clock setup yourself.
JW
PS If you don't have a crystal but using the STLink MCO output, do you set HSE Bypass?