Newbie problem with Logomatic V2 firmware

Using WinArm I’m trying to learn how to adapt the Logomatic to my application, I never programmed C.

Therefore I started adding some simple lines of code into main.c just to see what happens. So far so good.

Problem starts when adding new functions called from main such as:

void Somefunc(void)

{

int var1;

int var2;

char mystring[256];

…some code using sprintf sscanf strtok

}

The code will not run at all though compiling correctly.

I commented out the call to Somefunc but code still didn’t run.

So I commented out only calls to sprintf, sscanf and strok, no change.

Finally I commented out the routine Somefunc and the code ran again.

After guessing and testing for hours I found that the code will run if I increase the stack size in Startup.S to 0x01000 (original 0x0800).

Is this correct? Does an unused function use up stack? So much?

Thank you for any hint on what I doing wrong.

Matheus