Re: What can i do for resolve AddressERROR and StackERROR other than restart controller?
Many reasons so try setting a breakpoint in the trap's ISR and single step back out of that. I should take you to where the trap originated.
Stack error is normally problems with how parameters are passed where a function ends up writing into the stack area rather than to somewhere else via a 'reference'. (e.g. the caller passes a reference to an array which takes one location on the stack for the pointer, but the function code treats the variable as a 'value' on the stack and therefore writes to the stack space.)
Address errors can easily be pointers allowing values to be written anywhere - including non-existant memory.
Of course these can both be mixed up together.