If you try and store an array on the stack then the stack will have to be much larger than the size of the array itself. It is best to avoid putting arrays on the stack if the array is more than a few bytes. If the function does not have to be reentrant, then just declare the array static.
Oops! My bad! I was a bite too fast on the keys, the array is not declared in the task, buf in a seperate file.
The arrays are accesed by pointers in the tasks.
usart.h
#define bufSize 512
struct bufStruct
{
u16 head;
u16 tail;
u8 buf[bufSize];
};
static struct bufStruct t = { 0, 0, };
static struct bufStruct r = { 0, 0, };
e.g in a task:
struct bufStruct *p = &r;
u8 valueInBuf = p->buf[p->head];