OpenOCD single stepping timeout too low

OpenOCD JTAG debugging with the Bus Pirate.

OpenOCD single stepping timeout too low

Postby linc » Fri May 10, 2013 3:10 pm

Here's the problem I have when using JTAG over Bus Pirate v3.a (firmware v6.3-beta1 r2088) under OpenOCD 0.7.0 (but also with 0.6.1). The target is the Panda Board (OMAP4430 with Cortex-A9).
Whenever I was trying to invoke the step command (in a telnet session to OpenOCD), it failed with the following message:
Code: Select all
target state: halted
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0x600001d3 pc: 0xbff90654
MMU: enabled, D-Cache: enabled, I-Cache: enabled
Error: timeout waiting for target halt
in procedure 'step'

Once this happens, no single stepping is possible anymore until the debug session is restarted (rebooting the target platform). Furthermore resume also fails with the following message making no further progress:
Code: Select all
target state: halted
target halted in ARM state due to breakpoint, current mode: Supervisor
cpsr: 0x600001d3 pc: 0xbff90654
MMU: enabled, D-Cache: enabled, I-Cache: enabled

Thus my current workaround is just increasing the timeout value in the step handling procedure:
Code: Select all
   long long then = timeval_ms();
   while (target->state != TARGET_HALTED) {
      retval = cortex_a8_poll(target);
      if (retval != ERROR_OK)
         return retval;
      if (timeval_ms() > then + 3000) { //here was + 1000 before
         LOG_ERROR("timeout waiting for target halt");
         return ERROR_FAIL;
      }
   }

Obviously the code is buggy, because the single step breakpoint never gets unset in case of a timeout and therefore no execution progress can be made. But maybe I'm missing something and there's a way to make JTAG react faster?
linc
Newbie
Newbie
 
Posts: 3
Joined: Thu May 09, 2013 3:14 pm

Return to OpenOCD JTAG

cron