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.

Linux/AM5728: How to transfer data via DMA from RAM to RAM?

Part Number: AM5728

Tool/software: Linux

Hi Everyone,

Is there any example for DMA data transfer from RAM to RAM in Linux user sapce?

I am using AM57xx EVM.

Regards,

Snehal

  • Hi,

    At the moment I don't have a ready example to provide. Could please describe the data that you want to move? For example how was and who owns the memory allocated? Was the memory allocated from user space or kernel space? Could you please indicate which TI SDK that are you using ?

    Best Regards,
    Schuyler
  • Hi Schuyler,

    I am using ti-processor-sdk-linux-am57xx-evm-04.03.00.05.

    Currently, I want to move 1KBytes of locally allocated data buffer from userspace to DDR-SDRAM using DMA and then want to read back the same DDR-SDRAM memory location using DMA on ARM A15

    Finally, I will use this test code to work with shared memory between A15 & DSP1 on AM57xx-EVM for interrupt between two cores I will use messageQ and actual data transfer will happen using DMA on both sides, A15 as well as on DSP.

    On DSP side standalone edma3-lld example is working, which is writing and reading RAM memory using DMA.

    Regards,
    Snehal
  • Hi Schuyler,

    Could you please give some pointer to start DMA implementation on A15 for RAM to RAM (memory to memory) data transfer.

    Regards,
    Sneahl
  • Dear Schuyler,

    Would you please help or connect with the right Engineer who can help? Are you looking for any further specific information? 

    Really appreciate it!

  • Hi,

    I would have responded yesterday but there was a server upgrade performed over the weekend to which there were lingering after effects and I was not able to log into the e2e forums.

    I am not sure I am following the example given since the question for me is if the locally allocated buffer should already be in DDR. That is assuming though a malloc call was used, is this correct?

    Currently from what I have been able to research direct access to EDMA from a user space application is not supported. There is the IPC mechanism but it looks like you are already using this with messageQ. Back to the buffer allocation question, are you using CMEM to allocate the buffer?

    Best Regards,
    Schuyler
  • Hi Schuyler,

    Thanks for your response. Let me clarify what exactly we are trying to achieve here.

    There would be huge volume of data on A15 side which needs to be passed to DSP for algo processing and post-processed data will be returned back to A15 for further actions/transfer-to-external-world.

    Obviously, messageQ would not be ideal to pass huge chunk of data across the cores, so the general thought is,

       1) to use internal memory for algo processing and

       2) DMA processed data to SDRAM/OCM

       3) access the post processed data through DMA for actions/transfer-to-external-world

    According to me this must be a very fundamental architecture. Please educate me if my understanding is not correct.

    Do you have an example or guide us on how to do it and use the DMAs? If you think a phone call would save time, I would be more than happy. 

    Really appreciate your time.

    Best,

    Raj

  • Hi Raj,

    If you are trying to share data between the A15 and the DSP DMAing is not necessary. The CMEM pool that is mentioned earlier is a memory pool  in DDR that is configurable shareable between the A15 and the DSP.  This pool alleviates the need to DMA between memory. Once the buffers have the data the pointers can be exchanged between the processors.  

    There are some video processing examples provided in the SDK that uses the A15 and DSP, these use open source packages such as openCL and openCV. While these example may not be directly applicable to your needs some of the components used for data usage might be.

    Please take a look at these links and see if the components used might suit your needs:

    Video Examples

    CMEM

    openCL

    Best Regards,

    Schuyler

  • Hi Schuyler,

    We tried using cmem, if I use the memory allocated through CMEM fom DSP, I am observing kernel crash.

    How to use this memory as shared between DSP and ARM?

    Is there any configurations which I am supposed to do from DSP end to accomplish this?

    Thanks,

    Janardan

  • Hi Janardan,

    I recommend you to refer to the simple_buffer_example inside the Processor SDK Linux example-applications/big-data-ipc-demo-linux-01.02.00.00/host_linux folder

    Documentation on the example can be found in below link -
    software-dl.ti.com/.../Examples_and_Demonstrations.html

    Regards,
    Manisha