Direct LCD frame buffer access when using STemWin?

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

  • Direct LCD frame buffer access when using STemWin?

    Hi folks,
    New to emWin here and I'm evaluating suitability for our application. We plan to use an STM32F4 family processor which uses a frame buffer that we can read/write directly. At present I am testing with the Discovery STM324x9I-EVAL kit and have modified one of the demos to use DMA to write live camera data to a 320x240 window on the 480x272 display. Will I be able to do that using emWin? On p 349 of the user reference and guide it states: "Warning: When not using the callback mechanism, it is user responsibility to manage screen updates!" Can I infer from that that a program can write directly to the screen buffer without invalidating the rectangle and using a library call to update the screen?

    The camera demo I modified updates the screen with 'video' at about 14 fps. The full featured (emWin based) demo performs the same function but stops the camera when a frame is ready, updates the screen and then restarts the camera. This results in about 4 fps.

    A second wrinkle in this is that the program I modified uses two screen buffers to avoid tearing during updates (camera DMA to one buffer while the screen is refreshed from the other.) I would need to code that into our application as well. If emWin does not directly support that, perhaps I can brute force it by copying the entire screen image (as produced by emWin) to the alternate buffer and swap buffers using lower level primitives. I would need to make sure that any emWin updates were copied to the alternate buffer, but I do not anticipate a problem with this as the screen decoration around the camera will be static.

    Before I proceed with the effort of coming up to speed on emWin I thought I would ask if these goals are even feasible. Suggestions on how best to do this and pointers to the appropriate sections of the manual or examples would be most welcome.

  • Hello,

    Yes, it is possible to write live camera data to a window. Yes, the frame buffer can be accessed directly, but then it remains the user's responsibility to avoid interdependencies with the Window Manager's drawing mechanism.

    Please understand that ST has an obligation to support their customers. I would recommend contacting ST for support in case. If you would prefer support from Segger, please contact

    Best regards,