Post Go back to editing

SPI2 Internal Flash Reading after Writing

Hi,

I implemented non-API flash erase, write, and read functions since API uses blocking method. Mostly I followed procedures by referring the Flash_ReadWrite example project. The main difference is I removed while loop to wait register value changing, so basically the procedure is the same as the example. 

Erasing and writing flash work okay. The problem I have is that read written data right after writing. I had to give more than 8 us delay after writing (actually sync cache) to read written data correctly. 

I also measured the elapsed time between writing data and reading for Flash_ReadWrite example project to compare my result. It was about 2 us, so it seems that no delay like 8 us is needed. All time was measured by reading the CCSTEP register value while debugging.

What could cause this differences?

Thanks.



Edited subject to give more clear idea.
[edited by: justinr at 10:08 PM (GMT -4) on 29 Aug 2018]