2024-09-30 05:20 AM
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.
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:
Any insights or suggestions for handling this sequence using interrupt-based commands would be greatly appreciated.
Thank you for your help!
Solved! Go to Solution.
2024-10-01 12:41 AM
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.
2024-09-30 06:39 AM
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.
2024-09-30 06:59 AM - edited 2024-09-30 07:00 AM
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
2024-10-01 12:41 AM
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.