cancel
Showing results for 
Search instead for 
Did you mean: 

Issues with HAL_QSPI_Command_IT for W25Q128JV Flash Memory

kzorer
Associate

Hello ST community,

I am working with an ST microcontroller and a W25Q128JV flash memory, interfacing via QSPI. While using the HAL library, I’ve encountered an issue with the HAL_QSPI_Command_IT function.

When I use the blocking HAL_QSPI_Command method to read the status register and execute other flash operations, everything works correctly. However, when I switch to the interrupt-based HAL_QSPI_Command_IT function (specifically, when I call it before HAL_QSPI_Receive and HAL_QSPI_Transmit functions), the sequence fails to execute properly, and I do not receive the correct results.

Context:

  • Flash Memory: W25Q128JV
  • Operations: Reading the status register, as well as writing to and reading from memory.
  • Working Approach: Using HAL_QSPI_Command (blocking) works perfectly for these operations.
  • Problematic Approach: Using HAL_QSPI_Command_IT (interrupt) fails for certain sequences.

My Question:

Are there any known limitations or special considerations when using HAL_QSPI_Command_IT with the W25Q128JV flash memory? Specifically, could the issue be related to:

  1. Interrupt latency or improper handling of the command complete callback (HAL_QSPI_CmdCpltCallback)?
  2. Timing constraints that require polling the status register or ensuring the flash memory completes operations before proceeding?

Any insights or suggestions for handling this sequence using interrupt-based commands would be greatly appreciated.

Thank you for your help!

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

Hello @kzorer ,

 

Interrupt happens at end of a transfer, so yes there is restriction to use HAL_QSPI_Command_IT.

This function can be use only if the DataMode field of the Command is equal to QSPI_DATA_NONE (No data).

Otherwise, it means that command will happens after the complete phase Command/Address/data.

So, the HAL_QSPI_Command + HAL_QSPI_Receive_IT/HAL_QSPI_Transmit_IT shall be used.

 

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.

View solution in original post

3 REPLIES 3
KDJEM.1
ST Employee

Hello @kzorer and welcome to the Community;

 

Which STm32H7 are you use?

I do not receive the correct results.

-->Could you please share what you've received and what you're expecting?

May QSPI_ReadWrite_IT example can help you.  This example describes how to erase part of the QSPI memory, write data in Interrupt mode, read data in Interrupt mode and compare the result in a forever loop.

 

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.

Hello Kaouthar,

Thank you for your response. I am using the STM32H745ZI microcontroller in my project.

I have checked the QSPI_ReadWrite_IT example as you suggested. However, I have a question regarding its implementation: before receiving or transmitting any data, I noticed that the example uses HAL_QSPI_Command (blocking) instead of HAL_QSPI_Command_IT (interrupt-based). I’m trying to understand why this is the case.

In my case, for single commands, I do receive interrupts and the callback (HAL_QSPI_CmdCpltCallback) works correctly. However, when I try to use HAL_QSPI_Command_IT before transmitting or receiving data, no interrupt is generated, and the callback is not invoked.

Could you clarify why HAL_QSPI_Command_IT does not generate any interrupts in this scenario, while HAL_QSPI_Command (blocking) works fine? Is there a specific limitation or requirement for using HAL_QSPI_Command_IT before a data transmit or receive operation?

Thank you again for your help!

Best regards,

kzorer

KDJEM.1
ST Employee

Hello @kzorer ,

 

Interrupt happens at end of a transfer, so yes there is restriction to use HAL_QSPI_Command_IT.

This function can be use only if the DataMode field of the Command is equal to QSPI_DATA_NONE (No data).

Otherwise, it means that command will happens after the complete phase Command/Address/data.

So, the HAL_QSPI_Command + HAL_QSPI_Receive_IT/HAL_QSPI_Transmit_IT shall be used.

 

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.