How to set stack depth

As the title states, I would like to know :
a) how to set the stack depth, in a new project
b) how to detect boundary violations of the stack.

Thanks for any answer

More questions in this forum