cancel
Showing results for 
Search instead for 
Did you mean: 

TouchGFX Lined Output on RGB Display

StephenG
Associate II

Hello,

My TouchGFX application is outputting a static image in the GUI wrongly and I am unsure where the error stems from.

Board: STM32H747I-DISCO

Display: Innolux G057VCE-TH1   (640wx480h RGB666)

Without TGFX, I am able to output a chosen static image array correctly, and when it is on external memory. Thus, I believe my configuration for the LTDC and FMC is correct. When using TGFX, I set up breakpoints for the LTDC FIFO underrun interrupt handler, and it was never triggered. 

In TGFX Designer, whether I have the orientation as portrait or landscape, and fill it with the image filling the screen, the output is the same.

This project was initially generated from TouchGFX Designer for the discovery board, and I gradually modified it to accommodate this display. An important change was commenting out DSI and old display controller calls (this new screen does not have a controller, it just uses parallel RGB).

When I am debugging, the program does not run into any infinite-while-loop error handlers.

I inspected the generated cpp array of the color bars image and they seem to be fine.

What I notice from the image is that vertical lines are now drawn horizontally and at a slight angle downwards. Instead of gray, yellow, cyan, green, purple, red, blue from left to right, it is now drawing that progression of colors line by line downwards. This is why I suspect that the problem lies in some orientation configuration affecting how the TGFX engine draws pixels to the framebuffer.

17 REPLIES 17

One more idea, what about this setting, it must be 0. It seems mix images wierdly if 90.

JTP1_0-1691521681085.png

Maybe its worth testing put some box etc to tgfx also.

Yes, using both the portrait or landscape option under Display Orientation will also change the Layout Rotation, and using both versions as shown in my first images produces the same output image.

Do you think there is anything unusual about the memory content findings from my last reply? The framebuffer data turned out to look the same, which goes against my theory that TGFX engine is producing the wrong data.

Update: The data LOOKS about the same, but they are not. It appears that there is extra bogus data being produced at the end of the TGFX-generated framebuffer, causing all the colors to shift right line-by-line, leading to the slanted horizontal appearance

There are 32 pixels added on to the end of the pixel data. See the text files for the difference between the two. The CCCCCCCC data represents the grey pixels at the start of the line and next line.

JTP1
Lead

Hello

Yes I make just some notice based on the steps on the bottom of the screen (20) and 640 / 20 = 32. So one line simply too long on the framebuffer.

Could it be some involved to LTDC settings and TGFX is trying to compensate something ?

BR J.t

Do you find HAL_LTDC_SetPitch - call on LTDC initialization, what it looks like ? Put there this 672

Yes, putting this after the LTDC init functions corrects the image. I still do not know why TGFX adds the 32 pixels of bogus at the end of each line.

 

StephenG_0-1691606764024.png

 

EmbDev
Senior

Exactly the same issue here with TouchGFX 4.22.1, using a STM32F469 MCU with a 480x800 display over RGB interface using RGB 888 format.
Somehow after each line there are 32 bytes with garbage data in the framebuffer. Good to have a solution for now, thanks @StephenG.

Can anyone from ST comment on this, it looks like a bug but might also be some configuration error? I really would like to know the exact cause of this issue.

EmbDev
Senior

Looking a bit further into this issues I found the actual cause.
Just like the topic starter I am using an example generated TouchGFX application for a Discovery board.
This example used DSI and now I am converting it into using RGB.

For some reason when using DSI, the width passed to the TouchGFXGeneratedHal is the screen width + 32.
So in the file target/TouchGFXHAL.hpp in the constructer this +32 was added.

 

 

TouchGFXHAL(touchgfx::DMA_Interface& dma, touchgfx::LCD& display, touchgfx::TouchController& tc, uint16_t width, uint16_t height)
  : TouchGFXGeneratedHAL(dma, display, tc, width + 32, height)
    {
    }

 

This causes the 32 extra garbage bytes in the framebuffer when switching to the RGB interface.

To get the images to show properly on the display I also had to change the Layout Rotation from 90 to 0 in the TouchGFX designer:

config -> Default Image Configuration -> Layout Rotation.