Skip to main content
JHarding
Senior
January 30, 2020
Question

Screen Tearing

  • January 30, 2020
  • 3 replies
  • 2059 views

Hello,

I'd like to start by saying thank you to the community, so far it has been great and I have been able to work through any issue that has come up.

A new problem has shown up today. I just started making some real headway on my project, and in doing so, I created a new screen with a scrollable container. Within that container, I have some text. When I try and scroll around it appears I have some screen tearing issues. I have attached a video of the issue.

I have read around about this issue and it seems like a double buffer could solve this issue, so I enabled the double buffer and stuffed these values based on another demo from TouchGFX:

Start Address : 0xC0000000
Start Address 2: 0xC005FA00

Enabling the double buffer didn't change anything :(

Any help/guidance would be greatly appreciated.

Processor: STM32F746BG

TouchGFX 4.13.0

STM32CubeIDE 1.2.1

Regards,

James

This topic has been closed for replies.

3 replies

Martin KJELDSEN
Principal III
January 30, 2020

This looks like more like a display configuration issue to me (e.g. Those pixel artifacts are definitely not in the framebuffer).

Can you share more information about your hardware setup and how you created this project?

/Martin

JHarding
JHardingAuthor
Senior
January 30, 2020

I should have included more information in my initial post, apologies.

Display: RK043FN66HS-CTG

FMC, LTDC, DMA2D

I setup the project using STM32CubeIDE File->New STM32 Project and selected the STM32f746BG. I then proceeded to enable the FMC, LTDC, and DMA2D options as well as the X-CUBE-TOUCHGFX.4.13.0 additional software options.

I pretty much followed @HP​s video posted here: https://www.youtube.com/watch?v=o42r4xXOnbo

Of course my hardware has a few differences, mainly the LTDC and FMC use some alternative lines.

I do have a High Speed External clock at 8Mhz, which is different from the STM32F746-Disco boards of 25Mhz. I have adjusted the Clock Configuration in Cube to account for this.

lockDMAToFrontPorch(true) is how STM32CubeIDE and TouchGFX had initially setup in this function: void TouchGFXGeneratedHAL::initialize()

I also tried changing it to false, but the same issue persists.

I have attached my cube file for analysis.

HP_it
Senior II
January 30, 2020

your PLLSAI1 is not set right.

You're generating a 25MHz pixel clock. If you're using the F746-Disco board then you want something like 9.6MHz or thereabout.. I think the minimum is 8 and max is 12..

Try setting the /R to 6 and *N to 57 ish...

LTimm.1
Associate
January 30, 2020

Could it be a memory bandwidth issue?

Even with double buffering you need enough bandwidth to both read the active framebuffer to the display, and write to the other buffer.

I have seen strange stuff on displays when they are not feed with enough data...

A quick test could be to set lockDMAToFrontPorch in the HAL:

lockDMAToFrontPorch(true);

Martin KJELDSEN
Principal III
January 30, 2020

It could be, definitely!

Usually, the test would be to lockDMAToFrontPorch(true); yes! It ensures that the SDRAM isn't accessed by both LTDC/DMA2D at the same time.

/Martin