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?
I wonder which DSP do you use ?
Actually, i am now doing a code flash task. But i stucked by the internal flash erase process. I want to know where did you find the Flash_ReadWrite example ? Could you please share some your idea or code for the erase and write flash process ?
thanks in advance
BTW, I use ADSP-SC587
I am not sure for ADSP-SC587, but I think you can check on ADSP-SC5XX Board Support Package:
There should be example code for your chip. If you look into ADI's API code for flash erase/read/write along with hardware reference manual, it will give you an idea how it works.