Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Support => OpenOCD JTAG => Topic started by: abowman on November 28, 2010, 12:26:36 pm

Title: Buspirate did not respond - error
Post by: abowman on November 28, 2010, 12:26:36 pm
I have just received my new bus-pirate, and upgraded it to the latest firmware.  All good so far.  I would like to use it with OpenOCD and an STM32 chip.  I decided to see if OpenOCD would recognise it before I hooked it up to my development board.  However, whenever I run openocd and point it to the interface configuration file I get the following error:

Open On-Chip Debugger 0.5.0-dev-00615-g8902789 (2010-11-25-22:11)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.berlios.de/doc/doxygen/bugs.html (http://openocd.berlios.de/doc/doxygen/bugs.html)
Warn : Adapter driver 'buspirate' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
srst_only separate srst_gates_jtag srst_open_drain
Error: Error sending data
Error: Buspirate did not respond :( restart everything

Should I expect it to be able to connect without a target connected?  Or have I missed some other step?

Thanks in advance

Alan
Title: Re: Buspirate did not respond - error
Post by: ian on November 28, 2010, 01:21:21 pm
Hi abowman - I think this means that the Bus Pirate didn't respond at all (the BBIO1 binary mode indicator). You should be able to connect and see a 'no objects detected' kind of message. Here's a similar message I got debugging the Bus Blaster:
http://dangerousprototypes.com/docs/Fil ... n-scan.png (http://dangerousprototypes.com/docs/File:Busblaster-chain-scan.png)
Title: Re: Buspirate did not respond - error
Post by: abowman on November 28, 2010, 01:39:32 pm
I thought that might be the case, thanks.

Is there any way I can manually step through the connection steps that OpenOCD?  Or is there some other way of debugging why I might not be getting a response?

Thanks

Alan
Title: Re: Buspirate did not respond - error
Post by: ian on November 28, 2010, 04:55:31 pm
On windows, I use a utility called Herculese to send raw bytes to teh Bus Pirate. You can send 0x00 20 times, you should get BBIO, then send (i think) 0x07 to enter OpenOCD mode.
Title: Re: Buspirate did not respond - error
Post by: robots on November 28, 2010, 08:28:43 pm
if you enable logging and debug mode on openocd, it will show what bytes are send over to buspirate on serial line, and what are the replies.
Title: Re: Buspirate did not respond - error
Post by: abowman on November 28, 2010, 09:30:48 pm
I tried the last suggestion, and enabled debugging on openocd - I have snipped the opening setup and just copied the buspirate-specific bit at the end:

Debug: 54 3 command.c:156 script_debug(): command - ocd_command ocd_command type ocd_buspirate_port /dev/ttyUSB0
Debug: 55 3 command.c:156 script_debug(): command - buspirate_port ocd_buspirate_port /dev/ttyUSB0
Debug: 57 3 command.c:156 script_debug(): command - ocd_command ocd_command type ocd_buspirate_speed fast
Debug: 58 3 command.c:156 script_debug(): command - buspirate_speed ocd_buspirate_speed fast
Debug: 60 3 command.c:156 script_debug(): command - ocd_command ocd_command type ocd_reset_config srst_only
Debug: 61 3 command.c:156 script_debug(): command - reset_config ocd_reset_config srst_only
User : 63 3 command.c:566 command_print(): srst_only separate srst_gates_jtag srst_open_drain
Debug: 64 3 command.c:156 script_debug(): command - ocd_command ocd_command type ocd_init
Debug: 65 3 command.c:156 script_debug(): command - init ocd_init
Debug: 67 3 command.c:156 script_debug(): command - ocd_command ocd_command type ocd_target init
Debug: 68 3 command.c:156 script_debug(): command - ocd_target ocd_target init
Debug: 70 3 target.c:891 handle_target_init_command(): Initializing targets...
Debug: 71 15 buspirate.c:713 buspirate_jtag_enable(): Entering binary mode
Debug: 72 15 buspirate.c:912 buspirate_serial_write(): size = 20 ret = 20
Debug: 73 15 buspirate.c:974 buspirate_print_buffer(): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Debug: 74 15 buspirate.c:980 buspirate_print_buffer(): 00 00 00 00
Debug: 75 257 buspirate.c:944 buspirate_serial_read(): should have read = 4 actual size = 4
Debug: 76 257 buspirate.c:980 buspirate_print_buffer(): 42 42 49 4f
Debug: 77 257 buspirate.c:725 buspirate_jtag_enable(): TUI
Debug: 78 257 buspirate.c:944 buspirate_serial_read(): should have read = 1 actual size = 1
Debug: 79 257 buspirate.c:980 buspirate_print_buffer(): 31
Debug: 80 257 buspirate.c:912 buspirate_serial_write(): size = 1 ret = 1
Debug: 81 257 buspirate.c:980 buspirate_print_buffer(): 06
Debug: 82 268 buspirate.c:944 buspirate_serial_read(): should have read = 4 actual size = 4
Debug: 83 268 buspirate.c:980 buspirate_print_buffer(): 42 42 49 4f
Debug: 84 268 buspirate.c:725 buspirate_jtag_enable(): TUI
Debug: 85 268 buspirate.c:944 buspirate_serial_read(): should have read = 1 actual size = 1
Debug: 86 268 buspirate.c:980 buspirate_print_buffer(): 31
Debug: 87 10267 buspirate.c:944 buspirate_serial_read(): should have read = 4 actual size = 0
Error: 88 10267 buspirate.c:948 buspirate_serial_read(): Error sending data
Error: 89 10267 buspirate.c:722 buspirate_jtag_enable(): Buspirate did not respond :( restart everything

It seems that there was a response to the initial mode change, but then something gave up partway through.  Does this mean anything?  I'm seeing the 20x00, followed by BBIO1, but this seems to be being sent twice.  It doesn't entirely match with what I'd expect from the documentation...
Title: Re: Buspirate did not respond - error
Post by: robots on November 28, 2010, 09:39:57 pm
It seems that openocd mode has been removed in the current SVN. :-(
Title: Re: Buspirate did not respond - error
Post by: abowman on November 28, 2010, 09:41:22 pm
Ah!  Do you know if that's a permanent state of affairs?  I assume that going back a version or two will "fix" things?
Title: Re: Buspirate did not respond - error
Post by: robots on November 28, 2010, 09:50:06 pm
I am still at 4.3 version which does have the openocd inside.

I hope someone like Ian or Sjaak can tell us more about this missing feature :)
Title: Re: Buspirate did not respond - error
Post by: Sjaak on November 28, 2010, 10:13:08 pm
I didn't know it is gone :( sorry about that..

From code.google it is removed in rev524, i think it is removed because of hardware v4. I remmeber Ian has some problems with some feature of the current sourcecode. I could be also because we needed the space.

It looks like v5.8 is still carrying the openocd functions: http://code.google.com/p/the-bus-pirate ... e-v5.8.hex (http://code.google.com/p/the-bus-pirate/source/browse/trunk/firmware/v5-nightly/BPv3%26v2go/BPv3-Firmware-v5.8.hex)
Title: Re: Buspirate did not respond - error
Post by: ian on November 28, 2010, 10:18:14 pm
It must be a big mistake, sorry about that, I'm responsible as the maintainer.

The errors in v4 were for one release, and then it was fixed. I never removed it, but there has been a ton of SVN activity lately, and maybe something weird happened. I want to fix the translation file stuff, I'll take a look at it first thing monday.
Title: Re: Buspirate did not respond - error [solved]
Post by: abowman on November 28, 2010, 10:20:29 pm
Indeed, rolling back to v5.8 caused OpenOCD to detect the BusPirate.  Now on to detecting the target...

Thanks very much for your input all of you - I look forward to OpenOCD support returning to this very useful piece of kit.

Alan
Title: Re: Buspirate did not respond - error
Post by: Sjaak on November 28, 2010, 10:31:13 pm
No problem. We'll try to cram as much features in it and OpenOCD is something that should be in it. We'll make sure it gets back in one way or another!

Happy hacking with it and please share the results with us!
Title: Re: Buspirate did not respond - error
Post by: abowman on November 28, 2010, 10:42:12 pm
Ten minutes and a cup of tea later, and I've already detected the scan chain and have read access to the memory map of the device.  Happy hacking indeed :-)
Title: Re: Buspirate did not respond - error
Post by: Sjaak on November 28, 2010, 11:03:35 pm
Ieeeuuw you said tea ;)
Title: Re: Buspirate did not respond - error
Post by: abowman on November 29, 2010, 10:30:32 am
[quote author="Sjaak"]
Ieeeuuw you said tea ;)
[/quote]

Sorry - it was late, and my English sensibilities kicked in.  Hardly the drink of champions, but perfectly adequate from time to time!

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01212106512session_write_close ( )...(null):0
20.01242238104ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01242238880Database_MySQL->query( ).../DatabaseHandler.php:119
40.05872377616Database_MySQL->error( ).../Db-mysql.class.php:273