diff --git a/drivers/jtaglib_cpu16.c b/drivers/jtaglib_cpu16.c index cbebeba..989fbf3 100644 --- a/drivers/jtaglib_cpu16.c +++ b/drivers/jtaglib_cpu16.c @@ -3,9 +3,6 @@ #include "jtaglib_defs.h" #include "output.h" -// FIXME: -// * stepping works only once. or maybe sometimes never. - /* Set target CPU JTAG state machine into the instruction fetch state * return: 1 - instruction fetch was set * 0 - otherwise @@ -693,6 +690,8 @@ static void jlf16_single_step( struct jtdev *p ) { // libmsp430 BIOS name: SingleStep unsigned int loop_counter; + jlf16_set_instruction_fetch(p); + /* CPU controls RW & BYTE */ jtag_ir_shift(p, IR_CNTRL_SIG_16BIT); jtag_dr_shift_16(p, 0x3401); @@ -713,6 +712,8 @@ static void jlf16_single_step( struct jtdev *p ) jtag_ir_shift(p, IR_CNTRL_SIG_16BIT); jtag_dr_shift_16(p, 0x2401); + jlf16_set_instruction_fetch(p); + if (loop_counter == 0) { /* timeout reached */ printc_err("jtaglib_cpu16: single step failed\n");