Hi. I'm using TI Hercules RM48 processor with ccs v5 and Halcogen to control some hardware. I understand that I could change the length of STACKS in sys_link.cmd file to control the size of the stack. I'm looking for a good and relatively pain free way to determine the size of the stack my program needs. So far, it's not that difficult because I know where the worst case scenario occurs and I could put a break point in the debugger to see addresses of local variables to get an idea of how big my stack size should be. But I'm afraid as my program grows, it may become hard for me to figure out where I should put my break point to estimate how big of the stack my program uses.
Besides initializing stack memory initially with known values and checking for the break in pattern, are there any good ways that the compiler or debugger provides that would assist programmer in determining a good stack size? For example, I heard a particular processor could automatically go to a break point in emulator if a stack pointer goes beyond user specified number. A mechanism like that would allow me to keep decreasing the size of stack until break point is hit.
Thank you all in advance.