Skip to main content
Despair1337
Associate III
January 22, 2021
Solved

DMA2D throws configuration error

  • January 22, 2021
  • 4 replies
  • 1347 views

Hello, on my STM32H747-DISC1, I had huge issues with DMA2D and CLUT (it was freezing etc).

I thought it's because cache maintenance, but anyway after doing everything correctly, DMA is still buggy. Finally I find out, that 90% of my DMA2D executions throws DMA2D_FLAG_CE, but anyway DMA2D renders it.

Code:

 dma2d_handle.Init.Mode = DMA2D_R2M;
 dma2d_handle.Init.ColorMode = DMA2D_ARGB8888;
 dma2d_handle.Init.OutputOffset = Offset;
 
 dma2d_handle.Instance = DMA2D;
 
 if(HAL_DMA2D_Init(&dma2d_handle) == HAL_OK)
 {
 if(HAL_DMA2D_ConfigLayer(&dma2d_handle, layer_index) == HAL_OK)
 {
 if (HAL_DMA2D_Start(&dma2d_handle, ColorIndex, (uint32_t)dst, xSize, ySize) == HAL_OK)
 {
 HAL_DMA2D_PollForTransfer(&dma2d_handle, 10); // returns HAL_ERROR and HAL_DMA2D_FLAG_CE
 }
 }
 }

Any ideas?

This topic has been closed for replies.
Best answer by Despair1337

The answer is simple. xSize and ySize cannot be zero.

4 replies

waclawek.jan
Super User
January 22, 2021

Configuration error detection subchapter of DMA2D chapter contains a list of conditions checked by the module.

JW

Despair1337
Associate III
January 22, 2021

Thanks! I figured it by trial and error (I find out that some of values was zero), but if I wouldn't found it, this would help me.

Thank you for your time! :)

Despair1337
Despair1337AuthorBest answer
Associate III
January 22, 2021

The answer is simple. xSize and ySize cannot be zero.

waclawek.jan
Super User
January 22, 2021

Thanks for coming back with the solution.

Many answers look simple after you find them...

JW