If we create a graphics window for GRAPHICS configuration with GUIBuilder for file GUI_App.c
CreateWindow();
The CubeMX is creates function in file STemwin_wrapper.c
void GRAPHICS_Init(void)
{
/* Initialize the GUI */
GUI_Init();
//WM_MULTIBUF_Enable(1);
/* Enable the multi-buffering functionality */
/* Activate the use of memory device feature */
/* USER CODE BEGIN WM_SetCreateFlags */
//WM_SetCreateFlags(WM_CF_MEMDEV);
/* USER CODE END WM_SetCreateFlags */
}
If you delete comments
WM_MULTIBUF_Enable(1);
/* Enable the multi-buffering functionality */
/* Activate the use of memory device feature */
/* USER CODE BEGIN WM_SetCreateFlags */
WM_SetCreateFlags(WM_CF_MEMDEV);
after this, the graphical interface stops running !!!
(Attention! After deleting comments and compiling, turn off and turn on the power)
The problem is solved by adding a line
WM_MULTIBUF_Enable(1);
/* Enable the multi-buffering functionality */
/* Activate the use of memory device feature */
/* USER CODE BEGIN WM_SetCreateFlags */
HAL_LTDC_ProgramLineEvent(&hltdc, 0); //!!!!!!!!!!!!!!!!!!!!!!!
WM_SetCreateFlags(WM_CF_MEMDEV);
/* USER CODE END WM_SetCreateFlags */
And everything works fine!
P.S.
If FREERTOS is used, it is necessary to eliminate one more bug
in file ..........STemWin\Target\STemwin_wrapper.c comment
line (85):
//extern volatile GUI_TIMER_TIME OS_TimeMS;
line (876) :
// OS_TimeMS++;
CreateWindow();
The CubeMX is creates function in file STemwin_wrapper.c
void GRAPHICS_Init(void)
{
/* Initialize the GUI */
GUI_Init();
//WM_MULTIBUF_Enable(1);
/* Enable the multi-buffering functionality */
/* Activate the use of memory device feature */
/* USER CODE BEGIN WM_SetCreateFlags */
//WM_SetCreateFlags(WM_CF_MEMDEV);
/* USER CODE END WM_SetCreateFlags */
}
If you delete comments
WM_MULTIBUF_Enable(1);
/* Enable the multi-buffering functionality */
/* Activate the use of memory device feature */
/* USER CODE BEGIN WM_SetCreateFlags */
WM_SetCreateFlags(WM_CF_MEMDEV);
after this, the graphical interface stops running !!!
(Attention! After deleting comments and compiling, turn off and turn on the power)
The problem is solved by adding a line
WM_MULTIBUF_Enable(1);
/* Enable the multi-buffering functionality */
/* Activate the use of memory device feature */
/* USER CODE BEGIN WM_SetCreateFlags */
HAL_LTDC_ProgramLineEvent(&hltdc, 0); //!!!!!!!!!!!!!!!!!!!!!!!
WM_SetCreateFlags(WM_CF_MEMDEV);
/* USER CODE END WM_SetCreateFlags */
And everything works fine!
P.S.
If FREERTOS is used, it is necessary to eliminate one more bug
in file ..........STemWin\Target\STemwin_wrapper.c comment
line (85):
//extern volatile GUI_TIMER_TIME OS_TimeMS;
line (876) :
// OS_TimeMS++;





