Jump to content

STM32F746G-DISCO sync problem?


Fleck

Recommended Posts

What you see there is called Tearing and it is probably one of the most common phenomena with displays. The effect is caused by modifying the framebuffer while the display controller is looping through the framebuffer to refresh the actual display panel. There are two (common?) solutions to this problem:

  • Vertical Synchronization: Display controllers often provide a signal or flag that informs you when the framebuffer sampler finished refreshing the display. Then you have a specific/known amount of time (like a time window) during which you can modify the framebuffer before the sampler starts scanning through it and updating the display again.
  • Double-Buffering: When multiple framebuffers are available, you can write to one framebuffer at any time and once the framebuffer sampler completed a frame you simply swap the buffer so it will loop through the new one while the other one can now be modified.

Tearing prevention is something that has to happen on the driver level. The GDISP driver API has been designed to be flexible enough to support these kind of things. For example, a gdispQuery() command can be implemented to check whether the display controller is currently refreshing the display panel. You can have a look at the uGFX microPython wrapper that implements this feature. However, unless it got fixed by now they are not doing it through the gdispQuery() API like they should but instead they implemented a specific function in the ILI9341 driver that they use for that specific project. Although that is the wrong approach (this really has to be done through gdispQuery()) it shows how to deal with tearing prevention.

The same goes for using the 2nd layer of the LTDC of the STM32. More information can be found here.
Although in case of double-buffer that could be done manually using Pixmaps instead so that the second layer is still available to use the other fancy features.

I hope that helps.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...