RAM corrupted battery backed system

Now i have detected the following situations:

  • Code is in FARCODE segment but funtions are not declare as far
  • the extern of variables in segments are not write in #pragma
    #pragma SEG(BSS,BB_BSS)
    extern int current_state;
    extern error_log ErrorLog[];
    #pragma SEG(BSS)
    (i read that it could be a problem)

Can this think produce a ramdom write of ram ???

hi, i�m working over a rabbit system with flash(512K) and RAM(512K) battery backed.
Sometimes, random, the Ram memory has some data (NOT all) change on start when you plug to power the system.
I�m using softools compiler.

the var TEMP1 only was sometimes with different value on power up
#pragma seg (FARDATA,CREDITO)
far long TEMP1= 0;
far unsigned long TEMP2= 0;
far long TEMP3= 0;
far long TEMP4= 0;
far unsigned long TEMP5= 0;
far unsigned long TEMP6= 0;
#pragma seg (FARDATA)
i don�t write it in code, battery charge is fine.
i read about a bug in the micro TN302.pdf and i wonder if that could be happend to me for example:
ioi ld a,(176)
;135 outi (TBM1R,offset >> 2);
.debug # 135
ld hl,(@21)

          ioi ld	(179),a

;137
;138 offset += 1023;
.debug # 138
ld de,0x3ff
add hl,de
this lines are from the .asm files generated by the compiler.
i hope you can help me
thanks