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.

Saving data function

Hi friends,
    to save data, we will use C library function like fwrite(). does the low-level operation of this function fwrite() is implemented by DMA or EDMA engine?
if not, does TI provide other faster methods for saving data

  • Hello,

    For the EDMA driver description and API, see http://processors.wiki.ti.com/index.php/TI81XX_PSP_EDMA_Driver_User_Guide

    There is a sample test application here: http://processors.wiki.ti.com/index.php/EDMA_sample_test_application

    You can check there how the data is transferred and saved from the source to the destination.

    Regards,

    Pavel

  • Hi Pavel,
    thanks for your reply.

    After checking, it's an example about mem to mem inside kernel.

    Did you know how could I use it to software in application level (e.g. replace the function of fwrite(), write data into a file ) ?

  • The EDMA Driver APIs are available for use only in the kernel space. Here are links stated that you could add proprietary ioctl request to the dma driver to allow user space access to DMA resources (but I did not personally try this):

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/p/7700/30613.aspx#30613

    http://processors.wiki.ti.com/index.php/DM81xx_AM38xx_PCI_Express_Endpoint_Driver_User_Guide#Sample_Components

    EDMA Kernel Module

    This module is provided as a sample driver to access EDMA functionality from user spoace.

    Regards,

    Pavel

  • DVR RDK has EDMA APIs from user space. Pls refer OSA_dma APIs and /dvr_rdk/demos/mcfw_api_demos/mcfw_demo/demo_vcap_venc_vdec_vdis_bits_rdwr.c for example usage. Regarding your original question:

    As you are aware when you use fwrite the following sequence occurs

    1. user buffer ----(fwrite) ---> libc internal buffer (user space)

    2. After libc buffer is full (8K by default) libc internal buffer ----(write system call) ---> kernel buffer (kernel space)

    3. kernel buffer --- (may be copied again internally) --> Device (e.g. SATA) driver queue (kernel space)

    4. Device (e.g. SATA) driver queue --- DMA --> device (kernel space)

    The copies provide greater flexibility to the application hiding complexity related to alignment requirements and abstracts device specific details.

    Pls see article which explain this clearly. http://www.linuxjournal.com/article/6345?page=0,1

    Can you explain where you want to use DMA here ? Do you want to DMA to the HDD directly ? We dont have any reference code for this in DVR RDK. My understanding is you will have to have a custom file system to be able to do it.

  • Hi Badri,
    thanks for your reply.

    Do you want to DMA to the HDD directly ?
    - Yes.

    We dont have any reference code for this in DVR RDK.
    - I got it.

    My understanding is you will have to have a custom file system to be able to do it.
    - what do you mean here? could you describe more detail?