Saturday, February 24th 2018, 2:58am UTC+1

You are not logged in.

  • Login
  • Register

KertJ1

Beginner

Date of registration: Jan 31st 2018

Posts: 2

1

Thursday, February 1st 2018, 4:09pm

STM32H7 GUI_MULTIBUF and screen tearing...

I am seeing a case where GUI_DrawBitmapEx() does not seem to behave properly within
GUI_MULTIBUF_Begin()/End(), specifically:


WM_MULTIBUF_Enable(1);
GUI_MULTIBUF_Begin();
GUI_DrawBitmapEx(&bmminus1, 285, 300, 0, 0, 300, 300); // Tearing occurs at this line
GUI_MULTIBUF_End();
GUI_Exec();

I would expect to see no change to the display during the Begin()/End().
When I run or single-step through the DrawBitmap, the screen tears...

Regards

golf2109

Beginner

Date of registration: Nov 26th 2017

Posts: 4

2

Friday, February 2nd 2018, 3:59am

RE: STM32H7 GUI_MULTIBUF and screen tearing...

WM_MULTIBUF_Enable(1);
GUI_MULTIBUF_Begin();
__disable_irq();

GUI_DrawBitmapEx(&bmminus1, 285, 300, 0, 0, 300, 300); // Tearing occurs at this line
__enable_irq();

GUI_MULTIBUF_End();
GUI_Exec();


KertJ1

Beginner

Date of registration: Jan 31st 2018

Posts: 2

3

Friday, February 2nd 2018, 5:34pm

RE: STM32H7 GUI_MULTIBUF and screen tearing...

Thanks for the reply...

I tried to disable/enable interrupts and it still tears...

I was able to fix it by adding the following line during initialization:
GUI_MULTIBUF_Config(3);


Although it sure seems like a bug in the emWin code that anything
within a GUI_MULTIBUF_Begin()/End() shouldn't cause a change on the screen.

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 496

4

Monday, February 5th 2018, 4:31pm

Hi,

are you using the sample LCDConf.c provided by STM?

On the first look it should work.

C/C++ Source code

1
2
3
4
5
GUI_MULTIBUF_Begin();

 GUI_DrawBitmapEx(&bmminus1, 285, 300, 0, 0, 300, 300); // Tearing occurs at this line

 GUI_MULTIBUF_End();


With the code above the bitmap should appear after GUI_MULTIBUF_End().

Where a do you call this code?

If you call it from within a WM_PAINT case of a window callback there is no need to call any multi buffering API. Just call WM_MULTIBUF_Enable(1) before creating the first window and the window manager will take care about starting and ending (switching back and front buffers) of multi buffering.

Regards
Sven