IAR 3.2 eeprom bug

Bali Zoltan eltexto at freemail.hu
Wed Nov 9 07:38:21 CET 2005


Hali !

Nálam is hasonló mentés van a végén végtelen ciklussal.
(4.10B-2)
IT- ben van a mentés a végén   while(1); -el.
Próbáld meg egyszer ezt. Nálam jól müködik
max. opt.-al.


Üdv  Zoli




----- Original Message -----
From: Fuzesi Arnold
To: elektro at tesla.hu ; Retro at lists.tmp.hu ; avr-hun at x-dsl.hu
Sent: Tuesday, November 08, 2005 11:08 PM
Subject: Re: IAR 3.2 eeprom bug


Közben a 4.1-el is előjött. Kezdtem ideges lenni... aztan olyan helyen futottam a hibaba, amire nem szamítottam:

Ezt nezzetek:

A // -el jelolt resz az eredeti C forras.

//  129 void exception(uint line)
exception:
//  130 {
//  131  slong temp;
//  132  __watchdog_reset();
        WDR
//  133
//  134  if(exception_log[line]<1000) exception_log[line]++;
        LDI R18, LOW(exception_log)
        LDI R19, (exception_log) >> 8
        LSL R16
        ROL R17
        ADD R18, R16
        ADC R19, R17
        MOVW R21:R20, R19:R18
        RCALL __eeget16_16
        CPI R16, 232
        LDI R20, 3
        CPC R17, R20
        BRCC ??exception_0
        SUBI R16, 255
        SBCI R17, 255
        MOVW R21:R20, R19:R18
        RCALL __eeput16_16
//  135
//  136  temp=gettimer(TMR_MONOSTABLE);
??exception_0:
        LDI R16, 5
        LDI R17, 0
        RCALL gettimer
//  137
//  138     if(ee_tmr_monostable!=temp) ee_tmr_monostable=temp;            !!!!!!!!!Hoppáááá - nincs asm kód hozzá :)
//  139     if(cfg.ee_netalarm_no) ee_netalarm_no=cfg.netalarm_no;         !!!!!!!!!Hoppáááá - ehhez sem... :-/
//  140
//  141  for(;;);            //wait for WDT reset
??exception_1:
        RJMP ??exception_1
//  142
//  143 }


Ha mókolok kicsit:

//  129 void exception(uint line)
exception:
//  130 {
        RCALL ?PROLOGUE4_L09
//  131  slong temp;
//  132  __watchdog_reset();
        WDR
//  133
//  134  if(exception_log[line]<1000) exception_log[line]++;
        LDI R18, LOW(exception_log)
        LDI R19, (exception_log) >> 8
        LSL R16
        ROL R17
        ADD R18, R16
        ADC R19, R17
        MOVW R21:R20, R19:R18
        RCALL __eeget16_16
        CPI R16, 232
        LDI R20, 3
        CPC R17, R20
        BRCC ??exception_0
        SUBI R16, 255
        SBCI R17, 255
        MOVW R21:R20, R19:R18
        RCALL __eeput16_16
//  135
//  136  temp=gettimer(TMR_MONOSTABLE);
??exception_0:
        LDI R16, 5
        LDI R17, 0
        RCALL gettimer
        MOVW R25:R24, R17:R16
        MOVW R27:R26, R19:R18
//  137
//  138     if(ee_tmr_monostable!=temp) ee_tmr_monostable=temp;
        LDI R22, LOW(ee_tmr_monostable)
        LDI R23, (ee_tmr_monostable) >> 8
        MOVW R21:R20, R23:R22
        RCALL __eeget32_16
        CP R16, R24
        CPC R17, R25
        CPC R18, R26
        CPC R19, R27
        BREQ ??exception_1
        MOVW R17:R16, R25:R24
        MOVW R19:R18, R27:R26
        MOVW R21:R20, R23:R22
        RCALL __eeput32_16
//  139     if(cfg.ee_netalarm_no) ee_netalarm_no=cfg.netalarm_no;
??exception_1:
        LDS R16, (cfg + 119)
        TST R16
        BREQ ??exception_2
        LDS R16, (cfg + 24)
        LDI R20, LOW(ee_netalarm_no)
        LDI R21, (ee_netalarm_no) >> 8
        RCALL __eeput8_16
//  140
//  141     __delay_cycles(1);                                             !!!!!!!!Ezt betettem, es megjavult...
??exception_2:
        NOP
//  142  for(;;);        //wait for WDT reset
??exception_3:
        RJMP ??exception_3
//  143
//  144 }


Ez most BUG?

A for(;;); ele akar mit tehetek, a törzsébe is. Ha nem vmi függvénynek látszó dolog, akkor kioptimalizalja az előtte levő eeprom
írást...
Low optimalizacional hagyja egyedul benne...felette kuka.

Hümm...

Arnold





More information about the Elektro mailing list