cancel
Showing results for 
Search instead for 
Did you mean: 

Why is the UI display on my screen distorting?

Junde
Senior II

Hi,

I have tried many times to configure touchGFX with cubeMx, and I was finally almost successful. My screen is 1024*600, and the driver chip is EK79001.

Now the widgets shown on display are distorting(the image seems right), as below:

0693W00000aJs4xQAC.jpgBut my designer is the following:0693W00000aJs57QAC.jpgthe LTDC parameters and the datasheet are as below:

0693W00000aJs5lQAC.png0693W00000aJs6KQAS.pngI really don't know, why this happened, could you help me?

Thanks a lot.

10 REPLIES 10
Junde
Senior II

I want to make sure a thing: need I add the init code for the RGB display?

For me, need I to add the ​EK79001's driver to config it?

Junde
Senior II

Maybe you want to check my cubeMx config project, which I upload as an attachment.

heyo
Senior

Maybe the problem is of LTDC frequency or in external SDRAM config if u use it 🙂 (its just prediction)

Looks like the X and Y axis are switched.

ie it is generating the raster with one expectation, and the display has another expectation

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Junde
Senior II

@Community member​ 

Thanks for your reply.

I also doubt that may the X&Y axis are switched.

So I also change the X and Y by config the "Display Orientation" in touchGFX.

0693W00000bhA3OQAU.png0693W00000bhA3JQAU.pngBut this seems nothing to help, the result is the same as before.

(I want to make sure that changing the "Display Orientation" config is the same as changing X & Y axis, am I right?)

Anyway, thanks for your help.

@heyo​ 

Thanks for your help.

I also think about it.

So I do some SDRAM tests as per below code:

#ifdef __CC_ARM		// ARM compiler
uint32_t volatile SDRAMBuf[EXT_SDRAM_SIZE] __attribute__((at(EXT_SDRAM_ADDR))) = {0};
#endif
 
uint32_t FMC_SDRAM_test(void)
{
	for(uint32_t i = 0; i < EXT_SDRAM_SIZE/sizeof(uint32_t); i += 16*1024) {
		//SDRAMBuf[i] = i;
		*((uint32_t*)EXT_SDRAM_ADDR + i) = i;
	}
 
	for(uint32_t i = 0; i < EXT_SDRAM_SIZE/sizeof(uint32_t); i += 16*1024) {
#ifdef __GNUC__
		if(*((uint32_t*)EXT_SDRAM_ADDR + i) != i) {
#else
		if(SDRAMBuf[i] != i) {
#endif
			return i+1;
		}
	}
	return 0;
}

The code seems always returns 0.

So I judge that the SDRAM is working well, am I right?

franck23
Senior

Hi,

I am using the same LCD controller.

I think you made a mistake on your LTDC setting.

Horizontal Synch Width: 1px

Vertical Synch Height: 1 line

Your other LTDC settings are the same as mine.

Just be aware that with a 1024x600 screen, you are at the limit of what the LTDC and SDRAM can do.

My setup:

STM32H743 @480MHz

LTDC @51.2MHz.

32bit SDRAM @120MHz

I had to use RGB565 instead of ARGB8888 or I would get shaky frames.

I hope your SDRAM data width is 32bit or you will get half the bandwidth and may have to reduce the refresh rate.

Franck.

@[franck23]​ 

Thanks for your reply.

unfortunately, my SDRAM is 16bit.

My setup:

STM32H743 @400MHz

LTDC @50MHz

16bit SDRAM @100MHz

When setting the flash rate of 1024*600 display at 60Hz, using RGB565 format:

totally need 1024*600*2*60=73728000Bytes/sec.

And the limit access speed of SDRAM is 2Bytes*100MHz=200MBytes/sec, considering data-in and data-out, the max data-out speed is 200Mbytes / 2 = 104857600Bytes/sec.

Seems the SDRAM's speed is enough.

BTW, what's "shaky frames" mean, Are they the same or different from the distorting picture showed as above?

And, how can I reduce my refresh rate? Can I config it by cubeMx or touchGFX?

franck23
Senior

Hi Junde,

First of all, did you manage to display your red square?

Your SDRAM is going to be accessed by both the LTDC and TouchGFx at the same time.

The LTDC reads data from the SDRAM while TouchGFx writes data to it.

If there are a lot of things changing on your screen at once, TouchGFx may redraw the full screen in the SDRAM and you need double the bandwidth.

Also, the LTDC read and TouchGFx writes may be on different banks of your SDRAM. Switching between banks takes some extra time, reducing your SDRAM bandwidth.

On my system, I had problems only when displaying a keyboard that takes the full screen.

When the keyboard gets loaded, I get some small glitches: the frame display does not come all at once. It last for maybe one or two frames, so that is not a show-stopper, it just looks a bit sketchy.

(this is what I mean by shaky frames, this is not the distorted image you have in your pictures).

What you can do is use L8 instead of RGB565. L8 uses only 1 byte per pixel, but you get limited to 256 colors.

256 colors are plenty if you take this limitation into account when drawing your interface.

For example, don't try to make 3D effects on your buttons. Drawing embossed buttons takes a lot of color shades and you quickly get over the 256 colors limit.

To reduce the refresh rate, you need to decrease the LTDC speed in CubeMX.

But you already are at 50MHz and if I remember right, the screen controller cannot go lower than 49MHz.