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){
for(;;){
do_interface_doUpdate();
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: