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.

DAT_wait of DM648

Hello All,

   My algorithm needs to use DAT_copy and DAT_wait in DM648.

   As I notice that the edma3_lld_01_10_00_01 has some example for the DAT modules. When I run the demo, it runs fine.

  But when I used it into my project, it always halts in DAT_wait. So I try to fix it.

  I fount it has related to the _dat_critical_section_exit and _dat_critical_section_enter in the dat_edma3lld_biosAdapter.c.

 My algorithm thread, which uses DAT_copy and DAT_wiat, is lower than the watchdog thread. It always runs in the wd thread, my wd thread

 will call TSK_sleep(),but It doesn't return to the algorithm thread again.

 So I remove  the thread protection like this.

void _dat_critical_section_enter() {
//    _tsk_state = TSK_disable();
}
void _dat_critical_section_exit() {
//    TSK_enable(_tsk_state);
}

 It works fine.But when I use serverl DAT_copy and then several DAT_wait,like this.

1=DAT_copy()

2=DAT_copy()

3=DAT_copy()

4=DAT_copy()

DAT_wait(1)

DAT_wait(2)、、、、

It will run down in the DAT_wait for several minutes. And the TransferCompleteL is always "1" in some bits.

So I think it maybe some cache reason. So I set the TransferCompleteL in NON_cachable zone. But It also will down.

I also call the BCACHE_wbInv to clean the TransferCompleteL. But it's no use.

I'm puzzled about the question.Pls give me some advice.

 

Thank you.!!!

 

 

 

 

 

 

  • Hi,

     

    I found some thing with the problem.

    eg.

     

    1=DAT_copy()

    2=DAT_copy()

    3=DAT_copy()

    4=DAT_copy()

    DAT_wait(1)

    DAT_wait(2)、、、、

     

    when to use some random length, there will be a problem.

    eg

    while(1)

    {

    nCellLen = ((rand()%0x800+0x80)/0x80)*0x80;

    if(nCellLen >= 0x10000)

    {

    nCellLen = 0x8000;

    }

    for(i = 0; i < 512; i++)

    {

    for(j = 0; j < 4; j++)

    {

    waitId[j] = DAT_copy(pSrc + j*0x9000, pDst + j*0x9000, nCellLen);

    // printf("%d, \t", nCellLen);

    }

    for(j = 0; j < 4; j++)

    {

    DAT_wait(waitId[j]);

    }

    }

    id++;

    if(id %20 == 0)

    {

    printf("%d\n", id);

    }

    }

     

    It will run down in the DAT_wait to wait the TransferComplete to return 0.

     

    Expect your reply.

    Thanks a lot!!

     

     

     

     

     

  • We’re closing out this old thread. If you feel there is more discussion on the topic, please feel free to "Reply".