Skip to main content
Eqqman
Associate III
March 27, 2024
Solved

Cube says STM32F411 clock configuration is invalid, but processor still runs correctly

  • March 27, 2024
  • 2 replies
  • 5902 views

Hello-

Working with the STM32F411 on the ST F411 Discovery board, we have set the speed to 72MHz using the HSI as the PLL source.  The register values are as follows:

RCC->CR = 0x03005C83

RCC->PLLCFGR = 0x23001208

According to Cube, this configuration is invalid:

stm32_cube_clock.jpg

In fact, there seems to be NO clock speed we can find that won't flag the configuration as invalid if HSI is the PLL source.  Although the code appears to run correctly and there haven't been any timing issues experienced we want to check if there is some additional clock setting someplace that needs to be used to stop Cube from flagging this as an error.  Current version of cube is:

STM32CubeIDE

 

Version: 1.15.0

Build: 20695_20240315_1429 (UTC)

But this issue is not new, it has happened on older versions as well.

 

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Hello,

    I reproduced the behavior.

    Are you enabling USB in your project? if not disable it from here:

    SofLit_0-1711642105464.png

    If you need USB function, you need to use HSE with an external crystal.

    2 replies

    mƎALLEm
    Technical Moderator
    March 28, 2024

    Hello,

    Could you please share the error/warning message CubeMx is showing for that configuration?

    To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
    Eqqman
    EqqmanAuthor
    Associate III
    March 28, 2024

    As you can see in the original attached image, there is a red box around the HSI selection at the PLL Source Mux input.  This box is there any time HSI is chosen as the input no matter what /M /N /P settings we pick.  The tool-tip that pops up when you hover over merely says "PLL Mux should have HSE as input".

     

    EDIT : The STM32 Discovery board does have an external oscillator attached to the HSE inputs, so theoretically the chip could be ignoring our RCC settings and using the external crystal, but in such a case, all our timings would be off since we'd be basing them on the wrong cpu speed.  There is also nothing I can find in the F411 documentation that gives any case where the HSI clock is not allowed as a PLL source.

    mƎALLEm
    mƎALLEmBest answer
    Technical Moderator
    March 28, 2024

    Hello,

    I reproduced the behavior.

    Are you enabling USB in your project? if not disable it from here:

    SofLit_0-1711642105464.png

    If you need USB function, you need to use HSE with an external crystal.

    To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
    mƎALLEm
    Technical Moderator
    April 3, 2024

    I do agree. Escalated internally. Hope I'll get a feedback.

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