Olimex Support Forum

ARM => JTAG => Topic started by: aniekaitjesu on January 22, 2014, 08:26:14 AM

Title: olimex arm-usb-ocd-h jtag emulator with beaglebone white
Post by: aniekaitjesu on January 22, 2014, 08:26:14 AM
Hi,
I have a beagle bone white board, a olimex arm-usb-ocd-h jtag emulator.
I have connected this emulator to beagle bone white (not the in built usb-to-serial jtag connection on beagle bone).
For this as the link: http://elinux.org/Beagleboard:BeagleBone#Optional_JTAG_Header
suggests to remove some of the resistors and add some, I did it.
All connections seem to be done OK.

Then on the software side I have openocd.
for accessing the device from openocd I'm using the following command.

==========>
sudo ./openocd -f interface/olimex-arm-usb-ocd-h.cfg -f board/bone.cfg -c init -c "reset init"
==========>

but I'm getting error, saying UNEXPECTED IDCODE.

the error log is:
------------------------------------------------------------------->
user@ubuntu:~/anie/openocd/openocd-0.7.0/src$ sudo ./openocd -f ../tcl/interface/olimex-arm-usb-ocd-h.cfg -f ../tcl/board/bone.cfg -c init -c "reset init"
Open On-Chip Debugger 0.7.0 (2014-01-20-12:23)
Licensed under GNU GPL v2
For bug reports, read
   http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 16000 kHz
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain connect_deassert_srst
Info : max TCK change to: 30000 kHz
Info : clock speed 15000 kHz
Info : JTAG tap: am335x.jrc tap/device found: 0x07ffffff (mfg: 0x7ff, part: 0x7fff, ver: 0x0)
Warn : JTAG tap: am335x.jrc       UNEXPECTED: 0x07ffffff (mfg: 0x7ff, part: 0x7fff, ver: 0x0)
Error: JTAG tap: am335x.jrc  expected 1 of 1: 0x0b94402f (mfg: 0x017, part: 0xb944, ver: 0x0)
Warn : Unexpected idcode after end of chain: 32 0x00000000
Warn : Unexpected idcode after end of chain: 64 0x00000000
Warn : Unexpected idcode after end of chain: 96 0x00000000
Warn : Unexpected idcode after end of chain: 128 0x00000000
Warn : Unexpected idcode after end of chain: 160 0x00000000
Warn : Unexpected idcode after end of chain: 192 0x00000000
Warn : Unexpected idcode after end of chain: 224 0x00000000
Warn : Unexpected idcode after end of chain: 256 0x00000000
Warn : Unexpected idcode after end of chain: 288 0x00000000
Warn : Unexpected idcode after end of chain: 320 0x00000000
Warn : Unexpected idcode after end of chain: 352 0x00000000
Warn : Unexpected idcode after end of chain: 384 0x00000000
Warn : Unexpected idcode after end of chain: 416 0x00000000
Warn : Unexpected idcode after end of chain: 448 0x00000000
Warn : Unexpected idcode after end of chain: 480 0x00000000
Warn : Unexpected idcode after end of chain: 512 0x00000000
Warn : Unexpected idcode after end of chain: 544 0x00000000
Warn : Unexpected idcode after end of chain: 576 0x00000000
Warn : Unexpected idcode after end of chain: 608 0x00000000
Error: double-check your JTAG setup (interface, speed, missing TAPs, ...)
Error: Trying to use configured scan chain anyway...
Error: am335x.jrc: IR capture error; saw 0x3f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : JTAG tap: am335x.jrc tap/device found: 0x02ffffff (mfg: 0x7ff, part: 0x2fff, ver: 0x0)
Warn : JTAG tap: am335x.jrc       UNEXPECTED: 0x02ffffff (mfg: 0x7ff, part: 0x2fff, ver: 0x0)
Error: JTAG tap: am335x.jrc  expected 1 of 1: 0x0b94402f (mfg: 0x017, part: 0xb944, ver: 0x0)
Warn : Unexpected idcode after end of chain: 32 0x00000000
Warn : Unexpected idcode after end of chain: 64 0x00000000
Warn : Unexpected idcode after end of chain: 96 0x00000000
Warn : Unexpected idcode after end of chain: 128 0x00000000
Warn : Unexpected idcode after end of chain: 160 0x00000000
Warn : Unexpected idcode after end of chain: 192 0x00000000
Warn : Unexpected idcode after end of chain: 224 0x00000000
Warn : Unexpected idcode after end of chain: 256 0x00000000
Warn : Unexpected idcode after end of chain: 288 0x00000000
Warn : Unexpected idcode after end of chain: 320 0x00000000
Warn : Unexpected idcode after end of chain: 352 0x00000000
Warn : Unexpected idcode after end of chain: 384 0x00000000
Warn : Unexpected idcode after end of chain: 416 0x00000000
Warn : Unexpected idcode after end of chain: 448 0x00000000
Warn : Unexpected idcode after end of chain: 480 0x00000000
Warn : Unexpected idcode after end of chain: 512 0x00000000
Warn : Unexpected idcode after end of chain: 544 0x00000000
Warn : Unexpected idcode after end of chain: 576 0x00000000
Warn : Unexpected idcode after end of chain: 608 0x00000000
Error: double-check your JTAG setup (interface, speed, missing TAPs, ...)
Error: Trying to use configured scan chain anyway...
Error: am335x.jrc: IR capture error; saw 0x3f not 0x01
Warn : Bypassing JTAG setup events due to errors
----------------------------------------------------------------------->


what's going wrong?

and if I try to set the telnet connection with:
telnet localhost 4444
is getting connected.
there if I use scan_chain command this is the log:

***********************************************************------>
user@ubuntu:~/anie/openocd/openocd-0.7.0/src$ telnet localhost 4444
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Open On-Chip Debugger
> targets
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
0* am335x.cpu         cortex_a8  little am335x.dap         tap-disabled



> scan_chain
   TapName             Enabled  IdCode     Expected   IrLen IrCap IrMask
-- ------------------- -------- ---------- ---------- ----- ----- ------
0 am335x.m3_dap          n     0x00000000 0x4b6b902f     4 0x01  0x0f
1 am335x.dap             n     0x00000000 0x4b6b902f     4 0x01  0x0f
2 am335x.jrc             Y     0x02ffffff 0x*b94402f     6 0x01  0x3f

******************************************************************------>

but I'm not able to give other commands like halt, it says target not yet examined.

what is the issue??
Any help will be appreciated.

thanks,
aniket s jesu
Title: Re: olimex arm-usb-ocd-h jtag emulator with beaglebone white
Post by: JohnS on January 22, 2014, 10:10:00 AM
Olimex device looks to be working so problem is in openocd script or some such.  Maybe not set correctly for your board.

John
Title: Re: olimex arm-usb-ocd-h jtag emulator with beaglebone white
Post by: aniekaitjesu on January 22, 2014, 02:05:01 PM
Hi,

Thanks John for the quick reply.
As I mentioned in my earlier post I'm using two config files:
1. olimex-arm-usb-ocd-h.cfg

which is a standard config file provided, contains:

---------->
interface ft2232
ft2232_device_desc "Olimex OpenOCD JTAG ARM-USB-OCD-H"
ft2232_layout olimex-jtag
ft2232_vid_pid 0x15ba 0x002b
---------->

2. the bone config file

this is the file I was successfully using with in built usb-to-serial jtag connection on beagle bone white.
Now for this case(olimex arm-sub-ocd-h jtag emulator) with Beagle bone white, I have just removed these four lines from this config file bone.cfg:

=============>
interface ft2232
ft2232_device_desc "BeagleBone A"
ft2232_layout xds100v2
ft2232_vid_pid 0x0403 0xa6d0 0x0403 0x6010
=============>


the reamining file is the same:

***************************************************************************>
adapter_khz 16000


if { [info exists CHIPNAME] } {
   set _CHIPNAME $CHIPNAME
} else {
   set _CHIPNAME am335x
}

# This chip contains an IcePick-D JTAG router.  The IcePick-C configuration is almost
# compatible, but it doesn't work.  For now, we will just embed the IcePick-D
# routines here.
proc icepick_d_tapenable {jrc port} {
   # select router
   irscan $jrc 7 -endstate IRPAUSE
   drscan $jrc 8 0x89 -endstate DRPAUSE

   # set ip control
   irscan $jrc 2 -endstate IRPAUSE
   drscan $jrc 32 [expr 0xa0002108 + ($port << 24)] -endstate DRPAUSE

   # for icepick_D
   irscan $jrc 2 -endstate IRPAUSE
   drscan $jrc 32 0xe0002008 -endstate DRPAUSE

   irscan $jrc 0x3F -endstate RUN/IDLE
   runtest 10
}

#
# M3 DAP
#
if { [info exists M3_DAP_TAPID] } {
   set _M3_DAP_TAPID $M3_DAP_TAPID
} else {
   set _M3_DAP_TAPID 0x4b6b902f
}
jtag newtap $_CHIPNAME m3_dap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_M3_DAP_TAPID -disable
jtag configure $_CHIPNAME.m3_dap -event tap-enable "icepick_d_tapenable $_CHIPNAME.jrc 11"

#
# Main DAP
#
if { [info exists DAP_TAPID] } {
   set _DAP_TAPID $DAP_TAPID
} else {
   set _DAP_TAPID 0x4b6b902f
}
jtag newtap $_CHIPNAME dap -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_DAP_TAPID -disable
jtag configure $_CHIPNAME.dap -event tap-enable "icepick_d_tapenable $_CHIPNAME.jrc 12"

#
# ICEpick-D (JTAG route controller)
#
if { [info exists JRC_TAPID] } {
   set _JRC_TAPID $JRC_TAPID
} else {
   set _JRC_TAPID 0x0b94402f
}
jtag newtap $_CHIPNAME jrc -irlen 6 -ircapture 0x1 -irmask 0x3f -expected-id $_JRC_TAPID -ignore-version
jtag configure $_CHIPNAME.jrc -event setup "jtag tapenable $_CHIPNAME.dap"
# some TCK tycles are required to activate the DEBUG power domain
jtag configure $_CHIPNAME.jrc -event post-reset "runtest 100"

#
# Cortex A8 target
#
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME cortex_a8 -chain-position $_CHIPNAME.dap -dbgbase 0x80001000

# SRAM: 64K at 0x4030.0000; use the first 16K
$_TARGETNAME configure -work-area-phys 0x40300000 -work-area-size 0x4000

$_TARGETNAME configure -event gdb-attach {
   cortex_a dbginit
   halt
}


reset_config trst_and_srst

***********************************************************************************>

I hope, I'm not missing something, am I??

May not be the best place to ask this about openocd,
but any help will be appreciated.

thanks,
aniket s jesu
Title: Re: olimex arm-usb-ocd-h jtag emulator with beaglebone white
Post by: JohnS on January 22, 2014, 03:01:56 PM
I don't have a BB.  You appear to need doc for it or its CPU or perhaps on OpenOCD and how to make a cfg file.  I think BB have a forum.  There's an Oocd ML.  Better to try these as who here is going to know the answer for a non-Olimex product?

When I've had CPU troubles like this I read the CPU datasheet - after first trying the JTAG interface at a slower speed!

I also make the cfg etc shorter and simpler.  And make sure not to use the old ftdi driver in oocd.

John
Title: Re: olimex arm-usb-ocd-h jtag emulator with beaglebone white
Post by: aniekaitjesu on January 22, 2014, 03:31:20 PM
Thanks john for the pointers.
Will try it out with a simpler config file, and will see any help from BB forum.

thanks,
aniket s jesu