cancel
Showing results for 
Search instead for 
Did you mean: 

Writing and reading to external NORFlash using QuadSPI on STM32H743 mcu and successfully test erase, write, and read the flash a few days ago but now only read works. What could cause the erase and write command to not fail but not work either?

PFlor.2
Senior

A few days ago I successfully tested erasing the NORFlash as entire chip erase, block erase, and sector erase. I also was able to write a string to Flash and read the string back out of Flash into a buffer. After working on other development I came back and tested the QSPI again and now I cannot erase or write but can still read out of Flash the test string that was written several days ago. I'm using the exact same code as the first test, trying to just erase and read and get the same string so proved it's not erasing also try to write a different test string and still get the old string when I read. Also during the initial test it would take a little time for a full chip erase and now it just goes through quickly also indicating an erase is not happening. I do have MPU setup for the the 0x90000000 Flash address as well for MPU_PRIVELEDGED_DEFAULT but have access set for ALL_ACCESS so thought this was ok.

22 REPLIES 22

I'll be sure to clear the sCommand before each use then. Datasheet indicates I should be able to write to status register 2, and as I mentioned this was all working before. I've contacted Winbond tech support for some answers as to why this CMP bit is being set before I ever write to it after clearing the CMP bit. In the QSPI initialization I'm reading status register 2 before writing to it to set the QE bit and the CMP bit is already set before it is written to. Don't understand the SFDP register, will have to investigate that more, the datasheet didn't make sense to me.

Amazing! Initializing the sCommand structure in every function did in fact resolve the issue! CMP bit no longer being set.

How do we initialize the sCommand? Can you give an example code please?