Skip to main content
Visitor II
November 9, 2021
Solved

Setting Octospi free running clock mode

  • November 9, 2021
  • 1 reply
  • 1335 views

Anyone knows why in HAL_OSPI_Init(...) , Octospi free running clock has to be enabled after Octospi is enabled. Form stm32l5xx-hal_ospi.c, lines 404-411:

/* Enable OctoSPI */

    __HAL_OSPI_ENABLE(hospi);

    /* Enable free running clock if needed : must be done after OSPI enable */

    if (hospi->Init.FreeRunningClock == HAL_OSPI_FREERUNCLK_ENABLE)

    {

     SET_BIT(hospi->Instance->DCR1, OCTOSPI_DCR1_FRCK);

    }

    This topic has been closed for replies.
    Best answer by ChahinezC

    Hello @xinu2021​,

    The Free running clock principal use case is for Delay block Calibration with OCTOSPI , since that the DLYB calibration require a continuous clock it is a must to enable the Free running when calibrating it with OCTOSPI. After that, the FRCK can be disabled.

    In The OSPI_Init section, we give the flexibility to our users to use it for other purposes, you can enable free running clock after enabling the OCTOSPI but must pay attention when using it:

    • enabling the Free running clock forces the OCTOSPI to enter a busy state, no OCTOSPI command operation can be initiated in this state. Disabling the free
    • running clock will be done by making an abort.

    I hope my answer helped you, when your question is answered please close this topic by marking it as Best

    Chahinez.

    1 reply

    ChahinezCAnswer
    Visitor II
    November 19, 2021

    Hello @xinu2021​,

    The Free running clock principal use case is for Delay block Calibration with OCTOSPI , since that the DLYB calibration require a continuous clock it is a must to enable the Free running when calibrating it with OCTOSPI. After that, the FRCK can be disabled.

    In The OSPI_Init section, we give the flexibility to our users to use it for other purposes, you can enable free running clock after enabling the OCTOSPI but must pay attention when using it:

    • enabling the Free running clock forces the OCTOSPI to enter a busy state, no OCTOSPI command operation can be initiated in this state. Disabling the free
    • running clock will be done by making an abort.

    I hope my answer helped you, when your question is answered please close this topic by marking it as Best

    Chahinez.