cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F469Disco: Strange Behavior when exiting and reentering WM / DialogBoxes several times

Sven1
Associate II

Hello,

I am working on a project with a STM32F469 Disco using STemWin.

For configuration of a lot of settings I have designed a GUI menu structure with about 10 different windows created by the emWin GUIBuilder.exe.

Jumping between these windows works fine.

After configuring is finished I am starting one the main tasks of the program by pressing a GUI-Button in my GUI-main-menu.

Cause I don't want to have undefined delays by the dialogs in my main tasks, I am exiting the windows-manager with:

GUI_EndDialog(pMsg->hWin, 0);

hItem = pMsg->hWin;

WM_DeleteWindow(hItem);

GUI_Clear();

Within the main task I write some text directly to the LCD by: GUI_DispStringAt.. or GUI_DispDecAt...

After the main task is done I reenter the GUI by:

GUI_Exit();

HAL_Delay(100);

GUI_Init();

...and then start the GUI again by: hWin = GUI_CreateDialogBox...

This works also fine for exactly 9 times.

When the GUI is reentered the 10th time, I won't work again.

The funny thing is, that the GUI does not really crash in a hardfault or so. It is still running and shows me, that I press a GUI-button by changing the color of it. But the code which is written in the "case WM_NOTIFICATION_RELEASED..." section is not executed anymore. (...but it worked for the first 9 times...)

This also happens if I start different main tasks with different buttons. Exactly after 9 starts together (for example 4x task 1 and 5x tast 2) it stucks.

When I halt the program by the debugger I find it always in

void GUI_X_Delay(int ms)

{

 int tEnd = OS_TimeMS + ms;

 while ((tEnd - OS_TimeMS) > 0);

}

It seems, that it doesn't come to the

static void _cbDialog(WM_MESSAGE * pMsg) { ....

anymore.

Does anybody has an idea to solve this issue?

The values of

GUI_ALLOC_GetNumUsedBytes()

GUI_ALLOC_GetNumFreeBytes()

stays constant for all the 9 cycles

I just updated to the latest STemWin. I work with Atollic on a Win10 PC.

Thanks for your replies

0 REPLIES 0