Hi all,
I've a processing loop which roughly looks like the following:
while (1) {
if (new_data_to_process) {
pre_processing();
for (int k=0;k<64;k++) {
while(!buffer_transfered);
buffer_transfered=0;
EDMA3QdmaSetPaRAMEntry(....); //Update the paRAM entry
EDMA3SetEvt(base_address,31); //Start the transfer of the next buffer, completion interrupt will set buffer_transfered=1
/*process current buffer*/
}
post_processing();
}
}
The idea is that the processing happens in L1 RAM in a Ping-Pong like fashion, while the full buffers are in DDR. So when processing block n, I use DMA to transfer block n+1 into L1 in the background.
This works fine, except that the call to EDMA3SetEvt takes an extremely long time. Without that call all processing is done in 130000 cycles (measured using TSCH/TSCL). With the call to EDMA3SetEvt the processing takes 390000 cycles.
What's even more strange is the fact that if I measure the cycle count of the EDMA control code, it's only 460 cycles. With 64 loop iterations, I would expect to loose 29440 cycles, not 260000.
Why is the access to the EDMA peripheral so slow?
Is there a better way to control the DMA transfer from the processing loop?
Thanks in advance.
Kind regards,
Remco Poelstra