cancel
Showing results for 
Search instead for 
Did you mean: 

using stm32f401rct6, two question, (1) system clock configured with a external 16Mhz crystal can work if it is set to 42Mhz but not at 84Mhz and (2) even if working will stuck at HAL_GetTick

JTse.1
Associate II

(1) cannot run at 84Mhz, it will stuck at Error Handler

 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 = 16;

 RCC_OscInitStruct.PLL.PLLN = 336;

 RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV8;

 RCC_OscInitStruct.PLL.PLLQ = 4;

 if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)

 {

  Error_Handler();

 }

(2) can run at 42Mhz but will keep looping inside the loop forever and cannot timeout

    /* Wait till HSE is ready */

    while(__HAL_RCC_GET_FLAG(RCC_FLAG_HSERDY) == RESET)

    {

     if((HAL_GetTick() - tickstart ) > HSE_TIMEOUT_VALUE)

     {

      return HAL_TIMEOUT;

     }

    }

   }

   else

10 REPLIES 10
Dear Tesla
Yes, I understand now, first time doing this, I did an all reply while answering individuals
My mistake, sorry,
john