Forums » Software Development »
DSP EDMA Semaphore problem
Added by Rafał Krawczyk about 11 years ago
Hello,
I have succesfully transferred the blocks of data using the BlockTransfer Method from DspQDMA.cpp (see thread: http://support.criticallink.com/redmine/boards/10/topics/3027). However, I am now attempting to synchronize the completion of EDMA transfer with waking of my task. To do so, I am trying to make do with an example in DspQDMA.cpp with a semaphore SEM_Handle myHandle.
I am declaring it in the following way:
SEM_Handle myHandle; //globally
myHandle = SEM_create(0,NULL);
Then I configure hwi, in which the following method is invoked:
dma->BlockTransfer(&myHandle, src, dst, ii,
EDMA_OPT_ESIZE_16BIT,
EDMA_OPT_PRI_HIGH);
Then I have in my code a
SEM_pend(myHandle,SYS_FOREVER);
command, which I want to use to block before the transfer and subsequently to wake the task when the EDMA transfer is completed. The interrupt does invoke the BlochTransfer method, and the data is transferred correctly. Moreover, the EDMA does trigger the QDMA_Channel_Handler when the data transfer is completed (in which I assume the semaphore is posted). However, my task wouldn't wake and wouldn't execute after the SEM_pend is invoked despite the correct transfer.
When I removed the SEM_pend from my task and put it into hwi (just like in the DspQDMA example- the SEM_pend command just after the invocation of BlockTransfer), the hwi wouldn't proceed either after the SEM_pend command. It appears that SEM_pend isn't waked after the SEM_post command.
Do you know, what could be the cause of this non-waking block ?
Thank you in advance
Rafał Krawczyk
Replies (1)
RE: DSP EDMA Semaphore problem - Added by Rafał Krawczyk about 11 years ago
Sorry about the problem. The cause of this was the incorrect memory access of mine. I basically tried to simultaneously operate on the same memory addresses both by the app and the EDMA (which did not end the transfer). Now that I have disabled this while the EDMA transfer, everything works just fine.
Best Regards
Rafał Krawczyk