On Mon, Jul 29, 2013 at 01:47:14PM -0700, ravim wrote: > Really appreciate your response. > > I will try to do what you have suggested. Issue is we fear that so much is > happening in our code too fast (flash write, blacklist check, then > communication with different devices etc), we fear we might be corrupting > stack somehow with so many global and local variables. > > Is there any way through which we can figure out what is actually happening > (read the stack etc), why things go smooth for an hour or so. If we change > sampling window, timing varies but eventually, it will stop.
If you suspect that you're overflowing the stack, you might want to try writing a block of test data at the end of the data section. If the stack gets too large, this data will get overwritten first. Periodically check it to see if the contents have changed. If so, halt and indicate the problem somehow. You might also find the -fstack-usage compiler option useful. This will emit information in .su files for every .o, containing information on the size of each function's stack frame. For one project (AVR though, not MSP430) I wrote a quick and dirty script to assemble a call graph and figure out the peak stack size: http://dlbeer.co.nz/oss/avstack.html It could probably be modified easily for MSP430 (change $objdump to "msp430-objdump" for starters), but obviously this technique is only going to work if your call graph is acyclic. - Daniel -- Daniel Beer <dlb...@gmail.com> www.dlbeer.co.nz IRC: inittab (Freenode) PGP key: 2048D/160A553B ------------------------------------------------------------------------------ Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk _______________________________________________ Mspgcc-users mailing list Mspgcc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mspgcc-users