On Wed, Dec 10, 2008 at 7:00 PM, Rick Altherr <[EMAIL PROTECTED]> wrote:
>
> On Dec 10, 2008, at 4:41 AM, Øyvind Harboe wrote:
>
>> Hm.... I think perhaps the "jtag -expected-id" needs rethinking.
>>
>> The ID check should be in the target configuration script and not in
>> C.
>>
>
> The actual check is fine being in C.  There is no need to force the
> retrieval of the ID and comparison into a script.

This is not about the language, this is about the target configuration
script interpreting the meaning of an ID.

The polymorphic approach to this problem is to push the handling
into the "subclass", i.e. tcl in this case.


>> The target script can accept multiple target id's and also output
>> sensible target specific error messages or do whatever else
>> is approperiate.
>>
>
> We could just as easily allow multiple -expected-id options and compare
> against the list.  Target specific error messages don't necessarily seem
> appropriate, but could be implemented as a jtag tcl event when a jtag tap
> does not match any expected ids.

The point is that we shouldn't have to modify the C code when a new target
comes along. Any fixed scheme in C will have the limitation that the
target configuration script can't override it.


>> at91rm9200.cfg seems to be another case of where the
>> standard expected-id breaks down.
>>
>
> Can you provide more details on how it fails to work in that case?

Not really, I just saw that it had special handling in the .cfg file
already, so we're
already heading down this road.


>> Thoughts?
>>
>> How about adding a jtag tcl event to handle a discovered id?
>
> I see no harm in having such an event.  We should also have a corresponding
> "id did not match any expected values" event.  They can be used for
> target-specific error messages or for special circumstances (e.g. if id is
> X, we need to do Y for it to function).

I want to push the interpretation of ID into the target configuration script,
so the C code should do as little as possible here, just hand it to
the target configuration script. There could be a default tcl
even that can be overridden that checks that the ID matches.



-- 
Øyvind Harboe
http://www.zylin.com/zy1000.html
ARM7 ARM9 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