cancel
Showing results for 
Search instead for 
Did you mean: 

strange HALT behaviour

fggnrc
Associate II
Posted on October 25, 2009 at 06:07

strange HALT behaviour

1 REPLY 1
fggnrc
Associate II
Posted on May 17, 2011 at 15:05

The following code shows a strange HALT instruction behaviour:

Code:

HALT_MCU

HALT

JRA HALT_MCU

Its meaning is simple: if something wakes up the STM8 core, the jump forces it to halt again.

When I debug my code with STVD7, the jump instruction is ignored.

To have the intended behaviour, I have to modify the code as:

Code:

HALT_MCU

HALT

NOP

NOP

JRA HALT_MCU

Why?

EtaPhi

PS: I'm debugging a STM8S207C8 with R-Link