2017-09-07 12:43 PM
I am using STM32CubeMX 4.22.0
I am using STM32F103C8T6 chip with Keil v5 under Windows 10.I configured only RCC to
HSE for Crystal\Ceramic Resonator and in Clock Configuration input frequency to 8 MHz and HCLK to 72MHz .I generated the code for keil, but at the function 'SystemClock_Config()' the chip falls into Error_Handler().
following code was generated:
void SystemClock_Config(void)
{RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_ClkInitTypeDef RCC_ClkInitStruct;/**Initializes the CPU, AHB and APB busses clocks
*/ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { _Error_Handler(__FILE__, __LINE__); }I debug step by step. At the point 'Error_Handler' the program goes in to infinite loop of function 'Error_Handler(char * file, int line) ' I can not understand what is the problem. I also attached the full project at the attachment.
#stm32cubemx-4.22-systemclock_config-bug*2017-09-09 05:03 AM
Hi,
Ok, I understand now. I am working before in arduino ide to program Stm32f103 . Therefore i have not aware much about inside of stm hal library. Now I have to study the internal structure of hal library for my knowledge. Many many thanks for your help.