Hello,
I'm currently DMA'ing in data from an SPI interface into L2 (ping-pong buffering). Because of size limitations of L2, an additional DMA transfer is used to DMA data out to a large mDDR-based circular buffer. Upon completion of the DMA transfer out to mDDR, the cache is invalidated for that specific block that has been transferred. The user application can then grab the next block from mDDR when it is ready to process using a straight up memcpy.
My issue is with the cache_inv for mDDR-base blocks. I call cache_inv as follows:
Cache_inv(&rxBuf[rxIndex],BLOCK_SIZE_IN_BYTES,Cache_Type_ALLD,true);
By calling the Cache_inv function with true, I expect the Cache_inv to block until the cache has been invalidated for that particular address range. In fact, it almost immediately returns (<1us delay), and examining the large mDDR buffer using an emulator I can see old data in the buffer, which means that the cache_inv call is not finished when returning.
For now I have a workaround - I basically DMA a block back into L2 working memory when needed by the application. This works because of L2 cache memory snooping on DMA transfers into L2.
Has anyone experienced similar issues? Am I using the Cache API wrong?
I've checked the Cache MMR bits (we have mDDR set as cached). I'm using SYS/BIOS 6.40.
Thanks