cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Octospi free running clock mode

xinu2021
Associate

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);

    }

1 ACCEPTED SOLUTION

Accepted Solutions
ChahinezC
Lead

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.

View solution in original post

1 REPLY 1
ChahinezC
Lead

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.