Screen Flickering problem while pressing TAB KEY

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Screen Flickering problem while pressing TAB KEY

      Hello everyone

      I created simple GUI with GUIBUILDER app (window with background color and two buttons).
      Keyboard events is passed to emwin by GUI_StoreKeyMsg() function(inside the keyboard external interrupt routine) and all of program is in the super loop that execute every 30 mili second.
      By pressing TAB Key buttons is respectively get focused but this cause screen to flicker.

      I use STM32F407 with internal RAM (120 KB of RAM is dedicated to emwin) and ili9341 LCD Controller.

      Can anyone help me to find problem?

      Thanks in advance
    • Hi,

      Please try to use a cached version of the driver. When initializing the driver use a mode which has 'C1' in its name, like:

      GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66709, GUIDRV_FLEXCOLOR_M16C1B8);

      Of course, such a cache requires some memory. With 16bpp and a screen size of 320x240 pixel it would be ~155KB.

    • Hello Sven, Thank you for replying.
      According to your estimation 155 KB memory is needed for 320×240. My MCU has 192 KB of RAM, but it is splitted into two region(128 KB RAM and 64 KB CCMRAM) that aren't continues in the memory map:
      CCMRAM ORIGIN: 0X10000000 LEBGTH = 64KB
      RAM ORIGIN: 0X20000000 LENGTH = 128KB

      Is there anyway to use this kind of memory for Emwin?

      The post was edited 1 time, last by Haia_Boosa ().

    • Hi,

      Unfortunately, this won't be possible.

      You could also try to use automatic memory devices for drawing operations of windows/widgets.

      To do you call WM_SetCreateFlags(WM_CF_MEMDEV) before GUI_Init(). Call it before to make sure the background window makes use of them, too.

      Be aware that this can have an impact on the performance due to a drawing overhead (at first emWin writes into the memory device and then the device gets drawn to the screen). You should also know that, if there is not enough memory available to create a memory for a complete window, emWin will use banding and splits the drawing operation into multiple ones.

      Just take a look into the manual in chapter ' Automatic use of Memory Devices' for more information

      First choice to avoid flickering should be always multi buffering or a cahced driver (depends on the driver you are using).