Issue with System Clock Configuration
I am trying to program an STM32 MCU powered board that has the STM32F103R8T6 UNIT. I have figured out that while the program is executing the function called SystemClock_Config(); doesn't initialize the clock and goes to the error handler when croosing the line:
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
Then the Error_Handler() function goes inside the following while loop and the program never gets executed.
void Error_Handler(void)
{
/* USER CODE BEGIN Error_Handler_Debug */
/* User can add his own implementation to report the HAL error return state */
__disable_irq();
while (1)
{
}
/* USER CODE END Error_Handler_Debug */
}
I have configured my clock to be from the external crystal at 16MHz, have set the HCLK at the maximum allowable frequency of 72MHz and finally run the clock issues resolver and everything seems to be fine. However the program goes to this inifinite while() loop at the error handler and obviously stays there. How could I get over this problem ? Any help would be really appreciated. Thank you in advance !
