freertos with emwin on stm32

jimmjimm wrote on Tuesday, May 06, 2014:

Hi, i’m new for rtos when i try to run my application with FreeRTOS i got a problem that i cant fix:
i try to run all my application without emwin gui the program works fine but when i add emwin task the program works few loops then goes into hardwarefault.
i comment all other task only run emwin task it works fine but when i add delay in emwin task like following code the program goes into hardwarefault too.
updated: i tired to hardware restart my board with above situations it looks about 20% chance that program will works and 80% with hardware fault. but if only run emwin gui without time delay the program is always work. i start to check if my board problem.

#void task_interface_doUpdate(void *pvParameters){



vTaskDelay( 10 / portTICK_RATE_MS );



my mcu is stm32f407zg i read many information about use freertos on stm32 and some program worked without emwin gui. i opened stack overflow & malloc fail hook looks not that problem

i increased stack size into 20k heap size into 25k rtos heap size into 30k but still not work

i tried to trace how the fault happen it look when i try to refresh screen the fault happened but the refresh API is packed in emwin so i cant trace it deeper

i create emwin task with following code same with other tasks
#xTaskCreate( task_interface_doUpdate, “interface_doUpdate”,configMINIMAL_STACK_SIZE*8,NULL, interface_Task_PRIO, &interface_Handle );
which stack size is 4k prio is 7 it should be fine

i tried use heap_1/2/4 file to manage memory, all failed

any can give me any idea how to fix it? thanks

i create task of emwin with following code:

tectu66 wrote on Tuesday, May 06, 2014:

I know that this is not related to your question but the uGFX project (Free and open embedded GUI) is currently heavily searching for volunteers to test our brand new FreeRTOS port.
Probably you’re interested?

~ Tectu

jimmjimm wrote on Thursday, May 08, 2014:

anyone can help?

rtel wrote on Thursday, May 08, 2014:

Sorry - I have never used emWin so don’t know what to look for. The only advice I can provide is the normal STM32 stuff - make sure you are using a recent version of FreeRTOS to take advantage of the additional configASSERT() statements that were inserted to catch the most common misconfiguration issues - V7.6.0 or higher (and of course make sure configASSERT() is actually defined to something that will make you notice when it is called).