2014-01-06 09:07 PM
hi there, I am running an issue about using DMA to transfer data bytes from ports to internal RAM at 12MHZ. I have succeeded in doing so, but I loose first few hundred of data bytes in doing so. Can this could be a problem of DMA setup time, or should i look again over my code. I'm not using buffer mode (because I dont think it will solve the issue about 200-250 bytes of data loss).
thanks #dma #dma-setup-time2014-01-07 01:16 AM
12 MHz is pretty quick, what processor are you using, and how is this transfer being set up? Is the transfer of a consistent/repetitive size? What's the relationship between the interrupt and the setup time? You can time the setup in machine cycles using something like the DWT_CYCCNT register.
2014-01-09 10:09 PM
thanks clive1!I am using stm32f4 controller at 168 MHz and I receive data bytes in fix number of bytes. Initially I receive data over timer1 capture interrupt and then I configure DMA to move data to different-2 locations according to the first byte. From somewhere I remember that for stm32f4, there is 8 cycle interrupt latency, is it true? I also tried to receive data directly by DMA (without initially entering into an interrupt), but even then I loose some data . Also I dont know much about DWT_CYCCNT register. I could not find it on reference manual.
Thanks2014-01-10 07:43 AM
I could not find it on reference manual.
You'd be looking in the wrong one, this would be in ARM's Cortex-M3/M4 manuals. http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337h/BABJFFGJ.html