thanks for your idea, and i test as your idea, but didn't find the reason, the stack is ok.
If I comment 2 big global array, then it is ok.
if I don't comment them, and I only init the 2 big global array at the startup, I don't call them when running, but it still be occur an error,
i check the map file, the global array is in the address:XDATA 000011A8 - 000011DD (0x36 bytes) and address: XDATA 000011DE - 000011F5 (0x18 bytes),
it is not in the Istack and Xstack.
one the global array is defined :
typedef struct
{
struct
{
U8 Ctrl; // campo de controle
U16 TAcc; // acumulador
U8 ResetTime; // tempo de reset
} Run;
struct
{
U16 maxVAL;
U16 minVAL;
U16 Ipickup; // corrente de pickup (ADC value)
U8 ResetTime; // tempo de reset (number of acquisitions on ADC)
U16 TDef; // tempo maximo definido (number of acquisitions on ADC)
} Config; // Relay configuration
// Variables for Relay Configuration during Transient State
U16 IpickupTrans; // pickup current (mA)
U16 ResetTimeTrans; // reset time (mS)
U16 TDefTrans; // time limit set(mS)
// Variables for Relay Configuration during Stationary State
U16 IpickupStat; // pickup current (mA)
U16 ResetTimeStat; // reset time (mS)
U16 TDefStat; // time limit set (mS)
U8 State; // Indicates if transient or stationary period is active
uint8 Enabled; // Indicates if current relay should be used or not
} TCurrentRelay;
TCurrentRelay gCurrentRelay[2];
my god, i can't understand it.