Hi
Environment: emWin + MDK + MDK-RTOS + STM32F429NI.
After creating many windows/handles I'm getting a HardFault when I call WM_SetUserData. hWin is around 300 (not always the same). I've commented out the code calling the crash point but all that happens is the next new window fails when it tries to set the user data. I developed the code under embOS-SIM on Win32 and it works fine there so I suspected the problem may be GUI_Conf memory allocation but I doubled the allocation and made sure both (emWinSim and MDK) are the same (0x01000000 of uint32_t).
Unfortunately I'm bringing the board up for the first time and do not yet have emSpy going.
Is there a limit in MDK emWin to the number of windows/handles?
Do you have any suggestions to point me in a direction which may help me solve this?
Thanks
Mark
Display All
Environment: emWin + MDK + MDK-RTOS + STM32F429NI.
After creating many windows/handles I'm getting a HardFault when I call WM_SetUserData. hWin is around 300 (not always the same). I've commented out the code calling the crash point but all that happens is the next new window fails when it tries to set the user data. I developed the code under embOS-SIM on Win32 and it works fine there so I suspected the problem may be GUI_Conf memory allocation but I doubled the allocation and made sure both (emWinSim and MDK) are the same (0x01000000 of uint32_t).
Unfortunately I'm bringing the board up for the first time and do not yet have emSpy going.
Is there a limit in MDK emWin to the number of windows/handles?
Do you have any suggestions to point me in a direction which may help me solve this?
Thanks
Mark
Source Code
- GUI_HWIN WMX_CreatehWin(WMX* pX, WMX* pP) {
- if (pP > 0) {
- pX->hWin = WM_CreateWindowAsChild(
- 0, 0, WMX_DEFAULT_WIDTH, WMX_DEFAULT_HEIGHT,
- hWinX(pP),
- WM_CF_HIDE,
- _cb,
- sizeof(WMX*));
- }
- else {
- pX->hWin = WM_CreateWindow(
- 0, 0, WMX_DEFAULT_WIDTH, WMX_DEFAULT_HEIGHT,
- WM_CF_HIDE,
- _cb,
- sizeof(WMX*));
- }
- WM_SetUserData(pX->hWin, &pX, sizeof(WMX*));
- return pX->hWin;
- }