Skip to main content
repairman
Associate II
January 20, 2022
Question

Generated code with RCC configuration failing at SystemClock_Config()

  • January 20, 2022
  • 1 reply
  • 1419 views

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.

This topic has been closed for replies.

1 reply

mƎALLEm
ST Technical Moderator
January 21, 2022

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 "Best answer" on the reply which solved your issue or answered your question.