I am trying to build a project that runs emWin from a single FreeRTOS task on an LPC4357 platform. Unfortunately, my project hardfaults after a few minutes.
I started by building a project that ran emWin as a standalone application. That project runs fine without any issues. I then modified the GUI_X.c file to use the FreeRTOS timing:
my GUI task is currently the only task that I am using
I stripped my GUI task down so that all it creates is a frame window
Display All
The application will run for a minute or two before hard faulting with INVPC ("Invalid PC load Usage Fault, caused by an invalid EXC_RETURN value:"). This seems to occur on the return from SVC within the yield function. My first thought was a stack overflow. However I have since expanded both the main stack used by ISRs and the task stack and added some stack monitoring. Neither stack appears to overflow.
Has anyone encountered a similar problem and if so, how did you resolve it?
I started by building a project that ran emWin as a standalone application. That project runs fine without any issues. I then modified the GUI_X.c file to use the FreeRTOS timing:
my GUI task is currently the only task that I am using
I stripped my GUI task down so that all it creates is a frame window
Source Code
- static const GUI_WIDGET_CREATE_INFO _aFrameWinControl[] =
- {
- { FRAMEWIN_CreateIndirect, "Control", 0, 0, 0, LCD_WIDTH, LCD_HEIGHT, 0, 0 },
- };
- static void _cbFrameWinControl(WM_MESSAGE* pMsg)
- {
- int xSize, ySize;
- switch(pMsg->MsgId)
- {
- case WM_INIT_DIALOG:
- break;
- case WM_PAINT:
- xSize = WM_GetWindowSizeX(pMsg->hWin);
- ySize = WM_GetWindowSizeY(pMsg->hWin);
- GUI_DrawGradientH(0, 0, xSize - 1, ySize - 1, 0xFFFFFF, 0xDCCEC0);
- break;
- default:
- WM_DefaultProc(pMsg);
- }
- }
- void tskGUI(void *pvParameters)
- {
- GUI_Init();
- WM_SetCreateFlags (WM_CF_MEMDEV);
- WM_SetDesktopColor(GUI_BLACK);
- GUI_CreateDialogBox(_aFrameWinControl, GUI_COUNTOF(_aFrameWinControl), &_cbFrameWinControl, WM_HBKWIN, 0, 0);
- while (1)
- {
- GUI_Delay(10);
- }
- }
The application will run for a minute or two before hard faulting with INVPC ("Invalid PC load Usage Fault, caused by an invalid EXC_RETURN value:"). This seems to occur on the return from SVC within the yield function. My first thought was a stack overflow. However I have since expanded both the main stack used by ISRs and the task stack and added some stack monitoring. Neither stack appears to overflow.
Has anyone encountered a similar problem and if so, how did you resolve it?