cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 QSPI Errata

Dat Tran
Senior II

Hi, we see STM32H7 has Qspi errata as below:

 

DatTran_0-1714074330817.png

But we are not sure where to apply the patch exactly. It says "upon reset and upon switching from memory-mapped", mean in reset function, right after or before "HAL_QSPI_Init"?

 

 

 

 

 

 

5 REPLIES 5

Good Question.

I'd think prior to HAL_QSPI_Init(), but after the APB ENA / RST for the peripheral/clocks. And apparently after a bus abort.

 

Reading between the lines here, and looking at the prescaler changes, I would suppose there's some synchronous circuitry in there that doesn't take an async reset, or short clock count synchronous reset. ie in a slower domain, engaged inopportunely

 

Say you're running the QSPI device at 25 MHz, via the prescaler, but hold the reset for a couple of 200 or 400 MHz cycles.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
tjaekel
Lead

I think, I have seen that STM provides in HAL drivers code to do an "estimation" of the correct timing. I think to remember there is some code which figures out what the external timing is and how to configure QSPI.

If so, you would run this code after QSPI is configured and enabled, but before you change into Memory Mapped mode (which needs the "correct" timing).

I think, it is this code (which "calibrates" the DLYB delays) - I found it in one of my project now:

  HAL_OSPI_DLYB_Cfg_Struct.Units = 0;
  HAL_OSPI_DLYB_Cfg_Struct.PhaseSel = 0;
  if (HAL_OSPI_DLYB_SetConfig(&hospi1, &HAL_OSPI_DLYB_Cfg_Struct) != HAL_OK)
  {
    Error_Handler();
  }

This I do right after the:

if (HAL_OSPIM_Config(&hospi1, &sOspiManagerCfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)

 

KDJEM.1
ST Employee

Hello @Dat Tran ,

Edit:

As mentioned by @Tesla DeLorean the workaround is used after enabling peripherals/clocks and before HAL_QSPI_Init().

Also this workaround is applied when switching from memory mapped to any other modes.

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Dat Tran
Senior II

Following @KDJEM.1 : "before enabling peripheral clock and after HAL_QSPI_Init()."

Following @Tesla DeLorean : "prior to HAL_QSPI_Init(), but after the APB ENA / RST for the peripheral/clocks"

Following the ST HAL Driver: enabling peripheral clock is inside HAL_QSPI_Init()

```

HAL_StatusTypeDef HAL_QSPI_Init(QSPI_HandleTypeDef *hqspi)
{

 

//.... ST code

......

 

Question: Apply workaround here????

 

/* Enable the QSPI peripheral */
__HAL_QSPI_ENABLE(hqspi);

 

 

or Apply workaround here????

........

// ... ST Code
return status;
}

```

so I am still confused, could you please point out a bit more clear?

 

 

 

KDJEM.1
ST Employee

Hello @Dat Tran ,

I apologize for this typo and this confusion "The workaround is used before HAL_QSPI_Init(). " as explain by @Tesla DeLorean 

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.