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.

prob with acpy3_start



Hi all ,

we are working on h264 dec we need to implement dma in it . i have modified example code of fastcopy accordingly to my need in  the nonalogorithm usageexample part  .when i call dman3_createchannels i am getting handle assiged to variable h but during the acpy3_start the params are not being set and when i went to acpy3 wait the program is going to infinite loop and never comes out.

 the code i have witten is as this i am calling a function from my proj which passes the source,destination addresses and also the other details like numelements and src element index etc  i had fastcopy proj as my dependent proj

the code i wrote is

void lumacopy(---_

{

idma3_channel Rec dmatab;

Int status;

acpy3_params p;

GT_set("*" = 01234567");  //dont know what GT_set actually does

fastcopy_dman3_config();

DMAN3_init();

ACPY3_init();

dmatab.numtransfers =1;

dma.numwaits =1;

dmatab.priority = idma3_priority_low;

dmatab.Protocol = &ACPY3_Protocol;

status = DMAN3_createchannels(0,&dmatab,1);

if (status == DMAN3_SOK ) {
h = dmaTab.handle;
ACPY3_activate(h);
}
else {
SYS_abort("Channel creeate failed. Status: %d\n", status);
}
p.transferType = ACPY3_2D1D;
p.dstAddr = (void *)lumablk;
p.srcAddr = (void *)srcptrq ;
p.elementSize = 20;
p.numElements = 16;
p.numFrames = 1;
p.srcElementIndex = 176;
p.srcFrameIndex = 1;
p.dstFrameIndex = 1;
p.waitId = 0;

ACPY3_configure(h, &p, 0);
ACPY3_start(h);

ACPY3_wait(h);
ACPY3_deactivate(h);
if ((status = DMAN3_freeChannels(&h, 1)) != DMAN3_SOK ) {
SYS_abort("DMAN3_freeChannels failed. Status: %d\n", status);
}
dman3_exit();

}


can some one please tell me the diff between the algoexample and non-algo example and can we not use non-algo example part or dman3_create channels
when we are having call from our algo . i have read in the document saying dman3_createchannels for non-algo users what does that mean
  • Hi Manoj,

    Are you using the non-BIOS fastcopy example to base your program on? If that's the case, can you check that the .sysmem section is being allocated in internal memory? ACPY3 needs internal memory for storing its copy of PaRam register values, since it uses the IDMA to copy them into the PaRam registers. If DMAN3.heapInternal (for BIOS case), or .sysmem (for non-BIOS case) is set incorrectly (to external memory), then the IDMA transfer will not succeed, hence the actual EDMA transfer never starts and this leads to a hang when ACPY3_wait() is called by the application. If you're not using BIOS, then just make sure your linker command file has the .sysmen in internal memory as in the following example:

        MEMORY {
            EXTMEM      : origin = 0x83f00000,    len = 0x0ffe00
            L1DSRAM     : origin = 0x11f04000,    len = 0xc000
        }

        SECTIONS
        {   
            .image          > EXTMEM
            .sysmem       > L1DSRAM
            .const            > EXTMEM
            .cinit             > EXTMEM
            .switch          > EXTMEM
            .stack           > EXTMEM
            .far              > EXTMEM
            .cio              > EXTMEM
            .text            > EXTMEM
        }

  • Hi janat ,

    yes i am using the non-bios fastcopy example for my prog .i have changed the sysmem to point to internal memory in the cmd file of my h264dec proj yet the problem persists.the  cmd file of my h264dec proj is like this

    EDMA3_BASE_   0X1C0000

    -l h264bp.cmd

    stack  0x3000

    heap  0xD00000

    MEMORY {
            ERAM      : origin = 0x83f00000,    len = 0xA000000
            UDRAM    : origin = 0x11f800000,    len = 0xD10000
        }

    SECTIOINS

    {

    UDRAM_INTEM:>UDRAM

    .TEXT  :>ERAM

    .CINIT :>ERAM

    .CIO :>ERAM

    .CONST :>ERAM

    .SWITCH :>ERAM

    .args :>ERAM

    .bss :>ERAM

    .bios :>ERAM

    .image :>ERAM

     

    .rtsconst :{-lrts64plus.lib(.const)}>ERAM

    .rts_sect :{-lrts64plus.lib(.text)} >ERAM

    .sysmem : align(0x100) >UDRAM              /*here i have changed from ERAM to UDRAM*/

    .stack     :fill = 0xcoffe align(0x800)>ERAM

    .input_buffer : align(0x100)>ERAM

    .display_buffer: align(0x100)>ERAM

    .ref_buffer :align(0x100)>ERAM

    .far:align(0x100)>ERAM

    }

    i have increased the udram to accomodate  my heap since i am getting compile errors that "udram is not sufficient" when i pointed sysmem to udram.  can i use the non-bios  example in my case since the main proj which i am building is in bios will it work or should i use bios example code of fast copy. i could not make any difference of both in the code. and if i have to use the bios example code how can i point DMAN3.heapinternal to internal memory

  • Hi Manoj,

    Could you please double check the address you have for UDRAM in your linker command file? It looks like there are too many digits.

    Thanks,

        Janet

  • Hi janet ,

    sorry for late reply i was out of station. ya the address for udram that i gave was 0x11800000 is that of the L2 . i have typed mistakely in the mail. i tried to give L1  address but thought that might not be sufficeint to accomodate my heap size .

  • Hi janet,

     i have changed my cmd file i have pointed  udram for L1 (0x11f04000) instead of L2(0x11800000) but the prob remained  and i think the prob was due to some offsets when i change the udram_init section to eram the transfer is taking place. but i have got 1 more prob now the function is not working at the other place i.e the same function  to transfer is not working  at other part of the code.the params are not being as before

  • Hi Manoj,

    Could you please verify whether or not the fastcopy_nobios example runs successfully? Then we can try to find differences. I think L2 should still be ok.

    Regards,

            Janet

     

  • Hi janet,

    ya the fastcopy code was running successfully. i have made some modifications to my code.now i have moved the following part of the code from my function to another function called at place  before any mallocs are done then dma is working and transfer is taking place. i think may be its looking for some offsets with the L1D  and due the mallocs which are also going to sysmem the offsets may be getting wrongly.

    part of code which i have moved to a new function:

    fastcopy_dman3_config();

    DMAN3_init();

    ACPY3_init();

    dmatab.numtransfers =1;

    dma.numwaits =1;

    dmatab.priority = idma3_priority_low;

    dmatab.Protocol = &ACPY3_Protocol;

    status = DMAN3_createchannels(0,&dmatab,1);

    if (status == DMAN3_SOK ) {
    h = dmaTab.handle;
    ACPY3_activate(h);
    }
    else {
    SYS_abort("Channel creeate failed. Status: %d\n", status);
    }



    thanks for your help

    regards,
    manoj
  • Hi Manoj,

    The fastcopy example has a file called "bios_rts.c", which defines the Memory functions needed by DMAN3 that are in BIOS. The non-BIOS fastcopy builds with the bios_rts.c to define these functions (the BIOS fastcopy doesn't need this file, of course). Are you using this file in your application? DMAN3 channels that use ACPY3 require memory aligned on 32 bytes for shadowing PaRam registers. The bios_rts.c contains a MEM_alloc() that supports alignment. If you are using your own MEM_alloc() (or MEM_calloc()) function that just calls malloc(), then this could be the issue. It sounds like it may have to do with alignment, since by moving your code around, you can get it to work.

    Regards,

            Janet