I'm doing some experiments which employ a 2d DMA transfer by invoking rt_dma_memcpy_2d. I'm genuinely unsure if I'm missing something or if the result might be wrong. I can't find any example whatsoever which demonstrates the utilization of the 2d DMA transfers in the codebase.
For the sake of simplicity, the data type of the array elements is uint8. Now, let's assume that I want to copy this array and place it within a larger array (7x5 of uint8) which has previously been memset to 0.
Now, with stride = 5 which is the width of the source matrix, and length = 7 which is the width of the destination matrix, and by offsetting the destination address by 8, I would expect to end up with something like this:
The API call is:
rt_dma_memcpy_2d((unsigned int) l2data, (unsigned int) l1data + 8, 3 * 5 * sizeof(uint8_t), 5, 7, RT_DMA_DIR_EXT2LOC, 0, &L2toL1);
What am I missing here? Might it be that I somehow miscomprehended the idea of 2d DMA transfers? Is it possible to employ 2d DMA transfers to achieve the expected behaviour?
Hi,
I'm doing some experiments which employ a 2d DMA transfer by invoking
rt_dma_memcpy_2d
. I'm genuinely unsure if I'm missing something or if the result might be wrong. I can't find any example whatsoever which demonstrates the utilization of the 2d DMA transfers in the codebase.Consider the following minimal example:
For the sake of simplicity, the data type of the array elements is
uint8
. Now, let's assume that I want to copy this array and place it within a larger array (7x5 of uint8) which has previously beenmemset
to0
.Now, with stride = 5 which is the width of the source matrix, and length = 7 which is the width of the destination matrix, and by offsetting the destination address by 8, I would expect to end up with something like this:
However, what I end up with is this:
The API call is:
rt_dma_memcpy_2d((unsigned int) l2data, (unsigned int) l1data + 8, 3 * 5 * sizeof(uint8_t), 5, 7, RT_DMA_DIR_EXT2LOC, 0, &L2toL1);
What am I missing here? Might it be that I somehow miscomprehended the idea of 2d DMA transfers? Is it possible to employ 2d DMA transfers to achieve the expected behaviour?
Thanks!