cancel
Showing results for 
Search instead for 
Did you mean: 

How should I configure the 'MemoryType' when setting up the OSPI1 interface of the STM32U575ZI for QSPI mode?

Glee.41
Associate II

In my setup, I have connected a QSPI NAND flash (IS37SML01G1) to the OSPI1 interface.

When I configure OSPI1 in 1-line SPI mode, I can write a specific data pattern to the NAND flash and read it back for comparison without encountering any issues.

Below is the configuration:

.data_mode = OSPI_SPI_MODE
 
hospi.Init.MemoryType = HAL_OSPI_MEMTYPE_MICRON;
hospi.Init.FifoThreshold = 4;
hospi.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE;
hospi.Init.ChipSelectHighTime = 2;
hospi.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE;
hospi.Init.ClockMode = HAL_OSPI_CLOCK_MODE_0;
hospi.Init.WrapSize = HAL_OSPI_WRAP_NOT_SUPPORTED;
hospi.Init.SampleShifting = HAL_OSPI_SAMPLE_SHIFTING_NONE;

When I set OSPI1 to OSPI_QUAD_MODE, the write-read-comparison failed.

I came across an article suggesting that I should select an appropriate 'MemoryType' based on the data transfer order. However, I'm unsure about which memory type to use in my case.

Could you please assist me in identifying the correct memory type?

Flash spec: https://www.issi.com/WW/pdf/37-38SML01G1.pdf

It is how data is transferred in QSPI mode from flash.


_legacyfs_online_stmicro_images_0693W00000bjaRfQAI.png 

9 REPLIES 9

Number of options​ to try relatively finite, would expect sample shift to be of more consequence, and you walking the interface into the right mode.

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

Hello @Glee.4​ and welcome to STCommunity 🙂 ,

NAND memory are supported if the command format is in line with the OCTOSPI controller frame format. In this memory case it is not supported because when I referred to the datasheet memory, I noted that the command necessities 7 clock.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

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.

I tried both settings - HAL_OSPI_MEMTYPE_MACRONIX and HAL_OSPI_MEMTYPE_MICRON. None of them work on QSPI mode.

Hey @KDJEM.1​ ,

Not so sure about "command necessities 7 clock"?

Data is transmitted in 4-lines (QSPI) mode. All the command / addresss are transmitted in 1-line mode.

KDJEM.1
ST Employee

Hello @Glee.4​ ,

To clarify my last comment, this ISSI NAND memory requires 7 SCK for the command as shown in the below figure.


_legacyfs_online_stmicro_images_0693W00000bkZYmQAM.pngBut, it is mentioned in RM0456 and precisely in Octo-SPI interface (OCTOSPI) section, for the command phase 1 to 4 byte instruction is transmitted.

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.

Can't say I spent time on the U5, but used QSPI successfully on H72x and H7Ax platforms, and they are inherently geared to OCTOSPI operation.

Unfortunately I can't spend time solving your issues.

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

Hi @KDJEM.1​ ,

I have succesfully accessed ISSI NAND memory in single SPI mode on OSPI interface. Commands and data are transmitted in single SPI mode without issue. (You are right. It doesn't make sense to transmit 8bits command in 7 SCK. Maybe the ISSI spec is wrong or the 4 dummy bits comming after the command cycle make it right. 🙂 )

In my use case, even though OSPI is set to quad-SPI mode to transmit data, I will still transmit command in single-SPI mode. So I am more concerning about the data phase instead of instrcution phase.

I asked the same question in the article of knowledge base as the author said the choice of memory type is based on data ordering.

However I tried HAL_OSPI_MEMTYPE_MACRONIX and HAL_OSPI_MEMTYPE_MICRON. Neither of them works.

The article is about how to set up OSPI intreface for OSPI flash. I'd like to understand the criteria for selecting the appropriate memory type for QSPI flash.

KDJEM.1
ST Employee

Hello @Glee.4​ ,

If you think that the ISSI datasheet is wrong it must be contact the proved memory.

For the OSPI , the choice of memory type is based on data ordering.

But for the QSPI, when the memory is supported by the Octo-SPI interface, you can choose any memory type. The memory type has not affect the function for the QPSI.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

  

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.

Glee.41
Associate II

Hi @KDJEM.1​ ,

The command CLK doesn't really bother me since I have no isuse to send command and get correct response in single SPI mode on Octo-SPI interface.

I tried different memory types to transfer data in QSPI mode but it doesn't work.

That's why I posted this question to ask if data ordering matters in QSPI.

I can double check if any settings I miss.