cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to QSPI Memory Mapped Mode

Priyank
Senior

I am trying to debug some functions to write to the memory mapped QSPI. When I go to debug it, I notice that before any functions even run the QPSI is in HAL_QSPI_STATE_ERROR, therefore I cannot test my code to see if is running because it is dependent on the State of the QSPI. My QSPI is a WinBond25Q128JVSQ. Is there a way to trouble shoot this?

1 ACCEPTED SOLUTION

Accepted Solutions
Priyank
Senior

I was able to find a solution,

    __HAL_RCC_QSPI_FORCE_RESET();
    __HAL_RCC_QSPI_RELEASE_RESET();
    __HAL_RCC_QSPI_CLK_ENABLE();
    HAL_QSPI_Abort(&hqspi);

thank you 

View solution in original post

5 REPLIES 5
KDJEM.1
ST Employee

Hello @Priyank;

 

When the QUADSPI interface configured in memory-mapped mode, the external flash memory is seen as an internal memory but with some latency during accesses. Only read operations are allowed to the external flash memory in memory-mapped mode. 

The indirect mode supports read and write operations. 

For the OCTOSPI interface, the write operation is supported in memory-mapped mode. 

 

Please look at Overall FAQs for QUADSPI/OCTOSPI/HSPI/XSPI article. This article provides some external memories tips and tricks.

KDJEM1_0-1746626223777.png

 

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.

Hi, I make sure to run HAL_QSPI_Abort(&hqspi); before performing other operations, but the state error persists.

KDJEM.1
ST Employee

Hi @Priyank,

 

To clarify my last reply.

"Writing to QSPI Memory Mapped Mode

I am trying to debug some functions to write to the memory mapped QSPI."  

->The memory mapped mode is only suitable for read operation (en.STM32F7_Memory_QuadSPI.pdf), so you cannot made a write operation in memory mapped mode.

KDJEM1_1-1746630074784.png

 

KDJEM1_0-1746629254634.png

Are you switching to indirect mode for write operation?

Which STM32F7 MCU are you using? Could you share your project?

I recommend you to look at BSP example. 

This example provides of how to write, read and buffers compare for external flash memory using QSPI communication. For the QSPI test, one of the following flags must be defined in the preprocessor:

- USE_STM32746G_DISCO_REVC03 : Board contains the W25Q128J QSPI component.

- USE_STM32746G_DISCO : Board contains the N25Q128A QSPI component.(Defined by default)

 

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.

I don't know, some of the HAL libraries are a bit broken. Check you're working with most current.

Check the QSPI Instance contents in this condition, check that of the Peripheral itself too.

Dump these for inspection.

You should be able to write into the Instance State, and also abort the peripheral directly thru it's registers, see HAL_QSPI_Abort() source.

It could also be that it doesn't see the Peripheral in an active state, ie already aborted, or this library is not fully supporting or buggy.

Again, you don't present enough info to understand exactly what's happening, and I'm not investing the time to replicate

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

I was able to find a solution,

    __HAL_RCC_QSPI_FORCE_RESET();
    __HAL_RCC_QSPI_RELEASE_RESET();
    __HAL_RCC_QSPI_CLK_ENABLE();
    HAL_QSPI_Abort(&hqspi);

thank you