Strange Error on Stm32F469I Discovery Board with Delays after GUI_Init()

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

    • Strange Error on Stm32F469I Discovery Board with Delays after GUI_Init()

      Hello everyone,
      I am develop an application on a STM32F469I Discovery Board with StemWin Graphics on Keil MDK uVision 5.24.
      The tests with firmware examples worked well, but I get strange problems when I change to the CubeMX front end.
      It's impossible to write text to the Display, if after GUI_Init any Delays (GUI_Delays, HAL_Delays, Large Loop, etc.) greater 20 ms occour.
      I reduce the Problem at a very simple test program:
      · Create new Project with CubeMX 4.25 for the STM32F469I Discovery Board with all default settings.
      · Generate Code for Keil MDK 5.24
      · Change in GUI_App.c



      void GRAPHICS_MainTask(void) {
      GUI_Init();
      GUI_Clear();
      GUI_SetColor(GUI_WHITE);
      GUI_SetFont(&GUI_Font32_1);
      GUI_GotoXY(100,100);
      GUI_DispString("Hello world!");
      GUI_Exec();
      GUI_Delay(100);
      GUI_GotoXY(100,200);
      GUI_DispString("BAD ERROR"); // Text is on the Display if Delay < 20, Delay = 30 show turncated text
      GUI_Exec();

      while(1)
      {
      HAL_GPIO_TogglePin(LED3_GPIO_Port, LED3_Pin);
      GUI_Delay(500);
      }
      }


      I would be very grateful if someone had a solution.
      The CubeMX project file is attatched below.

      Lot of thanks!
      Files
      • Project.ioc.zip

        (8.88 kB, downloaded 55 times, last: )
    • Hello !
      I would not write your code that way, the GUI_exec must be call continously :

      Source Code

      1. void GRAPHICS_MainTask(void) {
      2. GUI_Init();
      3. GUI_Clear();
      4. GUI_SetColor(GUI_WHITE);
      5. GUI_SetFont(&GUI_Font32_1);
      6. GUI_GotoXY(100,100);
      7. GUI_DispString("Hello world!");
      8. GUI_GotoXY(100,200);
      9. GUI_DispString("BAD ERROR"); // Text is on the Display if Delay < 20, Delay = 30 show turncated text
      10. while(1)
      11. {
      12. HAL_GPIO_TogglePin(LED3_GPIO_Port, LED3_Pin);
      13. GUI_Exec();
      14. GUI_Delay(100);
      15. }
      16. }
      Display All
    • Hi,

      Are you using an OS?

      Take a look into sub 'set of project files\Middlewares\ST\STemWin\OS\'. There are two files one for an OS (FreeRTOS) and another file for emWin usage without OS.

      If you are using the one without OS you have to implement a timer which counts up the variable 'OS_TimeMS'.

      You can initialize the timer in GUI_X_Init(). If you don't use a timer which counts up 'OS_TimeMS' your delays won't work properly. No time based functionality will work without properly implemented GUI_X_GetTime() and GUI_X_Delay().

      Regards
      Sven