Skip to main content
repairman
Associate II
January 19, 2022
Solved

SystemClock_Config generated code is failing but no errors are shown in RCC config

  • January 19, 2022
  • 5 replies
  • 4562 views

I have an STM32F7 which I have configured RCC's HSE and LSE as Crystal Resonator and am using HSE as a clock source for my project PLL Source Mux and PLLCLK for System Clock Mux. The RCC configuration does show conflict warnings at Master Clock Output 2 and Audio Clock Input options, since I am using SDMMC1 and they conflict, but I don’t use those for my project so I'm not sure it is causing the error to be thrown. When using the debugger trying to step through the generated code just to see how it executes, 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.

This topic has been closed for replies.
Best answer by Sara BEN HADJ YAHYA

Hello @repairman​ ,

Sorry for the late reply,

If you are using an EVAL or a DISCO board you should set the HSE frequency to 25MHz. This info is mentioned in the Clock source section in the respective user manual. UM2033 (for DISCO) and UM2035(for EVAL) .

In case you are using a custom board, could you please check the frequency of the Crystal oscillator you are using in its datasheet.

I hope this helps :)

If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)

Sara.

5 replies

Sara BEN HADJ YAHYA
ST Technical Moderator
January 26, 2022

Hello @repairman​ ,

Thanks for your feedback,

Could you please share your .ioc file and specify the CubeMX version?

Thanks,

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
repairman
repairmanAuthor
Associate II
January 26, 2022

Thanks Sara! I've attached the .ioc file. My CubeMX version:

STM32CubeIDE

Version: 1.8.0

Build: 11526_20211125_0815 (UTC)

(C) 2021 STMicroelectronics ALL RIGHTS RESERVED

Sara BEN HADJ YAHYA
ST Technical Moderator
January 31, 2022

Hello @repairman​ ,

Sorry for the late reply,

If you are using an EVAL or a DISCO board you should set the HSE frequency to 25MHz. This info is mentioned in the Clock source section in the respective user manual. UM2033 (for DISCO) and UM2035(for EVAL) .

In case you are using a custom board, could you please check the frequency of the Crystal oscillator you are using in its datasheet.

I hope this helps :)

If your issue is solved, please close this post by clicking the "Select as Best" button. This will help other members of the community find this response more quickly :)

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.
TBell.2
Associate
April 13, 2022

I seem to be having the same issue on my custom board. I upgraded my CubeMX app and now when I attempt to debug the application fails when HAL_RCC_OscConfig is called in method SystemClock_Config at startup. It's consistent every time. I've scoured the configuration files to no avail.

Sara BEN HADJ YAHYA
ST Technical Moderator
April 13, 2022

Hello @Bacteriusellavia​ ,

Thanks for your feedback,

Could you please create another thread describing your issue and please attach your ioc file so that we can reproduce it and help you with it.

Sara.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.