I'm working Renesas at this time and can't test myself. someone asked me a Keil ''51 question I can't nswer: "can you use xdata for local variables.
I guess the answer is no, (the call tree) if someone has the answer, please let me know
Erik
that a given function works 'strange' if a local variable is in xdata.
Once they come up with a more useful description than 'strange', odds are the actual mistake will be revealed as something almost entirely unrelated to this.
Off the cuff, my first two guesses would be: another xdata variable in the vicinity has a buffer over-/underrun, or less than ideal coding practices (function pointers on a '51, calling functions from interrupts, ...) managed to break the automatic data overlaying mechanism. Time to break out the debugger and see whether all writes to that variable (or set of overlayed variables) come from where they should be.