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
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)
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
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.
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.
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...
It seems that openocd mode has been removed in the current SVN. :-(
Ah! Do you know if that's a permanent state of affairs? I assume that going back a version or two will "fix" things?
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 :)
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)
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.
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
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!
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 :-)
Ieeeuuw you said tea ;)
[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!