cancel
Showing results for 
Search instead for 
Did you mean: 

U599 + W25Q64 Flash QUADSPI External Loader Errors

Hareesh_S
Associate III

Referring to AN5050 as well as an online guide for creating a QuadSPI loader for a W25Q32 flash IC, I have written code for a W25Q64 flash IC that I am interfacing in QuadSPI mode using the OctoSPI peripheral on the U599.

When I try reading the flash address in cubeprogrammer I get the following error

Error: Data read failed

Verbose level 3 does not log anything else relevant to the error.

When I try fully erasing the IC as well, I get the error - 
Error: Mass erase operation failed.Please verify flash protection

I have attached my code below, could someone assist me in identifying the error in the same?
Thank you

5 REPLIES 5

If the Read fails it suggests that the Init() and Memory Mapping isn't working.

The log should show the PC side interaction, for the STM32 side you'd need to instrument and output diagnostics through an available UART. You could also debug the code in application space prior to integration, or via a framework that calls the loader functions.

Here's a loader for your pin configuration.

https://github.com/cturvey/stm32extldr/blob/main/u5_w25q64/README.md

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

Hello,

Yes, this was my assumption as well, that memory mapped mode or Init in general was not working as intended, but chip erase not working as well threw me off. I will try debugging my code in an application

And thank you for sharing a loader for my configuration, it is working as expected on my end, so until I am able to figure out and resolve the bugs in my code, I can test out my application with this.

I do get a warning though - 
Warning: The core is locked up
Is this something I should be concerned about, or is it expected? What does it mean in general?

Much thanks again!

KDJEM.1
ST Employee

Hello @Hareesh_S ,

 

Could you please check the OCTOSPI configuration.

The W25Q64FV memory has a 64Mbit/8Mbyte size. So, you need to configure Device Size in STM32CubeMx at 23 as mentioned in AN5050. 

Also, it is recommended to enable Sample shifting (SSHT) in STR mode and disabled in DTR mode. And for Delay hold quarter cycle (DHQC) enabled in DTR mode and disabled in STR mode.

May these resources can help you to check your configuration:

I hope this help you to solve your issue.

 

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,

Thank you for the input,  I was referring to the QSPI loader series on ST's YouTube page and took the flash size calculation from there. Just to clarify, the device size calculation is different for QSPI and OSPI peripherals, correct?

Hareesh_S_0-1728628296277.png

Regarding DTR mode, I am not using DTR in any of my QSPI messaging. I did not consider SSHT or DHQC to reduce the potential variables as I was not familiar with their effect - I will look into understanding the same and using them as recommended.

And thank you for the resource links. I will go through them this weekend

Hello @Hareesh_S ,

 

I hope these resources can help you.

Yes you are right.

About the QUADSPI configuration in STM32CubeMX, the Flash Size= FSIZE when FSIZE is calculated according number of bytes in Flash memory = 2^[FSIZE+1].

About the OCTOSPI configuration in STM32CubeMX, the Device Size defines the memory size in number of byte. So, number of bytes in Flash memory = 2^[Device Size] =  2^[DEVSIZE+1].

 

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.