This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

VPIF DMA to Shared Memory

Using C6748. I have L1D & L1P as cache, L2 as Ram. Using VPIF to DMA camera data into shared memory. No other DMA is used in the application. This works OK normally. However if in another part of the code I programmatically read elements of the same area of shared memory, not during the VPIF DMA time, it seems on the next camera frame camera data can get corrupted. It looks like small blocks of the shared memory the VPIF is writing to are not getting updated with new camera data. On a frame where I did not read that shared memory before the DMA, the camera data is OK.

I have seen in the forum & chip errata comments about DMA issues when using L2. Just wondering if this could also be an issue with shared memory, and the cause of the problem?

Roger

 

  • Roger,

    Specifically, what are you referring to as "shared memory"? What hex address, for example?

    Your issue sounds like a cache coherency problem. If the DSP cache has a cache line from some memory outside of L2, and the VPIF DMA's data into that memory, the cache controller will not know about it and the cache controller can then corrupt that memory if it evicts a cache line.

    You have to follow the cache coherency guidelines in the documentation and training manuals to avoid this situation, if this is the cause of your problem.

    Sorry that I cannot comment on "forum & chip errata comments" without knowing what they are.

    Regards,
    RandyP

  • Randy,

    Thanks for your reply. Your analysis is correct, I could see position of the bad data move around as I moved the location of memory I was reading from. I added a global writeback & invalidate to L1D before acquisition into shared mem at 0x80000000 which fixed it, L2 is ram not cache in this application. Though I gave up trying to use the function from the CSLR, or I should say the documentation to get it available into CCS5 was just too much! & just set the bit myself. Later I'll change it so the camera DMAs to L2 which would also have been OK and more effective anyway I think.

    Perhaps I ought to spend more time reading the manuals, or in this case remembering what I read ages ago!

    Thanks   ---   Roger