AnsweredAssumed Answered

STM32F4: ST Example SPI Not Functioning - Sector Erase

Question asked by roofie01 on Oct 13, 2015
Latest reply on Oct 13, 2015 by roofie01
The example provided by ST for SPI flash programming has a function called sFLASH_EraseSector
However, it does not seem to appears to hang without ever coming back. I'm using the exact files as provided in spi_flash.c, and spi_flash.h
I can write and read, but that's not consistent. For example, if I write some bytes at address 0x70000 once, it reads ok.
When I run it a second time, it returns junk.
Then, I run the call to sFLASH_EraseSector, and although it doesn't return, I terminate the debugger. Then, I comment out the call to sFLASH_EraseSector, run it again, and it reads and writes OK, returning the right string.

Can anyone who's used this device (M25P), on an STM32F405, provide any suggestions as to why this is happening? What would cause this? Why the call to sFLASH_EraseSector doesn't return, but seems to work when run and force terminated?