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.

DM642/648 MEM_alloc Videoport Cache problem

Dear DaVinci Group,

There was a big surprise for me today. MEM_alloc writes something behind the memory it allocates. If the memSize is not modulo cacheLineSize and the memory is filled through an EDMA from a Videoport for example MEM_allocs information can be overwritten when the last cache line is updated. This can lead to really strange behaviour.

I opened a thread in the DSP BIOS forum here. I normally just follow this forum, so I thought to post a link here.

I think its good to know that you have to care about the memory after the block MEM_alloc gives you.

bye,

Thomas

 

  • Thanks for cross-referencing.

    -Brad

  • Hi,

    a summary...

    when allocating memory that is filled by EDMA (for example from a Videoport on DM642, 648...) you have to do some quite important things:

    - keep in mind that MEM_alloc writes something important directly after the allocated memory (from the DSP - so into the Cache - not into the memory!) and keep in mind that EDMA writes into the memory (so 'behind the cache')

    - allocate it modulo 128 (L2 cacheline size)

    - allocate its size at least modulo 128 (padding to at least L2 cacheline size). better allocate some more, fill it whith some known pattern and check if it was not overwritten. If VP is setup wrong it will otherwise damage MEM_allocs info resulting in very strange crashes.

    - writeback/invalidate cache after allocation

    bye,

    Thomas