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.

VICP error in memAlloc()

Hello.

I am applying VICP 3.3 library to my DSP application. My DSP application is based on "call_dsplib" example. I use Linux DVSDK 2.00 for EVM DM6446.

I take a "sobel" VICP example and embed it to my DSP application.

I have an error here (it is a beginning part of procFunction() function):

if((SRC = (char*) memAlloc( 2* WIDTH*HEIGHT + 2*4*WIDTH*HEIGHT) )==NULL) {

......

}

This condition is always true, ie. the mamAlloc can not be implemented correctly.

What can I do now? I take an example and almost didn't modify it.

Thank you.

  • Does anybody have an example of usage VICP under DSPLink application ?

    Providing is appreciate)

     

    I linked following library to my project:

    dmcsl644x_bios.lib

     

    After that I add to my project the following files (according to the VICP user's guide):

    bios_edma3_drv_sample_dm644x_cfg.c

    vicp_edma3_drv_sample_dm644x_cfg.c

    And I have a following compilation errors:

    Compiling Debug...

    <Linking>

    >>   error: symbol _VICP_EDMA3_ccErrorInt is defined multiple times:

                Debug/dsp_interface.obj and vicp_edma3_dm644x_cfg.obj

                (/home/roman/dvsdk_2_00_00_22/VICP/lib/dm6446/dmcsl644x_bios.lib)

    >>   error: symbol _vicpInstInitConfig is defined multiple times:

                Debug/dsp_interface.obj and vicp_edma3_dm644x_cfg.obj

                (/home/roman/dvsdk_2_00_00_22/VICP/lib/dm6446/dmcsl644x_bios.lib)

    >>   error: symbol _VICP_EDMA3_hwInt is defined multiple times:

                Debug/dsp_interface.obj and vicp_edma3_dm644x_cfg.obj

                (/home/roman/dvsdk_2_00_00_22/VICP/lib/dm6446/dmcsl644x_bios.lib)

    >>   error: symbol _VICP_EDMA3_numEdma3Tc is defined multiple times:

                Debug/dsp_interface.obj and vicp_edma3_dm644x_cfg.obj

                (/home/roman/dvsdk_2_00_00_22/VICP/lib/dm6446/dmcsl644x_bios.lib)

    >>   error: symbol _VICP_EDMA3_numEdma3EvtQue is defined multiple times:

                Debug/dsp_interface.obj and vicp_edma3_dm644x_cfg.obj

                (/home/roman/dvsdk_2_00_00_22/VICP/lib/dm6446/dmcsl644x_bios.lib)

    >>   error: symbol _VICP_EDMA3_tcErrorInt is defined multiple times:

                Debug/dsp_interface.obj and vicp_edma3_dm644x_cfg.obj

                (/home/roman/dvsdk_2_00_00_22/VICP/lib/dm6446/dmcsl644x_bios.lib)

    >>   error: symbol _vicpEdma3GblCfgParams is defined multiple times:

                Debug/dsp_interface.obj and vicp_edma3_dm644x_cfg.obj

                (/home/roman/dvsdk_2_00_00_22/VICP/lib/dm6446/dmcsl644x_bios.lib)

    >>   error: symbol _VICP_EDMA3_ccXferCompInt is defined multiple times:

                Debug/dsp_interface.obj and vicp_edma3_dm644x_cfg.obj

                (/home/roman/dvsdk_2_00_00_22/VICP/lib/dm6446/dmcsl644x_bios.lib)

     

    What's wrong with that?

    I tried to unlink library dmcsl644x_bios.lib, but there are another errors:

     

    >>   error: relocation overflow occurred at address 0x0000192c in section '.text' of input file 'dmaSetup.obj (/home/roman/dvsdk_2_00_00_22/VICP/lib/dm6446/IP_run644x.lib)'. The 29-bit PC-relative displacement 470263296 at this location is too large to fit into the 21-bit PC-Relative field; the destination address is too far away from the instruction. You may need to add a mask to the assembly instruction or use other target specific assembly features if you really only need the lowest 21 bits of this symbol. Please see the section on Relocation in the Assembly User's Guide.

    ................(something the same)

    ................(something the same)

    How can I fix It?

    Thank you.

     

  • Hello Roman,

    You should keep linking dmcsl644x_bios.lib . Regarding the symbols multipe defined errors, I don't know why these symbols would be defined multiple times. Can you attach the file dsp_interface.c ? Thanks.

    Victor

     

  • The function memAlloc is a wrapper function around the BIOS function MEM_alloc(), implemented in file platform_support64xbios.c:

    void *memAlloc(Uint32 size){

    /* 128-bytes boundary and size alignment because the memory allocated will be cached */

     return (MEM_alloc(DDR2, ((size+127)>>7)<<7, 128)); 

    }

     

    As you see it uses heap ID DDR2. The amount of memory reserved for this heap would be defined in the dm6446.tcf file provided with the VICP example code:

    bios.MEM.instance("DDR2").createHeap = 1;

    bios.MEM.instance("DDR2").heapSize = 0x00800000;

     

    You might be getting error because the call_dsplib example uses its own tcf file: dsplib_server.tcf and doesn't have the memory segment DDR2 defined. Instead it uses a  segment called "DDR". I suggest then that you modify platform_support64xbios.c and replace any occurence of DDR2 with DDR and see whether the error disappears.

     

    Victor

  • In the dec 18 post, it seems like you managed to build a VICP application based on call_dsplib although you got memAlloc errors during execution. But in your dec 20 post, you are reporting that you don't manage to build anymore. I am wondering what is the difference in your build procedure between the two dates.

    I don't know anybody who has ever tried to build VICP application with DSP link application so your experience and its resolution will be fairly valuable to the community. Thanks.

    Victor

  • Thank you, Victor.

    I will work on all your suggestions. But now I answer your last post.

    At Dec 18 I was compiling project with usual dsp_makefile but I added the following libs:

    -ldmcsl644x_bios.lib

    -lGPP_imgproc644x.lib

    -limgproc644x.lib

    -limx644x.lib

    -lIP_run644x.lib

    -ledma3_drv_bios.lib

    -ledma3_drv_bios_i.lib

    -ledma3_rm_bios.lib

    -ledma3_rm_bios_i.lib

     

    Before that I just put all the sources of "sobel" example into dsp_interface.c file. Also I put in there content of "platform_support64xbios.c" and "sobelTestParams.c" files. Also I attached VICP/test/inc/platform_support.h and VICP/test/inc/testParams.h to dsp_interface.c file. Also I commented all exit(-1) and printf() entries in sobel sources (because compiler doesn't like them:)  ). As I remember this is it.

    After these manipulations it compiles OK but error occurs ("memAlloc==NULL") during implementation.

     

    At Dec 20 post I was using bios_edma3_drv_sample_dm644x_cfg.c and vicp_edma3_drv_sample_dm644x_cfg.c also. And the compilation error (Dec 20 post) occurs.

    Thats it about your last question.

     

    Thank you, Victor. I'm going to apply your other suggestions and I will write the results after while.

     

     

  • Victor,

    My dsp_server.tcf defines only DDR2 memory segment (like MEMAlloc() uses). So it's not necessary to replace any occurence of DDR2 with DDR in platform_support64xbios.c.

    Should I ever use bios_edma3_drv_sample_dm644x_cfg.c,  vicp_edma3_drv_sample_dm644x_cfg.c and vicp_edma3_support.c in my code? These files cause an compilation errors I described before. Or I should not use them?

    Thank you.

  • Dear, Victor.

    Can you help me with VICP lib adaptation for DSPLink project.

    I still can't make anything usefull :(

    Thank you.

  • Hello Roman,

     

    You don't need to include bios_edma3_drv_sample_dm644x_cfg.c and vicp_edma3_drv_sample_dm644x_cfg.c in your project as these files are already part of edma3_drv_bios.lib and dmcsl644x_bios.lib respectively. Probably that's why you are getting linker error. However if you use a CCS project to build, the linker somehow knows to pick up the files contained in the project instead of the library and doesn't throw any error. If you need to set a different EDMA configuration than the default one, you will need to resolve that linking issue but for now, that's OK, don't include these _cfg.c files . You can refer to the following wiki page: http://processors.wiki.ti.com/index.php/VICPLIB_DM644x_DM64x_FAQ for information on EDMA configuration.

    Now back to the memAlloc() issue, do you know if the size of DDR2 memory segment is big enough for the 2* WIDTH*HEIGHT + 2*4*WIDTH*HEIGHT bytes to allocate ? 

    regards,


    Victor