Re: [Openocd-development] [beagleboard] Re: JTAG

2009-02-20 Thread Dick Hollenbeck
I support what Rick is saying.

I think we can work through it.  With diligent usage of tap_set_state() 
when its full logging is enabled, this can be tracked down.  There is 
currently not diligent usage of tap_set_state() in effect in any cable 
driver.  But that is on my to do list when I get back to this.

My vision is that any state transition must be reported to 
tap_set_state().  This way problems like this become easier to diagnose.

Dick

>
> On Feb 19, 2009, at 10:01 PM, Kees Jongenburger wrote:
>
>>
>> Hello Rick,
>>
>> On Fri, Feb 20, 2009 at 12:47 AM, Rick Altherr  
>> wrote:
>>>
>>> On Feb 19, 2009, at 3:38 PM, Kees Jongenburger wrote:
>>>
>>> Can you write up the problems you encountered with OpenOCD?  There 
>>> are a few
>>> people on the OpenOCD development list who are actively working on 
>>> fixing up
>>> the JTAG layer.  If we could get some data as to what isn't working 
>>> and what
>>> is needed, we can start working on the necessary improvements.
>>
>> There are currently problems that possibly prevent the OpenOCD from 
>> adding
>> the DAP.
>>
>> 1) When performing ir/dr scans the default end state is Run Test Idle.
>> This does not match
>> what the ICEPICK wants. I don't know it this is a problem or not
>>
>
> I know that the JTAG internals in OpenOCD can support this.  It may be 
> as simple as allowing an extra argument to the irscan and drscan 
> commands in the TCL layer.
>
>> 2) The tap_move that allows moving between "stable" tap states does
>> not follow "shortest pad"
>> but always takes 7 steps, possibly passing via test logic reset. I
>> mailed about it
>> https://lists.berlios.de/pipermail/openocd-development/2009-February/004625.html
>>  
>>
>>
>
> Yes.  I remember seeing the query about this, but I didn't realize it 
> was a limiting issue for ICEPICK.
>
>> 3) There is no support for generating clock pulses in the IDLE state.
>> but this is required
>>
>
> The internals have support for this as it was needed for SVF support.  
> Again, it may just need to be exposed at the TCL layer.
>
>> 4) I had some trouble implementing the sequence because of the problems
>> mentioned above. Those changes where not trivial for me to implement
>> so I decided to focus
>> on getting the sequence done by using urjtag. My plan is still to use
>> OpenOCD for "stage 2"
>> because of its good GDB support. But then at least I know what needs
>> fixing in OpenOCD.
>>
>> Greetings
>>
>> --~--~-~--~~~---~--~~
>> You received this message because you are subscribed to the Google 
>> Groups "Beagle Board" group.
>> To post to this group, send email to discuss...@beagleboard.org.
>> To unsubscribe from this group, send email to 
>> beagleboard-unsubscr...@beagleboard.org
>> For more options, visit this group at 
>> http://groups.google.com/group/beagleboard?hl=en
>> -~--~~~~--~~--~--~---
>>

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] [beagleboard] Re: JTAG

2009-02-20 Thread Rick Altherr


On Feb 19, 2009, at 10:01 PM, Kees Jongenburger wrote:



Hello Rick,

On Fri, Feb 20, 2009 at 12:47 AM, Rick Altherr   
wrote:


On Feb 19, 2009, at 3:38 PM, Kees Jongenburger wrote:

Can you write up the problems you encountered with OpenOCD?  There  
are a few
people on the OpenOCD development list who are actively working on  
fixing up
the JTAG layer.  If we could get some data as to what isn't working  
and what

is needed, we can start working on the necessary improvements.


There are currently problems that possibly prevent the OpenOCD from  
adding

the DAP.

1) When performing ir/dr scans the default end state is Run Test Idle.
This does not match
what the ICEPICK wants. I don't know it this is a problem or not



I know that the JTAG internals in OpenOCD can support this.  It may be  
as simple as allowing an extra argument to the irscan and drscan  
commands in the TCL layer.



2) The tap_move that allows moving between "stable" tap states does
not follow "shortest pad"
but always takes 7 steps, possibly passing via test logic reset. I
mailed about it
https://lists.berlios.de/pipermail/openocd-development/2009-February/004625.html



Yes.  I remember seeing the query about this, but I didn't realize it  
was a limiting issue for ICEPICK.



3) There is no support for generating clock pulses in the IDLE state.
but this is required



The internals have support for this as it was needed for SVF support.   
Again, it may just need to be exposed at the TCL layer.


4) I had some trouble implementing the sequence because of the  
problems

mentioned above. Those changes where not trivial for me to implement
so I decided to focus
on getting the sequence done by using urjtag. My plan is still to use
OpenOCD for "stage 2"
because of its good GDB support. But then at least I know what needs
fixing in OpenOCD.

Greetings

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google  
Groups "Beagle Board" group.

To post to this group, send email to discuss...@beagleboard.org.
To unsubscribe from this group, send email to 
beagleboard-unsubscr...@beagleboard.org
For more options, visit this group at 
http://groups.google.com/group/beagleboard?hl=en
-~--~~~~--~~--~--~---



--
Rick Altherr
kc8...@kc8apf.net

"He said he hadn't had a byte in three days. I had a short, so I split  
it with him."

 -- Unsigned





smime.p7s
Description: S/MIME cryptographic signature
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] inverse of tap_state_transition()

2009-02-20 Thread Holger Schurig
tap_state_transition() calculates the next state given a current
state and a TMS setting.

The attached function jtag_move_to() calulates the TMS bits given
a *ANY* current state and a *ANY* goal state. It could be used in
OpenOCD to replace the tms_seqs[][] table.

Currently, OpenOCD always sends down 7 TMS bit transitions to go
from a stable state to another stable state. However, with my
function it's possible to just send down the needed bits. For
this I wrote my own 

void ft2232_tms(int bits, char tms)
{
MYTRACE("ft2232_tms(%d, 0x%02x)", bits, (quint8)tms);
for (int i=0; ivoid jtag_move_to(enum tap_state goal)
{
LOG_DEBUG("jtag_move_to(%s)", tap_state_name(goal));
if (current_state == goal)
return;

enum tap_state s = current_state;
char bit[7];
int bits = 0;

for (int loop=0; loop<2; loop++) {
if (s == TAP_RESET) {
bit[bits++] = 0;
s = TAP_IDLE;
}
if (s==goal) break;

if (s == TAP_IDLE) {
bit[bits++] = 1;
s = TAP_DRSELECT;
}
if (s==goal) break;

if (s == TAP_DRSELECT && ((goal >= TAP_IRSELECT) || (goal == 
TAP_RESET))) {
bit[bits++] = 1;
s = TAP_IRSELECT;
} else
if (s == TAP_DRSELECT) {
bit[bits++] = 0;
s = TAP_DRCAPTURE;
} 
if (s==goal) break;

if (s == TAP_IRSELECT && (goal == TAP_RESET)) {
bit[bits++] = 1;
s = TAP_RESET;
} else
if (s == TAP_IRSELECT) {
bit[bits++] = 0;
s = TAP_IRCAPTURE;
}
if (s==goal) break;

if (s == TAP_DRCAPTURE && goal==TAP_DRSHIFT) {
bit[bits++] = 0;
s = TAP_DRSHIFT;
} else
if (s == TAP_DRCAPTURE) {
bit[bits++] = 1;
s = TAP_DREXIT1;
} else
if (s == TAP_IRCAPTURE && goal==TAP_IRSHIFT) {
bit[bits++] = 0;
s = TAP_IRSHIFT;
} else
if (s == TAP_IRCAPTURE) {
bit[bits++] = 1;
s = TAP_IREXIT1;
}
if (s==goal) break;

if (s == TAP_DRSHIFT) {
bit[bits++] = 1;
s = TAP_DREXIT1;
} else
if (s == TAP_IRSHIFT) {
bit[bits++] = 1;
s = TAP_IREXIT1;
}
if (s==goal) break;

if (s == TAP_DREXIT1 && (goal == TAP_DRPAUSE || goal == 
TAP_DREXIT2)) {
bit[bits++] = 0;
s = TAP_DRPAUSE;
} else
if (s == TAP_DREXIT1) {
bit[bits++] = 1;
s = TAP_DRUPDATE;
} else
if (s == TAP_IREXIT1 && (goal == TAP_IRPAUSE || goal == 
TAP_IREXIT2)) {
bit[bits++] = 0;
s = TAP_IRPAUSE;
} else
if (s == TAP_IREXIT1) {
bit[bits++] = 1;
s = TAP_IRUPDATE;
}
if (s==goal) break;

if (s == TAP_DRPAUSE) {
bit[bits++] = 1;
s = TAP_DREXIT2;
} else
if (s == TAP_IRPAUSE) {
bit[bits++] = 1;
s = TAP_IREXIT2;
}
if (s==goal) break;

if (s == TAP_DREXIT2 && goal >= TAP_DRSHIFT && goal <= 
TAP_DRPAUSE) {
bit[bits++] = 0;
s = TAP_DRSHIFT;
} else
if (s == TAP_DREXIT2) {
bit[bits++] = 1;
s = TAP_DRUPDATE;
} else
if (s == TAP_IREXIT2 && goal >= TAP_IRSHIFT && goal <= 
TAP_IRPAUSE) {
bit[bits++] = 0;
s = TAP_IRSHIFT;
} else
if (s == TAP_IREXIT2) {
bit[bits++] = 1;
s = TAP_IRUPDATE;
}
if (s==goal) break;

if (s == TAP_DRUPDATE || s == TAP_IRUPDATE) {
if (goal == TAP_IDLE) {
bit[bits++] = 0;
s = TAP_IDLE;
} else {
bit[bits++] = 1;

Re: [Openocd-development] Fwd: openocd-0.1.0.mci

2009-02-20 Thread SimonQian
Yes, It's OK by my side, too.
According to some users of Versaoon, it works(Eclipse+CodesourceryG++Lite) 
execept it doesn't support GDB Server in IAR.

2009-02-20 



Best Regards, Simon Qian

SimonQian(simonq...@simonqian.com)  www.SimonQian.com



发件人: freddie_chopin 
发送时间: 2009-02-20  19:51:14 
收件人: openocd-development 
抄送: 
主题: Re: [Openocd-development] Fwd: openocd-0.1.0.mci 
 
It was me (;
I've downloaded the installer now and tested it with the md5 (also downloaded 
now) - its fine (on both download servers). The file matches the one I'm 
hosting on my private website...
The downloaded installer works fine with my PC...
Maybe the author of the forwarded mail should join the list and describe the 
his/her problems in greater detail?
4\/3!!
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] Fwd: openocd-0.1.0.mci

2009-02-20 Thread freddie_chopin
It was me (;

I've downloaded the installer now and tested it with the md5 (also downloaded 
now) - its fine (on both download servers). The file matches the one I'm 
hosting on my private website...

The downloaded installer works fine with my PC...

Maybe the author of the forwarded mail should join the list and describe the 
his/her problems in greater detail?

4\/3!!
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] how to scan in/out values wi th specific JTAG states

2009-02-20 Thread Holger Schurig
> Add a jtag_add_state to DRPAUSE -> this will do a path as:
> 'DRPAUSE->DREXIT2->DRUPDATE->DRSELECT->DRCAPTURE->DREXIT1->DRP
>AUSE'

Thanks for the hint. I don't find a jtag_add_state() function, 
probably you mean jtag_add_pathmove:

tap_state_t path[] = { TAP_DRPAUSE };
jtag_add_pathmove(1, path);
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


[Openocd-development] how to scan in/out values with specific JTAG states

2009-02-20 Thread Laurent Gauch
static avr32_get_mem(target_t *target, u32 addr, u32 *data)
{
jtag_tap_t *tap = target->tap;
int retval;

jtag_add_end_state(TAP_IDLE);
jtag_set_instr(tap, INST_MEM_WORD_ACCESS);

scan_field_t field1;
field1.tap = tap;
field1.num_bits = 35;
u8 *data1 = calloc(CEIL(field1.num_bits, 8), 1);
buf_set_u32(data1, 0, 4, SYSTEM_BUS_CACHED);
buf_set_u32(data1, 4, 30, addr >> 2);
buf_set_u32(data1, 34, 1, READ_ACCESS);
field1.out_value = data1;
field1.out_mask = NULL;
field1.in_value = NULL;
field1.in_check_value = NULL;
field1.in_check_mask = NULL;
field1.in_handler = NULL;
field1.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field1, -1);

scan_field_t field2;
field2.tap = tap;
field2.num_bits = 35;
u8 *data2 = calloc(CEIL(field2.num_bits, 8), 1);
field2.out_value = NULL;
field2.out_mask = NULL;
field2.in_value = data2;
field2.in_check_value = NULL;
field2.in_check_mask = NULL;
field2.in_handler = NULL;
field2.in_handler_priv = NULL;
jtag_add_dr_scan(1, &field2, -1);

retval = jtag_execute_queue();
if (retval == ERROR_OK) {
*data = buf_get_u32(data2, 0, 32);
LOG_DEBUG("avr32: %08x: %08x", addr, *data);
} else {
LOG_ERROR("avr32: could not read %08x", addr);
}
free(data1);
free(data2);

return retval;
}



Your trouble is coming from the passage on IDLE state.

Here is the solution for 2x dr_scan with DRCAPTURE but without passing 
on IDLE :

Set end_state to TAP_DRPAUSE before jtag_add_dr_scan(1, &field1, -1);
After jtag_add_dr_scan(1, &field1, -1) STATE will be DRPAUSE.

Add a jtag_add_state to DRPAUSE -> this will do a path as:
'DRPAUSE->DREXIT2->DRUPDATE->DRSELECT->DRCAPTURE->DREXIT1->DRPAUSE'

Then add your jtag_add_dr_scan(1, &field2, -1);

and jtag_execute_queue()

This should do what you need.

Best regards,
Laurent

 http://www.amontec.com
Amontec JTAGkey and Amontec JTAGkey2
Making JTAG a real snap !

 
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development