2009-02-18 08:02 PM
GLOBAL and LOCAL variables with IAR EWARM ?
2009-02-09 04:32 AM
2009-02-10 12:14 AM
Variables may APPEAR to be corrupted when single-stepping through code in debugger at high optimization levels.
Local variable corruption can be caused by stack overflow. Careless memory manipulation with pointers can cause this too.2009-02-17 05:47 AM
Thank you for reply my post.
To avoid optimizations issues, I have dissabled ALL optimizations (now is runnig with ''NONE for best debug'') Regarding stack size, I use this, -D_CSTACK_SIZE=1000 -D_SVC_STACK_SIZE=100 -D_FIQ_STACK_SIZE=100 -D_ABT_STACK_SIZE=100 -D_UND_STACK_SIZE=100 -D_IRQ_STACK_SIZE=800 -D_HEAP_SIZE=800 I think it is enought for my purposse. I have noted this issue in several differents functions and situations. Allways is caused by the same, a ''corrupted local variable''. Are there anything that I can do ? Really I dont know what to do. Really desperating... :-Y Ideas are wellcome, Thanks ALFA2009-02-18 05:58 AM
There are ways to measure stack usage in target MCU. The way I like to do it is like this: in startup code, fill stack with fixed pattern (say, 0xDEADBEEF, or whatever), let the program run for a while, preferably reproducing the bug, pause the program and inspect stack space - the used stack space will have the fixed pattern overwritten.
Or you can try increasing stack space dramatically: if it doesn't help, it's probably something else then.2009-02-18 06:20 AM
2009-02-18 08:02 PM
Sorry, I have no time for this.
Maybe you should read some manuals? That's what I normally do, anyway...