cancel
Showing results for 
Search instead for 
Did you mean: 

Generated code with RCC configuration failing at SystemClock_Config()

repairman
Associate II

I have an STM32F7 which I have configured RCC for and am using HSE as a clock source. When using the debugger trying to step through the generated code, my project is failing at the SystemClock_Config(), specifically:

   /* Check the HSI ready flag */

   if (__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET)

   {

    return HAL_ERROR;

   }

  }

I’ve done everything in the configurator and there are no errors in the pin configuration section. I have not added any code yet to the generated code, so I am not sure what is causing this error. The RCC configuration does show warnings with Master Clock Output 2 and Audio Clock Input, since I am using SDMMC1 and they conflict, but I don’t think I need those so I’m not sure if they are the source of the issue.

1 REPLY 1
SofLit
ST Employee

Hello @repairman​ 

You said "I have configured RCC for and am using HSE as a clock source".

Are you sure you are using an external crystal?

  /* HSI is selected as System Clock Source */

  else

  {

   /* Check the HSI ready flag */

   if (__HAL_RCC_GET_FLAG(RCC_FLAG_HSIRDY) == RESET)

   {

    return HAL_ERROR;

   }

  }

--> this part of code is related to HSI usage.

SofLit

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.