cancel
Showing results for 
Search instead for 
Did you mean: 

Screen Tearing

JHarding
Senior

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

8 REPLIES 8
Martin KJELDSEN
Chief III

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

LTimm.1
Associate III

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
Chief III

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

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.

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...

You are right, the timing on the LCD-TFT is way too high. I've been messing with this timing, *N on PLLSAI1 cannot be set to less than 100 without cubemx barking at me about it. I ignored the errors and what do you know! it works!

I have attached some screenshots of the "errors" that cubemx throws when I change *N and /R values.

0690X00000Bx9GZQAZ.png0690X00000Bx9GKQAZ.png

I had a whole host of problems with just setting the values. Cube would not update the values and selecting the dropdown box was a huge pain.

Are you writing in the field? I thought it was just an output value 🙂

You can type into the LCD TFT field and CubeMX will attempt to back calculate all of the divisors and multipliers. It is hit or miss. In this case I manually found the proper values because CubeMX refuses to accept the values that work.

Please, don’t get me started on the drop down boxes agggggghh! Those things are a pain!!!!

It seems CubeMX wasn’t updating my HSE speed either. I dropped a 25Mhz crystal onto my board just to see if I could better match the f746 disco, and it rendered my board practically useless. It seemed like the HSE value wasn’t actually being updated. Who knows???