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.

A simple example & tutorial for DM6437 EVM

Other Parts Discussed in Thread: TVP5146

I think there is no simple and good example for DM6437 EVM. I have searched all TI documents regarding to this module and I fund these:

1-Day workshop for  DM6437 EVM.

Spraap3a

Beta_DM6437_Edge_Detection_Software_DM6437DemoImage_r1546

All the above files are full of unnecessary codes and functions which makes a beginner confused. A beginner needs a simple code to get a frame from input unit (VPFE & FVID), store it in DDR2, do a simple image processing function on it like IMG_erode_bin, and send out the frame (VPBE). A beginner needs a step by step tutorial like this:

1. Start a new project in CCS V3.3.

2. Create the main.c file with and includes necessaries libraries and header files like fvid_evmDM6437.h 

3. small description for each line and further reading documents suggestion.

That's all

I think this tutorial  helps developers to understand how to deal with this product much faster.

  • Hi hesam qaydi,

    Thank you for your feedback, it is much appreciated and will help us to improve our products, as well as help others who may encounter the same hurdle that you have.

    I'm wondering which software components you are working with.  Are you working with a product called an "SDK" or some such that was shipped to you with your DM6437?  If so, do you know what version?

    Steve

  • Dear Steve

    Thank you for your prompt reply.

    Actually TI is a leading technology company in the world and its products are always well documented.

    I still have not purchased this board. I’ve been still considering its technical details. I want to be sure if I could work with this product or not.

    I don’t use any SDK. I want to develop the codes myself. I would like to have full control of what’s going on the codes. I have downloaded many documents for this EVM. Two of them were interesting, 1-Day workshop, and Spraa3a. Spraa3a contains VPFE_tvp5146 example. I think the main file is test.c

    I have start considering its codes line by line to learn how I should change this example. I see some header files like <gio.h>, "psp_vpfe.h",  "fvid.h" . Also I see some functions like FVID_create, beinitParams.id. I searched a lot to find a user guide for these header files and functions but it seems I am not walking in the correct path.

    I understand the 1-Day workshop very well. I also understand the test.c file in somehow. I think one tutorial is still missing, one document that consist from (02) IO and Drivers.ppt file and VPFE_tvp5146_example. A simple image processing scenario like this:

    1. Get a frame from the composite port. For simplicity we imaging the camera output is monochrome.  And there is no need to convert RGB to Monochrome. (VPFE)
    2. Do a simple image processing function like thresholding to convert the monochrome frame to a black and white frame.
    3. Put the frame in an array for further processing.
    4. Send out the frame (VPBE)

    I think this simple help can do a lot for beginners like me.

    Hesam

  • Hesam,

    Great that you're taking such a hands on approach.  However, I'd like to mention that most all of our code now days is open source, so you still may find an SDK useful as a lot of work will have already been done for you.  I'll ask that your post get moved to the DaVinci forums, as I think they'll be able to work with you better regarding spraa3a, as well as give you tips to help accelerate your work on the DM6437.

    Steve

  • Hesam,

    I have moved this thread over to the DM643x forum in hopes that you will receive further guidance there.

    Dave

  • Thanks Dave & Steve

    Here is a simple example from spraa3a.zip file. In this example a frame is buffered from ccdc channel and then displayed by vid0 channel. I just would like to know how  I can convert this frame to a monochrome frame, then convert it to the binary image(Black&White) and then pass the result to the vid0 channel for displaying:

    file: test.c:

    #include <std.h>
    #include <gio.h>
    #include <log.h>

    #include "psp_vpfe.h"
    #include "psp_vpbe.h"
    #include "fvid.h"
    #include "psp_tvp5146_extVidDecoder.h"

    #include <soc.h>
    #include <cslr_ccdc.h>

    #define NO_OF_BUFFERS (2u)

    // Global Variable Defined
    static PSP_VPSSSurfaceParams *ccdcAllocFB[NO_OF_BUFFERS]={NULL};
    static PSP_VPSSSurfaceParams *vidAllocFB[NO_OF_BUFFERS] ={NULL};

    static FVID_Handle ccdcHandle;
    static FVID_Handle vid0Handle;
    static FVID_Handle vencHandle;

    static PSP_VPFE_TVP5146_ConfigParams tvp5146Params = {
    TRUE, // enable656Sync
    PSP_VPFE_TVP5146_FORMAT_COMPOSITE, // format
    PSP_VPFE_TVP5146_MODE_AUTO // mode
    };

    static PSP_VPFECcdcConfigParams ccdcParams = {
    PSP_VPFE_CCDC_YCBCR_8, // dataFlow
    PSP_VPSS_FRAME_MODE, // ffMode
    480, // height
    720, // width
    (720 *2), // pitch
    0, // horzStartPix
    0, // vertStartPix
    NULL, // appCallback
    {
    PSP_VPFE_TVP5146_Open, // extVD Fxn
    PSP_VPFE_TVP5146_Close,
    PSP_VPFE_TVP5146_Control,
    },
    0 //segId
    };

    static PSP_VPBEOsdConfigParams vid0Params = {
    PSP_VPSS_FRAME_MODE, // ffmode
    PSP_VPSS_BITS16, // bitsPerPixel
    PSP_VPBE_YCbCr422, // colorFormat
    (720 * (16/8u)), // pitch
    0, // leftMargin
    0, // topMargin
    720, // width
    480, // height
    0, // segId
    PSP_VPBE_ZOOM_IDENTITY, // hScaling
    PSP_VPBE_ZOOM_IDENTITY, // vScaling
    PSP_VPBE_EXP_IDENTITY, // hExpansion
    PSP_VPBE_EXP_IDENTITY, // vExpansion
    NULL // appCallback
    };

    static PSP_VPBEVencConfigParams vencParams = {
    PSP_VPBE_DISPLAY_NTSC_INTERLACED_COMPOSITE // Display Standard
    };


    void start_vpss_test() {
    PSP_VPBEChannelParams beinitParams;
    PSP_VPFEChannelParams feinitParams;
    GIO_Attrs gioAttrs = GIO_ATTRS;
    PSP_VPSSSurfaceParams *FBAddr = NULL;
    Uint32 i = 0;
    Uint32 numOfIterations = 10000;

    // Create ccdc channel
    feinitParams.id = PSP_VPFE_CCDC;
    feinitParams.params = (PSP_VPFECcdcConfigParams*)&ccdcParams;
    ccdcHandle = FVID_create( "/VPFE0", IOM_INOUT, NULL, &feinitParams,
    &gioAttrs);
    if ( NULL == ccdcHandle) {
    return;
    }

    // Configure the TVP5146 video decoder
    if( FVID_control( ccdcHandle,
    VPFE_ExtVD_BASE + PSP_VPSS_EXT_VIDEO_DECODER_CONFIG,
    &tvp5146Params) != IOM_COMPLETED ) {
    return;
    } else {
    for ( i=0; i < NO_OF_BUFFERS; i++ ) {
    if ( IOM_COMPLETED == FVID_alloc( ccdcHandle, &ccdcAllocFB[i] ) ) {
    if ( IOM_COMPLETED != FVID_queue(ccdcHandle, ccdcAllocFB[i] ) ) {
    return;
    }
    }
    }
    }

    // Create video channel
    beinitParams.id = PSP_VPBE_VIDEO_0;
    beinitParams.params = (PSP_VPBEOsdConfigParams*)&vid0Params;
    vid0Handle = FVID_create( "/VPBE0", IOM_INOUT,NULL, &beinitParams,
    &gioAttrs );
    if ( NULL == vid0Handle ) {
    return;
    } else {
    for ( i=0; i<NO_OF_BUFFERS; i++ ) {
    if ( IOM_COMPLETED == FVID_alloc( vid0Handle, &vidAllocFB[i] ) ) {
    if ( IOM_COMPLETED != FVID_queue( vid0Handle, vidAllocFB[i]) ) {
    return;
    }
    }
    }
    }

    // Create venc channel
    beinitParams.id = PSP_VPBE_VENC;
    beinitParams.params = (PSP_VPBEVencConfigParams *)&vencParams;
    vencHandle = FVID_create( "/VPBE0", IOM_INOUT, NULL, &beinitParams,
    &gioAttrs);
    if ( NULL == vencHandle ) {
    return;
    }

    FVID_alloc( ccdcHandle, &FBAddr );

    for( i = 0; i < numOfIterations; i++ ) {
    if ( IOM_COMPLETED != FVID_exchange( ccdcHandle, &FBAddr ) ) {
    return;
    }

    if ( IOM_COMPLETED != FVID_exchange( vid0Handle, &FBAddr ) ) {
    return;
    }
    }

    FVID_free(vid0Handle, FBAddr);

    // Free Memory Buffers
    for( i=0; i< NO_OF_BUFFERS; i++ ) {
    FVID_free( ccdcHandle, ccdcAllocFB[i] );
    FVID_free( vid0Handle, vidAllocFB[i] );
    }

    // Delete Channels
    FVID_delete( ccdcHandle );
    FVID_delete( vid0Handle );
    FVID_delete( vencHandle );

    return;
    }

    • I cant agree with you any more