Skip to main content
aki
Associate
April 16, 2014
Question

STemWin in landscape with Cube + STM32F429discovery

  • April 16, 2014
  • 18 replies
  • 3661 views
Posted on April 16, 2014 at 11:37

I'm having problems to produce correctly working landscape LCD with STemWin and STM32F429 discovery. I'm using STemWin_HelloWorld application from STM32Cube_FW_F4_V1.1.0 as a base for my tests. I don't need to rotate screen during run-time.

I have only changed display drivers in LCDConf from GUIDRV_LIN_32 to GUIDRV_LIN_OSY_32 to produce landscape screen. This results correctly oriented screen with correctly printed texts with GUI_DispStringAt(). But background and painting functions like GUI_FillCircle() will create three striped areas on top of each others. Looks like a synchronisation problem but haven't manage to sort it out. Furthermore wondering why texts are working correctly and drawings not. Changing physical size to 240x240 fixes the problem - except it's not full screen and 320 width.

https://scontent-a-ams.xx.fbcdn.net/hphotos-ash3/t1.0-9/10246499_672755232786025_2797032601679556975_n.jpg

.

Application code for this image:

  GUI_SetFont(&GUI_Font20_1);

  GUI_DispStringAt(''Hello world!'', (LCD_GetXSize()-100)/2, (LCD_GetYSize()-20)/2);

  GUI_DispStringAt(''0'', 0, 0);

  GUI_DispStringAt(''1'', 100, 0);

  GUI_DispStringAt(''2'', 200, 0);

  GUI_DispStringAt(''3'', 300, 0);

  GUI_DispStringAt(''A'', 0, 100);

  GUI_DispStringAt(''B'', 0, 200);

  GUI_DispStringAt(''C'', 0, 300);

  GUI_FillCircle(100, 100, 10);

Any ideas to fix this problem?

    This topic has been closed for replies.

    18 replies

    Noppe.Jack
    Senior
    May 30, 2014
    Posted on May 30, 2014 at 13:35

    Hi,

    Sorry for not including it in the previous post :)  Here it is ...  

    http://i111.indigo.fastwebserver.de/index.php?page=Thread&postID=5860#post5860

     

    Thanks for looking into this,

    J

    Noppe.Jack
    Senior
    June 16, 2014
    Posted on June 16, 2014 at 15:59

    Hi :)  Have you by any chance had an opportunity to look into this some more?

    Tx.

    mats23
    Associate III
    August 7, 2014
    Posted on August 07, 2014 at 22:53

    Hi,

    has there been any progress on this?

    /M

    Noppe.Jack
    Senior
    August 15, 2014
    Posted on August 15, 2014 at 20:31

    I just updated to the latest version of STM32Cube (which use Stegger 524b libraries) and the problem persists.

    Out of desperation, I implemented

    HAL_LTDC_ErrorCallback(LTDC_HandleTypeDef *hltdc)

    and I get

    hltdc->ErrorCode == HAL_LTDC_ERROR_FU (Frame Under run)

    This error happens on the line:

     HAL_LTDC_ConfigLayer(&hltdc, &layer_cfg, LayerIndex); //when LayerIndex = 0

    In : LCD_LL_LayerInit(uint32_t LayerIndex)

    Of: LCDConf_stm32f429i_disco_MB1075.c

    Is the frame under run error a red-herring, and if not, any suggestions on configuration variables that would help correct this?

    franck23
    Associate III
    May 6, 2015
    Posted on May 06, 2015 at 11:02

    Hello

    Any update on the landscape bug?

    I have seen more threads reporting this issue, but we still don't know what the problem is.

    From Heisenberg answer, I do understand that the landscape mode is not possible (available?).

    It would be interesting to know where the problem comes from, so when starting a new project we can choose the right hardware and firmware to avoid getting stuck with a portrait orientation.

    Is it related to the ST implementation of emWin? Or is it the LCD driver?

    Would it be the same problem with a different LCD controller?

    etc...

    Thanks for any hint,

    Franck.

    eraycanli
    Associate III
    September 28, 2015
    Posted on September 28, 2015 at 15:11

    any solution to this problem so far??

    reserv70
    Associate II
    October 1, 2015
    Posted on October 01, 2015 at 19:54

    Hi! I try to change orentation of diplay in stm32f429-disco but take same bag (atrifaction) on display. 

      What is the problem??  I have last version of HAL.  How can I solve this problem? It is library problem or driver problem? 

    alessandro23
    Visitor II
    March 5, 2016
    Posted on March 05, 2016 at 15:20

    Hello,

    I experimented quite the same problem.

    While trying to rotate the screen on the STM32F429Disco with the GUIDRV_LIN_OSX_32 driver, images appear overlapped and/or with strange patterns in some zones.

    I was able to solve the problem by changing code in the file “

    LCDConf_stm32f429i_disco_MB1075.c

    �. I’m not sure, but I think there is a bug there.

    Here is my solution. In function “LCD_X_DisplayDriver�, I changed the following lines:

    case LCD_X_SETSIZE:

        GUI_GetLayerPosEx(LayerIndex, (int*)&xPos, (int*)&yPos);

        layer_prop[LayerIndex].xSize = ((LCD_X_SETSIZE_INFO *)pData)->xSize;

        layer_prop[LayerIndex].ySize = ((LCD_X_SETSIZE_INFO *)pData)->ySize;

        HAL_LTDC_SetWindowPosition(&hltdc, xPos, yPos, LayerIndex);

        break;

    to the followings:

      case LCD_X_SETSIZE:

        GUI_GetLayerPosEx(LayerIndex, (int*)&xPos, (int*)&yPos);

        if( LCD_GetSwapXYEx(LayerIndex) )

         {

           layer_prop[LayerIndex].xSize = ((LCD_X_SETSIZE_INFO *)pData)->ySize;

           layer_prop[LayerIndex].ySize = ((LCD_X_SETSIZE_INFO *)pData)->xSize;

         }

         else

          {

            layer_prop[LayerIndex].xSize = ((LCD_X_SETSIZE_INFO *)pData)->xSize;

            layer_prop[LayerIndex].ySize = ((LCD_X_SETSIZE_INFO *)pData)->ySize;

          }

        HAL_LTDC_SetWindowPosition(&hltdc, xPos, yPos, LayerIndex);

        break;

    Now everything is correctly displayed.

    Hope this will help other people to correct their problem.

    Kind Regards,

    Alessandro