user2137324
user2137324

Reputation: 69

OpenOCD on Beaglebone Black

This is my first post ever on this board and I am also fairly new to the world of JTAG debugging, I have used a few commercial products before but I would like to make the switch to OpenOCD and I am experiencing a lot of failures so far. I have tried to attach to my Beaglebone Black using a Flyswatter2 and the kit that they provide and most of my results look something like this:

$ ./openocd -f interface/ftdi/flyswatter2.cfg -f  
board/ti_beaglebone_with_fs2.cfg -c init -c "reset init"  
Open On-Chip Debugger 0.10.0-dev-00149-g8229d52 (2015-12-23-11:37)  
Licensed under GNU GPL v2  
For bug reports, read  
    http://openocd.org/doc/doxygen/bugs.html  
Warn : Interface already configured, ignoring  
adapter speed: 16000 kHz  
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.  
Warn : target name is deprecated use: 'cortex_a'  
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain  
connect_deassert_srst  
Info : clock speed 16000 kHz  
Info : JTAG tap: am335x.jrc tap/device found: 0x2b94402f (mfg: 0x017,
part: 0xb944, ver: 0x2)  
Info : JTAG tap: am335x.dap enabled  
Warn : Timeout (1000ms) waiting for ACK=OK/FAULT in JTAG-DP transaction
- aborting  
Info : JTAG tap: am335x.jrc tap/device found: 0x2b94402f (mfg: 0x017,
part: 0xb944, ver: 0x2)  
Info : JTAG tap: am335x.dap enabled  
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed  
Error: MEM_AP_CSW 0x2800060, MEM_AP_TAR 0x0  
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed  
Error: MEM_AP_CSW 0x2800060, MEM_AP_TAR 0x0  
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed  
Error: MEM_AP_CSW 0x2800060, MEM_AP_TAR 0x0  
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed  
Error: MEM_AP_CSW 0x2800060, MEM_AP_TAR 0x0  
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed  
Error: MEM_AP_CSW 0x2800060, MEM_AP_TAR 0x0  
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed  
Error: MEM_AP_CSW 0x2800060, MEM_AP_TAR 0x0  
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed  
Error: MEM_AP_CSW 0x2800060, MEM_AP_TAR 0x0  
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed  
Error: MEM_AP_CSW 0x2800060, MEM_AP_TAR 0x0  
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed  
Error: MEM_AP_CSW 0x2800060, MEM_AP_TAR 0x0  
Error: JTAG-DP OVERRUN - check clock, memaccess, or reduce jtag speed  
Error: MEM_AP_CSW 0x2800060, MEM_AP_TAR 0x0  
Error: Target not examined yet  
in procedure 'reset'  
in procedure 'ocd_bouncer'  

I have tried to reduce the adapter speed with some success, where the device actually reboots but all hell breaks loose once the kernel starts at which point I get error messages similar to the ones above.

I am not really sure where to start as those error messages are still a little obscure to me, would anyone have any ideas/thoughts/suggestions? I'd be willing to dig in the source and make some adjustments if need be, but right now I'm a little bit too clueless to do so!

Upvotes: 3

Views: 1846

Answers (2)

Arnout
Arnout

Reputation: 371

Well, just since I can't seem to find any other post that shows ppl succesfully debugging the BeableBone Black with openocd, I can vouch for the fact that it works. My commandline (using the TIAO):

sudo ../src/openocd -f interface/ftdi/tumpa.cfg -f board/mybbb.cfg

Note that the paths come from the fact that I built it and ran it from source (you might need other path prefixes). The mybbb.cfg is basically the one from flyswatter, except the interface line. (https://www.tincantools.com/w/images/f/f7/ti_beaglebone_with_fs2.cfg)

Openocd can be a bit hard to use, but it does forces you to understand what really is happening with the JTAG. If you won't want to, just buy the 80$ connector from TI, and it will -just- work (provided that you get the pinheader soldered on it correctly)

FYI: The succesful output in my case (useful to diff):

testbox@testbox-VirtualBox:~/openocd/openocd-code/tcl$ sudo ../src/openocd -f interface/ftdi/tumpa.cfg -f board/ti_beaglebone.cfg
Open On-Chip Debugger 0.10.0-dev-00322-g406f4d1 (2016-06-09-09:22)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
none separate
adapter speed: 16000 kHz
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
trst_and_srst separate srst_gates_jtag trst_push_pull srst_push_pull connect_deassert_srst
Info : ftdi: if you experience problems at higher adapter clocks, try the command "ftdi_tdo_sample_edge falling"
Info : clock speed 16000 kHz
Info : JTAG tap: am335x.jrc tap/device found: 0x2b94402f (mfg: 0x017 (Texas Instruments), part: 0xb944, ver: 0x2)
Info : JTAG tap: am335x.dap enabled
Info : am335x.cpu: hardware has 6 breakpoints, 2 watchpoints

Finally, regarding your errors, I would double check the solder, since openocd really is saying your clock might be too fast. Fast clocking with small leakage might explain your issue?

One last thing to note:

If you want to debug the linux kernel with JAG on the beaglebone on a recent kernel, you might need a patch. If not, you will get errors in openocd (but also with the dongles from TI) once linux boots since it messes up the JTAG. See the 1-line patch in https://e2e.ti.com/support/embedded/linux/f/354/t/363421 (took me a while to find!)

Good luck!

Upvotes: 3

Rami
Rami

Reputation: 153

Be sure that your config file is providing the good ID Vendor and ID product of your target. The command lsusb give you your target IDs.

Upvotes: 0

Related Questions