baiangel wrote on Sunday, May 14, 2006:
Hi everyone!
I am using the AVR-GCC port of FREE-RTOS on ATMEGA128 with 32k external memory. I have set my heap size the follwoing way:
#define configTOTAL_HEAP_SIZE ( (size_t ) ( 10000 ) )
Then I have the following definitions and initializations:
xTaskCreate( Connect, "Connect", 200, NULL, CONNECT_ETHERNET_TASK_PRIORITY, NULL );
xTaskCreate( I_O, "I/O", 100, NULL, I_O_TASK_PRIORITY, NULL );
xTaskCreate( FIM1, "FP1", 300, NULL, FINGERPRINT1_TASK_PRIORITY, NULL );
xTaskCreate( FIM3, "FP3", 300, NULL, FINGERPRINT3_TASK_PRIORITY, NULL );
xTaskCreate( Controller, "CONTROL", 300, NULL, CONTROLLER_TASK_PRIORITY, NULL );
xTaskCreate( CheckAlive, "CHECK", 100, NULL, CHECKALIVE_TASK_PRIORITY, NULL );
xTaskCreate(Task_Report_Busy, "Busy", 100, NULL, REPORT_BUSY_PRIORITY, NULL);
Queue_Busy_Tasks = xQueueCreate(10, 1);
vSemaphoreCreateBinary(Controller_Node_Semaphore);
vSemaphoreCreateBinary( FIM1_Node_Semaphore); vSemaphoreCreateBinary( FIM3_Node_Semaphore); vSemaphoreCreateBinary( Server_Alive_Semaphore);
vSemaphoreCreateBinary( FIM1_Receive_Semaphore );
vSemaphoreCreateBinary( FIM3_Receive_Semaphore );
vSemaphoreCreateBinary(Sem_Controller_Ready);
vSemaphoreCreateBinary(Sem_FIM1_Ready);
vSemaphoreCreateBinary(Sem_FIM2_Ready);
vSemaphoreCreateBinary(Sem_FIM3_Ready);
vSemaphoreCreateBinary(Sem_FIM4_Ready);
vSemaphoreCreateBinary( Output4_Semaphore );
vSemaphoreCreateBinary( Output5_Semaphore );
After startig the scheduler, everything works just fine. But, when I increase the stack size of the tasks to let say 700 bytes each, the program crashes. Even when increasing the heap size to 20k (!!!), the program still crashes. The initialisation is correct to Sem_FIM3_Busy, after which the MCU restarts itself. The exatct function, where this happens is "vListInitialise( &( pxNewQueue->xTasksWaitingToReceive))", whcich is being called from "xQueueCreate";Is there any known issue in the RTOS or it is my mistake? I have checked the source 3 or 4 times and I still cannot see any memory overlapping problem or something similar. I would appreciate any oppinion. Tahnk you in advance!