cancel
Showing results for 
Search instead for 
Did you mean: 

screen tearing when using .invalidate on the STM32H735G-DK

tmehok
Associate III

PROBLEM:

I do not believe this is a bug. I am doing everything I can to read into this issue it seems like I am either not enabling all the correct options or I am using .invalidate wrong.

This is what my GUI looks like from a basic design.

Basic_SIM_Picture.PNG

This is what it looks like when I run the TouchGFX simulator(the right image is gone because I initialize it as false until it receives a signal)

Basic_SIM_Picture.PNG

This is the tearing image I am having trouble with(currently no inputs).

board_tearing.png

I am basing this example on a set of tutorials I found online, https://www.youtube.com/watch?v=Y7d6-59YQu8&t=525s.

At my current level of C programming he seems to provide a good amount of details. Where I fall short is once I start to run it on the board. 

CODE IN QUESTION:

 

#include <gui/screen1_screen/Screen1View.hpp>

Screen1View::Screen1View()
{
}

void Screen1View::setupScreen()
{
    Screen1ViewBase::setupScreen();
}

void Screen1View::tearDownScreen()
{
    Screen1ViewBase::tearDownScreen();
}

void Screen1View::setLight(bool state)
{
    Light_ON.setVisible(state);
    Light_OFF.setVisible(!state);
    Light_ON.invalidate();
    Light_OFF.invalidate();
}

 

 

WHAT I HAVE TRIED:

-> My first impression was that I was refreshing my screen to fast. I took out the .invalidate line, the gentlemen in the tutorials described it as a way to let the system know the widgets graphical representation needs to be reset. If I did that it would stop "tearing" and stay still, no matter what input I gave in D6(PD15) which I set as my GPIO Input. 

-> I created a timer which would only call .invalidate every second. This partially worked! it correctly showed my inputs were working  and the images changed but alas every second before the new image showed up it would "tear". All other examples I saw of the STM32H735G-DK did not do this.

-> I looked more into invalidate. The closest I got to a proper explanation was that some boards use "Double buffer". Double buffer seems to be a way to ensure the board will not try to clear and write to the screen at the same time. I am unsure of how to find the option to start double buffering.

ENDING:

Although double buffering may not be the issue, it is my best first steps. If this does not seem plausible and you guys have other ideas on what could be causing this issue please let me know. Thank you for all of your help.

 

 

NOTE: it says "your post has changed because of invalid HTML" I apologize if the grammar is strange or missing in any areas I missed.

13 REPLIES 13

Hello @tmehok ,

I quickly have based your project on the TouchGFX Board Setup available in the TouchGFX designer and it works like the simulator.
So, it is a good indication that there might be an issue with your board setup, and you can use the board setup I mentioned as a point of reference to see if you can catch any errors.

Mohammad MORADI
ST Software Developer | TouchGFX

Did you alter the code to invalidate one or multiple widgets? 

tmehok
Associate III

Also, where can I access this board setup? is it an example board? I will agree that the normal examples work but I haven't looked through their code to see if they use .invalidate.

No, I didn't alter your code. I just changed my STM32CubeMX settings to add the pins you are using inside your project. I will explain my steps so you can follow:

1- Create a STM32H735G-DK project from TouchGFX
STM32H735G-DK TouchGFX Board SetupSTM32H735G-DK TouchGFX Board Setup

2- Import the TouchGFX application you have made:

Import GUI.png 

3- Add a random pin with the same name as the one you are using in your project and Model.cpp file (Input_Test):

Adding Input_Test pinAdding Input_Test pin

4- Run the project on the target:

Project running on the boardProject running on the board

I hope this helps you 

 

Mohammad MORADI
ST Software Developer | TouchGFX