On Tue, Aug 28, 2012 at 7:16 PM, Javier Ortiz <[email protected]> wrote:
> Hi All!

Hello!

> I installed openocd 0.6.0 following the instructions I found in
> http://wiki.eluaproject.net/OpenOCDinLinux

I think most openocd-related wikis out there are less than helpful.
Incomplete, unnecessarily complex, out-of-date or plain wrong
instructions. For example, why does this one have you install libftdi
from source instead of just adding libftdi-dev to the apt-get line
above? And why does it leave you with an openocd built with support
for FTDI adapters only, without any mention of the assumption that you
have exactly that? And why does it suggest running openocd as root?
And why does it tell you to download and copy a bunch of files around
which are almost the same as the ones shipped with openocd, instead of
just sourcing the standard scripts from a custom openocd.cfg?

I wish people would write patches against the official openocd user
guide instead of wasting their effort on writing wiki pages.

> Then I tried to run
> sudo openocd -f
> /usr/local/share/openocd/scripts/interface/olim-arm-usb-tiny-h.cfg  -f
> /usr/local/share/openocd/scripts/board/crossbow_tech_imote2.cfg

1. Never run openocd as root.
2. Never run openocd as root! OpenOCD is a server that opens several
ports that will allow anyone to do crazy stuff with your computer.
3. You don't need to run openocd as root. Instead insert the correct
udev rules to give your user access to your adapter. A rules file for
most adapters is shipped with opencod and installed in
${prefix}/share/openocd/contrib/openocd.udev. Copy it to a suitable
place (/etc/udev/rules.d/50-openocd.rules). If an adapter is missing,
push a patch. Reconnect your adapter to let udev do it's job.
4. You don't need to specify full paths to standard configuration
files. OpenOCD looks in ${prefix}/share/openocd/scripts by default, so
"-f interface/..." and so on is enough.

> and I got the messages:
> Info : JTAG tap: imote2.cpu tap/device found: 0x06e5d093 (mfg: 0x049, part:
> 0x6e5d, ver: 0x0)
> Warn : JTAG tap: imote2.cpu       UNEXPECTED: 0x06e5d093 (mfg: 0x049, part:
> 0x6e5d, ver: 0x0)
> Error: JTAG tap: imote2.cpu  expected 1 of 3: 0x49265013 (mfg: 0x009, part:
> 0x9265, ver: 0x4)
> Error: JTAG tap: imote2.cpu  expected 2 of 3: 0x79265013 (mfg: 0x009, part:
> 0x9265, ver: 0x7)
> Error: JTAG tap: imote2.cpu  expected 3 of 3: 0x89265013 (mfg: 0x009, part:
> 0x9265, ver: 0x8)
> Error: Trying to use configured scan chain anyway...
> Error: imote2.cpu: IR capture error; saw 0x05 not 0x01
> Warn : Bypassing JTAG setup events due to errors
>
> then I added the line
> set CPUTAPID 0x06e5d093 to the file
> /openocd/scripts/board/crossbow_tech_imote2.cfg
> according to what I found here:
> http://www.tincantools.com/wiki/OpenOCD_Troubleshooting:_JTAG_Tap_Unexpected#Incorrect_Value_in_Config_File

Another brain-dead suggestion. If the unexpected IDCODE isn't even
remotely similar to the expected ones (like at least having the same
mfg and/or part code for the same chip family) I can guarantee you
that blindly adding it won't help you.

> also I added the line
>                       adapter_khz 6000
> to the file: olimex-arm-usb-tiny-h.cfg
> according to what I read here:
> http://www.tincantools.com/wiki/OpenOCD_Troubleshooting:_Adapter_Speed_Not_Selected

Yeah, 6 MHz is such a *great* default frequency to use in the general
case. Especially for targets that boot up on slow RC oscillators.
There's a reason the adapter speed is left out of the interface
configs. It's simply because it's doesn't *belong* there! The
interface config can't possibly know what's a safe frequency in your
specific case. The adapter_khz belongs in the target, board or even
user/project config, depending on what's known at each level.

> Now I have this:
>   Info : only one transport option; autoselect 'jtag'
> 6000 kHz
> adapter_nsrst_delay: 260
> jtag_ntrst_delay: 250
> Info : imote2.cpu: hardware has 2 breakpoints and 2 watchpoints
> adapter_nsrst_delay: 800
> trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
> Info : max TCK change to: 30000 kHz
> Info : clock speed 6000 kHz
> Info : JTAG tap: imote2.cpu tap/device found: 0x06e5d093 (mfg: 0x049, part:
> 0x6e5d, ver: 0x0)
> Error: imote2.cpu: IR capture error; saw 0x05 not 0x01
> Warn : Bypassing JTAG setup events due to errors
>
> It says in
> http://www.mail-archive.com/[email protected]/msg12885.html
> that this error, is due to too high JTAG frequency,
>
> I tried with different frequencies, but I'm getting always the same result:

So how low did you go? Did you try 10 kHz?

> If someone could suggest any advice I would be very grateful.

Other than ranting about lousy wikis, I don't have much to offer.
Revert to unmodified config files as a start. Check connections.
Examine the unexpected IDCODE and see if it looks similar to the
expected ones if shifted a few bits left or right.

/Andreas

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to