Hello.
Used controller STM32F429, LTDC, DMA2D and LCD 7 inc resolution 800x480 pixels.
For example, the function of copying the buffer looks like this:
static void DMA2D_CopyBuffer(uint32_t layer_index, void* pSrc, void* pDst, uint32_t x_size, uint32_t y_size, uint32_t off_line_src, uint32_t off_line_dst)
{
uint32_t PixelFormat = GetPixelformat(layer_index);
DMA2D->CR = 0x00000000UL | (1 << 9); // Memory to memory and TCIE
/* Set up pointers */
DMA2D->FGMAR = (uint32_t)pSrc; // Source address
DMA2D->OMAR = (uint32_t)pDst; // Destination address
DMA2D->FGOR = off_line_src; // Source line offset
DMA2D->OOR = off_line_dst; // Destination line offset
/* Set up pixel format */
DMA2D->FGPFCCR = PixelFormat; // Defines the number of pixels to be transfered */
/* Set up size */
DMA2D->NLR = (uint32_t)(x_size << 16) | (U16)y_size; // Size configuration of area to be transfered
DMA2D->CR |= DMA2D_CR_START; // Start operation
/* Wait until transfer is done */
while(DMA2D->CR & DMA2D_CR_START)
{ }
}
Interruption that is not used anywhere.
// Transfer complete interrupt of DMA2Dvoid DMA2D_ISR_Handler(void)
{
DMA2D->IFCR = (U32)DMA2D_IFSR_CTCIF;
}
This starts DMA2D
DMA2D->CR |= DMA2D_CR_START; // Start operation
And here in the cycle is expected to perform a copy operation.
/* Wait until transfer is done */
while(DMA2D->CR & DMA2D_CR_START)
{ }
Copy for resolution 800x480 is 19 ms. That is, the CPU runs 19 ms in a cycle. and the program does not do anything useful. As I see, the use of DMA2D gives a minimal benefit.
Is it possible, instead of a loop, to insert a semaphore in the emWin function? To continue copying, the CPU does a useful job.[/size]
Used controller STM32F429, LTDC, DMA2D and LCD 7 inc resolution 800x480 pixels.
For example, the function of copying the buffer looks like this:
static void DMA2D_CopyBuffer(uint32_t layer_index, void* pSrc, void* pDst, uint32_t x_size, uint32_t y_size, uint32_t off_line_src, uint32_t off_line_dst)
{
uint32_t PixelFormat = GetPixelformat(layer_index);
DMA2D->CR = 0x00000000UL | (1 << 9); // Memory to memory and TCIE
/* Set up pointers */
DMA2D->FGMAR = (uint32_t)pSrc; // Source address
DMA2D->OMAR = (uint32_t)pDst; // Destination address
DMA2D->FGOR = off_line_src; // Source line offset
DMA2D->OOR = off_line_dst; // Destination line offset
/* Set up pixel format */
DMA2D->FGPFCCR = PixelFormat; // Defines the number of pixels to be transfered */
/* Set up size */
DMA2D->NLR = (uint32_t)(x_size << 16) | (U16)y_size; // Size configuration of area to be transfered
DMA2D->CR |= DMA2D_CR_START; // Start operation
/* Wait until transfer is done */
while(DMA2D->CR & DMA2D_CR_START)
{ }
}
Interruption that is not used anywhere.
// Transfer complete interrupt of DMA2Dvoid DMA2D_ISR_Handler(void)
{
DMA2D->IFCR = (U32)DMA2D_IFSR_CTCIF;
}
This starts DMA2D
DMA2D->CR |= DMA2D_CR_START; // Start operation
And here in the cycle is expected to perform a copy operation.
/* Wait until transfer is done */
while(DMA2D->CR & DMA2D_CR_START)
{ }
Copy for resolution 800x480 is 19 ms. That is, the CPU runs 19 ms in a cycle. and the program does not do anything useful. As I see, the use of DMA2D gives a minimal benefit.
Is it possible, instead of a loop, to insert a semaphore in the emWin function? To continue copying, the CPU does a useful job.[/size]
The post was edited 4 times, last by Raash ().