Hi everyone,I encountered difficulties when using ZYNQ PS DMAC, and hope someone can provide any solutions or ideas.
The problem isοΌ
I wrote a QSPI module with AXI_LITE interface for my LCD screen,Then I want to use LVGL.
I allocated a 32-bit address for the tx register of the QSPI module, but actually only the lower 8 bits are used, and 8 bits are sent at a time. LVGL uses a 16-bit array to store RGB data.
Therefore, it is necessary to split the 16-bit data into two 8-bit data and send them to the tx register of QSPI.
I wanted to use ZYNQ's PS DMAC to do this for speed and lower CPU usage.
To simplify the problem, I think, is to a 16-bit array, let DMAC take 8 bits each time, and transfer to a 32 bit array.
So I configured DMAC DmaCmd as:
XDmaPs_Cmd DmaCmd = {
.ChanCtrl = {
.SrcBurstSize = 1,
.SrcBurstLen = 1,
.SrcInc = 1, // increment source address
.DstBurstSize = 4,
.DstBurstLen = 1,
.DstInc = 1, // Ignoring the configuration here, I want to be able to see how the data is mapped in memory after the transfer, so I didn't set it to 0.
},
};
In this configuration, the expectation is that the DMAC will take 8 bits each time from the source address, expand to 32 bits, and write to the destination address (set zeros in the high bits).
But in fact, this configuration doesn't seem to let DMAC work. DMAC seems to work only if the source and destination address configurations are the same(BurstSize and BurstLen).
I don't want to write another C function to convert the LVGL color array to an 32-bit array,it would take a lot of CPU time to move the data around.
My board is Zynq-7020. I'm not particularly good at writing C programs.
Can anyone provide a better solution? Thanks.