Skip to main content
Explorer II
August 22, 2024
Solved

Code is stuck in XSPI_WaitFlagStateUntilTimeout

  • August 22, 2024
  • 2 replies
  • 1327 views

I am currently trying to write to an external Flash via QSPI (SST26VF064B). So far I have been able to successfully configure the chip as required and I have also been able to read some configuration registers in the flash so I know I can communicate the chip. However, when I try to write or read the memory, my code gets stuck in the function XSPI_WaitFlagStateUntilTimeout and the transfer error flag in the XSPI_SR is set. The reference manual says this flag is set if an invalid address is accessed in indirect mode but I am writing to the address 0x010000 which is a valid address. How can I fix this issue?

Here is a screenshot of my read function

Screenshot 2024-08-22 at 1.45.39 AM.png

 

 

    This topic has been closed for replies.
    Best answer by Kwame

    I was able to get it to work. It turns out that the size of the device specified was 64 bits so any address outside the range causes a transfer error.

    2 replies

    Technical Moderator
    August 23, 2024

    Hello @Kwame ,

     

    Could you please give more detail about the issue:

    Which STM32H7 are using? Are using STM32H7S?

    Is the issue encountering for memory mapped mode or indirect mode?

    Could you please take a look at the errata sheet .

    May be XSPI example can help you.

     

    Thank you.

    Kaouthar

     

     

     

    KwameAuthor
    Explorer II
    August 23, 2024

    Thanks for your response. I am trying to use my own drivers with the external loader project on the STM32H7R7. Is there any documentation for this? The only thing i can find is this https://wiki.st.com/stm32mcu/wiki/Getting_started_with_External_memory_Manager_and_External_memory_loader which uses the NOR SFDP driver.

    Technical Moderator
    August 23, 2024

    Hi @Kwame ,

     

    Glad to know that the issue is solved and thank you for sharing the solution.

    I think you can use the STM32CubeMx solution to customize and generate the external loaders based on two Middlewares: "STM32_ExtMem_Manager" & "STM32_ExtMem_Loader" that are integrated in CubeMX in order to develop the external memory loaders using CubeMX.
    This will allow you to develop your external loaders in all IDEs (Keil MDK-ARM, IAR & CubeIDE) for all the same IDEs.

    You can find the template under this new package STM32CubeH7RS and used it for your product:

    "STM32Cube_FW_H7RS_V1.0.0\Projects\STM32H7S78-DK\Templates\Template_XIP".

    Note that this solution supports NOR, SDcard & PSRAM memories.

    If you encounter any problems concerning the development of the external loader, please do not hesitate to create a new thread.

     

    Thank you.

    Kaouthar

    KwameAuthorAnswer
    Explorer II
    August 23, 2024

    I was able to get it to work. It turns out that the size of the device specified was 64 bits so any address outside the range causes a transfer error.