cancel
Showing results for 
Search instead for 
Did you mean: 

What could cause TouchGFX incorrect colors in display and incorrect colors in SDRAM frame buffer values?

RMolins
Associate III

I am currently trying to display color properly on an RGB panel with parallel interface. However, colors are not displaying properly and I currently do not know what else to troubleshoot. I am using STM32F769I eval board connected to the RGB panel.

I have initialized the 8MB SDRAM where I am allocating one single frame buffer 800x480*3 forTouchGFX. I have verified that I am able to read and write correctly to the SDRAM.

However, when I set:

  • LTCD/Display Type to RGB888
  • Frame buffers to RGB888

White vertical lines appear on the panel and the SDRAM memory seems to have incorreclty placed 0xFF values.

If I change the configuration to:

  • LTCD/Display Type to RGB565
  • Frame buffers to RGB565

The result is that the LTCD panel has no noise but colors are incorrect. The SDRAM memory correctly stores the frame buffer colors but the color displayed is not correct. In touchGFX I define a grey color with values 0xAAAAAA which is correctly translated into RGB565 0x55AD but is displayed as purple (green component seems incorrect).

Changing the LTCD/Display Type to RGB888 but leaving frame buffers as RGB565 has the same effect as using LTCD/Display Type RGB565.

Here are the results of the test setups explained:

Target image result

0693W00000KZxyUQAT.pngRGB888

0693W00000KZxzSQAT.jpgRGB5650693W00000KZxvdQAD.jpgAny guidance regarding possible causes will be greatly appreciated.

7 REPLIES 7
MM..1
Chief III

When you switch between RGB565 and RGB888 or any other you need reconfig MX and too reconfig and regenerate touchgfx project completely. Or use two projects.

For your trouble with green or check all colors, you need check if BITMSB green LTDC is connected to MSB on LCD GREEN usw. and in normal situation you connect LCD fpr example RGB666 and cant switch this, because switching to other deinitialize GPIO and your LCD dont have drived pins .

RMolins
Associate III

To change between RGB565 and RGB888 I do the following steps:

  • open the .ioc file.
  • Change the values of the Display Type and layer settings.
  • Then in the SW packs there is the STMicroelectronics X-Cube-Touchgfx-4.18.1 and set the frame buffer format RGB565 or RGB888.
  • After this I save the .ioc file which regenerated the code.
  • Then I open the .touchgfx and the color depth is changed to 16/24 bits and change the image format to RGB565/RGB888

However I understant from your comments that if my panel is connected as 24 bits RGB888 I should only use that option as the other will leave the unused GPIO with incorrect values.

I also understand that the frame buffer format and the display type need to match, i.e if I select the display type to 24 bits in the LTCD panel I shall stick with a RGB888 frame buffer as no automatic transformation will occur between the RGB565 and RGB888 will take place

My issue is that if I set all the value to RGB888 and 24 bits the vertical noisy lines appears and the memmory has extrange values with FF.

All your words little miss from real.
1. Set display type as your real connection schematics and don’t change (LTDC convert...) for example RGB666
2. Set layer format as you need you can combine for example layer 0 565 RAM layer 1 888 flash static image .... L8 ...
3. TouchGFX copy layer 0 framebuffer format automatic
In any mode , but RGB888 is top speed , your config must meet speed dotclock < max ram read pixel data speed < ....
RMolins
Associate III

First of all thank you for your time on providing feedback. I was able to properly understand some concepts now. After many attemps I have reached a "working" configuration but I want to understand the underlying reason of why it works.

My intenention was to do the following

  1. I have set LTDC Display type as RGB888 which is the expected from the screen
  2. I am only using one layer which I set to Pixel format RGB888/RGB565
  3. In touchGX I set the Framebuffer Pixel Format to RGB888/RGB565
  4. I have lowered the LCD-TFT to 14.5Mhz to lower the frame rate

This results in some places haveing random white values. Changing the framebuffer pixel format to ARGB8888 solves the problem but the frame buffer is much larger than expected I might not be undersanting something about how does touchGFX handles the frame buffers but as far as I understand once the LTCD panel is configured correctly changing the frame-buffer should not affect the result.

Random white nose that can be seen

0693W00000Ka7MLQAZ.jpgCorrect image once ARGB8888

0693W00000Ka7KkQAJ.jpg

MM..1
Chief III

Here is hard reply, but first testing you need do without TouchGFX.

TGFX is only library to manage framebuffer in memory. Transfer image to LCD isnt primary job, and all code for manage this is in target folder .

From your image seems trouble maybe is in horizontal HSYNC PORCHs values .

RGB888 vs ARGB8888 is only in MCU conversion , into LCD everytime go RGB888 mode set for LTDC out.

For testing you in code comment out start RTOS and before main while place some for memsets in framebuffer memory create test patterns colours,,,

RMolins
Associate III

It looks like there is an error when filling the SDRAM memory. The frame buffer, if correctly filled is displayed, correctly. I did disable the TouchGFX task and tested some patterns with memset. The results where quite surprising.

If I set all memmory in one mem set the values are stored incorrectly while if i set in a 32bits steps it is correctly stored.

/* First part which correctly fills the memmory */f
for(counter = 0 ; counter< 20; counter ++ ){
      memset(0xC0000000 +4*counter, 0xAAAAAAAA, 4);
  }
 /* Second part of the memmory fill which is filled incorrectly*/
memset(0xC0000000 + 4*20, 0xAAAAAAAA, 60);

Memmory values after execution

0693W00000KaC97QAF.png

MM..1
Chief III

Seems your sdram clock config or hardware wires have some trouble.

Try memset with bytes no words.

You on eval board then i mean hardware issue less possible, check sdram init.