STM32F722 Nucleo Clock Issues

Sysprogs forums Forums VisualGDB STM32F722 Nucleo Clock Issues

Tagged: , ,

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #26964
    tm123
    Participant

    Hi,

    I don’t know if I’m going crazy but two “different” projects using the exact same code and HAL files are creating two different clock values. One is correct and the other isn’t.

    Both projects are the ones generated by VisualGDB. The chip in question is the STM32F722ZE.

    The two projects are the “LEDBlink (HAL)” and the other one is a STM32 CubeMX Sample  (RCC -> RCC_ClockConfig). I copied the clock configuration from the CubeMX example into the LEDBlink which uses the default 16MHz clock and tried to test it and the clock “SystemCoreClock” variable is 675000000. Obviously incorrect and NOTHING fails, but the clock itself is wrong and is super slow, slower than the default clock, indicating that it did fail. Yet the CubeMX one generates 216000000 which is the correct one.

     

    I checked everything, and I mean everything. The smallest project setting, did a differential check of all the different files to make sure they are identical. I stepped through the code where the clock change roughly happens and they both are identical yet they produce two different values.

    At first I thought one of the projects was maybe using an out of date HAL driver or something else but everything is identical.

     

    What… is… going… on…

    #26965
    support
    Keymaster

    Sorry, unfortunately it’s beyond the scope of our product support to help troubleshoot project-specific issues. Our best advice would be to step through the clock-related code in both projects and compare it side-by-side.

    If this doesn’t help, please consider creating a topic on the STM32 forums or on StackOverflow to get help from other developers.

    #26966
    tm123
    Participant

    You’re right, it is an STM32 issue. My apologies.

     

    I did find the issue however. Inside “stm32f7xx_hal_conf.h” the HSE_VALUE is defined as “25000000” which is incorrect. The MCO clock (HSE) coming from the ST-Link is 8MHz so it needs to be changed to “8000000”. There is no 25MHz clock anywhere on this board.

    #if !defined (HSE_VALUE)
    #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
    #endif /* HSE_VALUE */

    #26967
    support
    Keymaster

    Sorry, this is by design. Different boards have different clock configurations, so unless you specifically clone a sample designed for your board (via the “STM32CubeMX Samples” switch in the wizard), you would need to adjust the clock settings to match your board.

    If you believe the clock configuration for a board-specific sample in invalid, please consider reporting it to ST, as VisualGDB takes the STM32CubeMX samples directly from the STM32 SDKs.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.