Skip to main content
lasse
Associate
February 17, 2017
Solved

STM32F439NIH can't get PLLCLK on MCO1 (solved)

  • February 17, 2017
  • 2 replies
  • 779 views
Posted on February 17, 2017 at 12:29

I want to have 60 MHz on the MCO1 pin PA8. I use an external 25 Mhz crystal. The PLL delivers 180 Mhz to the system clock. I've used STCubeMX to configure the clocks to get 180 MHz / 3 on MCO1.

Unfortunatly I'm not getting any activity on the MCO1 pin at all.

Some things I've tried:

- Checking the registers in the debugger, looks correct.

- Setting MCO1 register to 0x02 for using HSE. This works fine, I'm getting pulses on MCO1

- Setting PLL down to 75 Mhz. No activity on MCO1.

Is this some limitation or erratta that I somehow missed in the documentation?

    This topic has been closed for replies.
    Best answer by lasse
    Posted on February 17, 2017 at 12:41

    Solved!

    In MX_GPIO_Init() the GPIO speed setting was

      GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;

    Changed it to:

      GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;

    This can also be done in CubeMX under RCC configuration -> GPIO

    Funny thing is, that the port is actually set up for VERY high speed in  HAL_RCC_MCOConfig() but this is called before MX_GPIO_Init()

    2 replies

    lasse
    lasseAuthorBest answer
    Associate
    February 17, 2017
    Posted on February 17, 2017 at 12:41

    Solved!

    In MX_GPIO_Init() the GPIO speed setting was

      GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;

    Changed it to:

      GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;

    This can also be done in CubeMX under RCC configuration -> GPIO

    Funny thing is, that the port is actually set up for VERY high speed in  HAL_RCC_MCOConfig() but this is called before MX_GPIO_Init()

    feuerwolf
    Associate III
    August 9, 2018

    HAL_EnableCompensationCell();

    might be necessary for higher clock frequencies