diodedan wrote on Saturday, August 01, 2009:
Hi all,
I am using an Atmel atmega 128 running at 16 MHz. The settings are as follows:
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 16000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 500 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 3 )
#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 85 )
#define configTOTAL_HEAP_SIZE ( (size_t ) ( 2000 ) )//Atmega 128 has 4kbyte of SRAM (about half now)
#define configMAX_TASK_NAME_LEN ( 8 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 1
#define configIDLE_SHOULD_YIELD 1
#define configQUEUE_REGISTRY_SIZE 0
I’ve been able to get three tasks to work. However, this crazy problem happens where after some time, two of the tasks fail, but the third task continues to operate. This problem seems indicative of a memory leak!
My question becomes: how does one prevent this leak? I’ve been using static variables in my local functions. Also, the tasks call other functions. Could the stack overflow from this?
Any hints/personal experiences?
Thanks much,
diodedan