On Thu, Mar 3, 2011 at 3:29 PM, Laurent Gauch <[email protected]> wrote:
>>
>> ---
>>  src/jtag/core.c |    9 ++++++++-
>>  1 files changed, 8 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/jtag/core.c b/src/jtag/core.c
>> index d7e1cce..68c1257 100644
>> --- a/src/jtag/core.c
>> +++ b/src/jtag/core.c
>> @@ -871,9 +871,16 @@ static int jtag_reset_callback(enum jtag_event event,
>> void *priv)
>>        return ERROR_OK;
>>  }
>>  +/* sleep at least us microseconds. When we sleep more than 1000ms we
>> + * do an alive sleep, i.e. keep GDB alive. Note that we could starve
>> + * GDB if we slept for <1000ms many times.
>> + */
>>  void jtag_sleep(uint32_t us)
>>  {
>> -       alive_sleep(us/1000);
>> +       if (us < 1000)
>> +               usleep(us);
>> +       else
>> +               alive_sleep((us+999)/1000);
>>  }
>>  /* Maximum number of enabled JTAG devices we expect in the scan chain,
>> --
>> 1.7.0.4
>>
>
> But I think the mechanism itself is not so good.
> We should not have to touch JTAG level to keep GDB connection alive !.

That's a valid, but orthogonal objection. It would pretty much require
multithreading of OpenOCD.

> Also, the jtag_sleep should be exclusively used to sleep the JTAG in stable
> JTAG STATE, by running some TCK to generate the corresponding delay we want.

This should be enforced today by pathmove requiring start/end
state to be stable states.

-- 
Øyvind Harboe

Can Zylin Consulting help on your project?

US toll free 1-866-980-3434 / International +47 51 87 40 27

http://www.zylin.com/zy1000.html
ARM7 ARM9 ARM11 XScale Cortex
JTAG debugger and flash programmer
_______________________________________________
Openocd-development mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to