Hello and welcome to the fora, abdallah.
Unfortunately there is one or both of two problems here. You have written your code in a very inefficient way or you chose the wrong device to implement your project in.
The only way to run a safe stack with a very limited size is to ensure your stack allocated variables and your depth of function calls/subroutine nesting is limited to within that size. You need to be wary of interrupts occurring on top of this as well.
There are many discussions here on this forum about measuring the required stack depth. Basically it involves programming some kind of pattern into the memory used by the stack. running the code and excercising it to use all of the functions in all possible scenarios and then checking how much of the patterned memory has been overwritten.
Good Luck!