Strange RTEMS DMA Access on Zynq
chrisj at rtems.org
Thu Jan 10 03:36:01 UTC 2019
On 10/1/19 2:28 pm, Misra, Avinash wrote:
> I am currently using RTEMS to access a DMA core on the Zynq and am noticing some
> interesting/peculiar behavior:
> When I provide my DMA engine a statically allocated buffer what I notice is that
> the first few bytes (5) of the buffer, after getting it back from the DMA,
> remain unchanged however the rest of the buffer after that contains the data
> (minus the first 5 bytes that are missing).
> When I provide my DMA engine a dynamically allocated buffer from either C++ new
> or Posix malloc() or posix_memalign() then I receive all of the data correctly
> from byte 0 to the last byte.
> If I provide my DMA engine my statically allocated buffer offset by the amount
> of bytes it fails to write into then I will see all of my data from the DMA
> beginning at the offset.
> Has anyone experienced something similar or have any suggestions as to what may
> be going on and/or thoughts on how to fix this behavior? I would ideally like to
> be able to do this with some statically allocated buffers.
The compiler's default alignment for the buffer will not be the same as the DMA
engine. You will need to use the alignment.
What is the alignment requirement for the DMA engine? You will need to add this
to the size of the static buffer and use an offset into the buffer that meets
the DMA engine's alignment.
Do not forget to invalidate the cache once the DMA engine has finished.
Are you using the CDMA IP?
More information about the devel