cancel
Showing results for 
Search instead for 
Did you mean: 

DMA2D HAL_DMA2D_Start -> pdata(color) formar

aadam.1
Associate

Hello

I got LCD 240x320 connected via SPI to my STM32f429. LCD interface is RGB565.

I have created buffer

uint8_t buffer[240*320*2];

so, 1st im filling buffer with red color:

 for (int i=0;i<240*320*2;i+=2){
 	  buffer[i]=0xf8;
 	  buffer[i+1]=0x00;
   }

Then via spi its send to LCD, and I can see red color on display. All is working fine.

I wanted to use DMA2D now.

I have configured it as R2M, with 565 color output:

hdma2d.Instance = DMA2D;
hdma2d.Init.Mode = DMA2D_R2M;
hdma2d.Init.ColorMode = DMA2D_OUTPUT_RGB565;
hdma2d.Init.OutputOffset =0;

and I tried:

HAL_DMA2D_Start(&hdma2d, 0xf800, 0x200000c0, 240, 320);
//0x200000c0 is my buffer adress
 
//0xf800 -> @param  pdata      Configure the source memory Buffer address if
//  *                     Memory-to-Memory or Memory-to-Memory with pixel format
// *                     conversion mode is selected, or configure
//  *                     the color value if Register-to-Memory mode is selected.

But after that i got Pink color on display, insted of red

In what format/type I should send pdata argument to get RED color on display?

1 REPLY 1
KDJEM.1
ST Employee

Hi @aadam.1​ and welcome to the Community :),

Please check the LTDC parameters configuration and precisely the layer settings.

I recommend the LCD-TFT display controller (LTDC) on STM32 MCUs application note may help you in your implementation.

I hope this helps!

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.