stm32f429i discovery problem with STemWin (LCD landscape mode)

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

  • stm32f429i discovery problem with STemWin (LCD landscape mode)

    When using the BASIC_HelloWorld.c demo program supplied by ST and the IAR for ARM (EWARM) environment I have a "ghosting/garbage" problem when in landscape mode. It works fine in portrait mode.
    The only change I make in the project is #define DISPLAY_DRIVER_0 GUIDRV_LIN_OSX_32.

    I see other posts in this forum going back a year with no apparent resolution to this issue. I suspect that it is an issue with the demo board port (DMA?) and not specifically with emWin.

    thanks for any help,
    John

  • Hi John

    here for you a reference, before you enter your maintask to draw in landscape, execute below source code.


    GUI_SelectLayer(1);
    GUI_SetOrientation(GUI_SWAP_XY | GUI_MIRROR_Y);
    TS_Orientation = 1;

    I also practice on stm32-discovery board, it works for me.
    thanks.

    BR, Titan.Chen
  • Thanks for the reply.
    I have only 1 layer. There is no TS_Orientation in my project. And I already tried GUI_SetOrientation(GUI_SWAP_XY | GUI_MIRROR_Y); with no success.

    More information:

    #define LCD_SWAP_XY and #define LCD_MIRROR_Y are unused in any of the source and setting to 0 or 1 makes no difference.
    When I rotate using #define DISPLAY_DRIVER_0 GUIDRV_LIN_OSX_32 the text rotates and displays, but I get extra garbage on the screen, and draw or fill rectangles just leave garbage all over.
    When I rotate using the 9341 register 0x36=0xB8, the text and draws work fine, but the display is cut off at the 240 pixel area and the left side of the display has some garbage.

  • To rotate the screen you need to set the correct X and Y physical resolution.

    Here is my GUIDRV_stm32f429i_discovery.c

    Take special attention to

    C Source Code

    1. // Physical display size//
    2. #define XSIZE_PHYS 240 #define YSIZE_PHYS 320


    and

    C Source Code

    1. #define COLOR_MODE_0 _CM_RGB888//
    2. // Layer size
    3. //
    4. #define XSIZE_0 320
    5. #define YSIZE_0 240
    6. /*********************************************************************
    7. *
    8. * Layer 1
    9. */
    10. #define COLOR_MODE_1 _CM_RGB888
    11. //
    12. // Layer size
    13. //
    14. #define XSIZE_1 320 #define YSIZE_1 240
    Display All


    Although I modified it here and there, a quick diff should show you what to do.
    Files
  • Almost there. Your file is from 2013 mine is the latest from 2015...completely different.
    I changed:
    #define DISPLAY_DRIVER_0 GUIDRV_LIN_OSX_32


    LCD_SetVSizeEx(0, XSIZE_0, YSIZE_0 * NUM_VSCREENS);
    and added the defines for XSIZE_0 and YSIZE_0

    The text is now in Landscape mode and the display is sized correctly for using the whole area.
    The only problem I now have is that the DRAW and FILL Rectangle routines garbage up the screen.