Soft WDT reset while evaluating complex instructions
Posted: Sat May 07, 2016 5:27 pm
As soon as you combine 'simple' statements into one more complex one the interpreter seems to crash with a 'soft WDT reset'.
The following programm:
t = "01:00"
offset = -2
a = (offset+val(mid(t,1,2))+24)%24
t = right("0" & str(a),2) & mid(t,3,8)
evaluates correctly into t="23:00"
but if you substitute the formula for 'a' directly into the formula for 't' like
t = right("0" & str((offset+val(mid(t,1,2))+24)%24),2) & mid(t,3,8)
the ESP crashes and reboots:
Executing line Debug Statement
16 t = right("0" & str((offset+val(mid(t,1,2))+24)%24),2) & mid(t,3,8)
t
=
right(0
&
str((offset+val(mid(t,1,2))+24)%24),2)
&
Executing line Debug Statement
17 print a
Soft WDT reset
ctx: cont
sp: 3fff2220 end: 4021d735 offset: 01b0
>>>stack>>>
3fff23d0: 3fff2420 00000002 3fff2484 40228b4e
3fff23e0: 3ffe8d4c 0000000a 3fff2484 4021e002
3fff23f0: 3fff2654 00000000 3ffe9778 402280ec etc.
I didn't examine the code but I suspect reloading the WTD at each parsed keyword instead of each statement would solve the problem.
The following programm:
t = "01:00"
offset = -2
a = (offset+val(mid(t,1,2))+24)%24
t = right("0" & str(a),2) & mid(t,3,8)
evaluates correctly into t="23:00"
but if you substitute the formula for 'a' directly into the formula for 't' like
t = right("0" & str((offset+val(mid(t,1,2))+24)%24),2) & mid(t,3,8)
the ESP crashes and reboots:
Executing line Debug Statement
16 t = right("0" & str((offset+val(mid(t,1,2))+24)%24),2) & mid(t,3,8)
t
=
right(0
&
str((offset+val(mid(t,1,2))+24)%24),2)
&
Executing line Debug Statement
17 print a
Soft WDT reset
ctx: cont
sp: 3fff2220 end: 4021d735 offset: 01b0
>>>stack>>>
3fff23d0: 3fff2420 00000002 3fff2484 40228b4e
3fff23e0: 3ffe8d4c 0000000a 3fff2484 4021e002
3fff23f0: 3fff2654 00000000 3ffe9778 402280ec etc.
I didn't examine the code but I suspect reloading the WTD at each parsed keyword instead of each statement would solve the problem.