I am attempting to build a FreeRTOS project on an LPC4357 (M4 core) that includes a task running emWin.
The emWin code runs fine in a standalone environment, but when I place it within a task it will run for a few minutes and then hard fault.
emWin is configured to be called from only one task and the only difference between the two emWin ports is that FreeRTOS provides the timing (i.e. GUI_X_Delay calls vTaskDelay instead of using the system timer to increment a counter and looping on that counter to reach a timeout value as in the standalone version).
The emWin task is the only task running.
I am using Atollic TrueSTUDIO which includes a tool to take you directly to the source of a hard fault. This always takes me to the call to DSB within vPortYield when the fault occurs.
void vPortYield( void )
/* Set a PendSV to request a context switch. */
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
/* Barriers are normally not required but do ensure the code is completely
within the specified behaviour for the architecture. */
__asm volatile( “dsb” );
__asm volatile( “isb” );
Any ideas what might be the cause?