cancel
Showing results for 
Search instead for 
Did you mean: 

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

repairman
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Sara BEN HADJ YAHYA
ST Employee

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.

View solution in original post

5 REPLIES 5
Sara BEN HADJ YAHYA
ST Employee

Hello @repairman​ ,

Thanks for your feedback,

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

Thanks,

Sara.

repairman
Associate II

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 Employee

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.

TBell.2
Associate II

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.

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.