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.

MCU-PLUS-SDK-AM273X: EDMA link transfer SDK example: superfluous cache writeback / invalidate ?

Part Number: MCU-PLUS-SDK-AM273X
Other Parts Discussed in Thread: AM2732

According to the C66x DSP Cache User Guide, DMA reads / writes to L2 memory trigger a cache coherency mechanism which makes invalidation / writeback superfluous when dealing with local (L2) memory.

In the MCU+ SDK (AM2732) EDMA link-transfer example, however, cache coherence is explicitly used:

  • Cache writeback is initially done on buffers after initialization by the core (cf. edma_link_transfer.c:136 in MCU+ SDK 8.5.0.24 link transfer EDMA example)
  • After the EDMA test transfer, cache invalidate is done on the buffer written by EDMA before checking the result (= reading from CORE) (cf. edma_link_transfer.c:223)

In the example, everything is allocated in DSS_L2 which means that the stack (including the buffers) are in L2 RAM. This seems to make these cache coherency operations superfluous.

I can see a number of reasons why the code would be written this way (if the code is copy pasted in a project using L3 for example), but since invalidation / writebacks tank performance in real applications, I wanted to make sure that these coherency operations are superfluous in this SDK example.

  • Hi ,

    1. In case of C66x DSP core, you are correct, the DMA read or DMA write operation will trigger cache coherency mechanism via snooping commands.

    2. But in case of ARM R5F, it has to be taken care of manually, thus you find the code explicitly handling cache writeback and invalidation.

    The code is written in that way to make sure it works for ARM R5F core as well as C66x DSP core, so yes for the case of C66x it would be unnecessary operation.

    Regards,

    Shaunak