Dangerous Prototypes

Dangerous Prototypes => Bus Pirate Support => OpenOCD JTAG => Topic started by: krish2487 on August 27, 2010, 11:07:22 am

Title: Help with openOCD on windows
Post by: krish2487 on August 27, 2010, 11:07:22 am
Hello

I am trying to get openOCD to work with buspirate on windows

I downloaded the executable from

http://www.freddiechopin.info/index.php/en (http://www.freddiechopin.info/index.php/en)

i downloaded both the 0.5.0-dev version as that had the buspirate.cfg file present in it

but try as i might i am not able to get openocd to connect with bus pirate

It gives me an error message that the specified interface was not found and then gave a list of supported interfaces among which bus pirate  was not present

i think that the openocd was not compiled with the buspirate configuration

is there any way i can make it work in its present state or do i have to build openocd from ground up to have support for bus pirate??

PS: the reason i downloaded the afore mentioned msi package fro freddie chopin is that i was not able to install openocd by building it.
I use Jolicloud on which the directory structure is different from the openocd linux installation tutorial
and on windows i tried the cygwin based method. Here the tutorial was for a FT2232 device and i have no idea how to apply it for a bus pirate
Title: Re: Help with openOCD on windows
Post by: telfohw on August 28, 2010, 11:55:53 pm
I continue trying. I have seen this web which describe how to compile openocd for another hardware. Very interesting, but we need how to adapt compilation to bus pirate hardware.
http://piconomic.co.za/fwlib/_b_u_i_l_d___o_p_e_n_o_c_d.html (http://http://piconomic.co.za/fwlib/_b_u_i_l_d___o_p_e_n_o_c_d.html)

Hope it helps.
Title: Re: Help with openOCD on windows
Post by: krish2487 on August 29, 2010, 03:11:32 pm
thank you
that was helpful

I gave up trying to use freddie chopins files.
As i understand it there is a buspirate.cfg in the interface folder but it doesnot show up in the openocd supported devices.

I downloaded the original files from openocd sourgeforge site and compiled them myself
I was able  to configure it fully under linux but got stuck in windows

In windows i have only one bottleneck
location of the bus pirate

the buspirate.cfg defines the location of buspirate as /dev/ttyUSB0
which is not surprising since the cygwin shell assumes a linux environment and in linux we would not need cygwin to be installed seperately.
but this does not make sense for windows as the directory structure is not the same

having said that i did see under the /dev/ folder in cygwin shell
not surprisingly i did not see the bus pirate there..

how do i change the location in the buspirate.cfg file so that i am able to point out to openocd the location of bus pirate??
Title: Re: Help with openOCD on windows
Post by: robots on September 18, 2010, 09:34:21 pm
sorrt for late support, but i have had no time recently to check these forums.

According to http://www.cygwin.com/ml/cygwin/2010-01/msg00081.html (http://www.cygwin.com/ml/cygwin/2010-01/msg00081.html)
serial ports are accessed through /dev/ttySx ... where x is the number of COMx port in windows. I have never used cygwin, so I am shooting blind.

I have written patch for openocd to be able to compile against mingw, but this has not yet been posted upstream.
Title: Re: Help with openOCD on windows
Post by: ian on September 19, 2010, 05:16:36 pm
Quote
I have written patch for openocd to be able to compile against mingw

Nice! Please let me know when it's in, I'll try it out and do a post. Windows compiles of OpenOCD have been a little sparse in the past, this could help a lot (apologies if there are regular Windows releases since I last checked).
Title: Re: Help with openOCD on windows
Post by: robots on October 22, 2010, 11:38:38 pm
As promised! I finally made some time to close this issue. I have created patches to add Win32 support for Bus Pirate in OpenOCD.

Attached file contains 3 patches:
0001-buspirate-Serial-port-was-not-correctly-closed.patch
0002-buspirate-change-handling-of-communication-speed-set.patch
0003-buspirate-add-support-for-WIN32-and-Darwin.patch

You should be able to apply them to the very latest git. I have tested, that linux support has not been broken. Could you please test mingw ? As soon as someone makes sure they work, I'll post them to main stream.
Title: Re: Help with openOCD on windows
Post by: ian on October 23, 2010, 10:35:12 am
Thanks, I'll test this after I install a git manager :)
Title: Re: Help with openOCD on windows
Post by: ian on October 25, 2010, 03:13:17 pm
I installed GIT, got the source. It looks like you already submitted the minor fixes. I applied the windows patch.

I'm not actually sure how to build it though. I tried the obvious (make). I'll do a bit more hunting, but I'm open to suggestions.
Title: Re: Help with openOCD on windows
Post by: robots on October 25, 2010, 03:31:58 pm
Yes minor fixes have been already merged. They didn't need much testing at all :)

http://lists.berlios.de/pipermail/openo ... 09657.html (http://lists.berlios.de/pipermail/openocd-development/2009-July/009657.html) Here is a list of needed packages in mingw environment.
You need to run the configure script to generate Makefiles, so no, running just "make" is not enough :)
Title: Re: Help with openOCD on windows
Post by: ian on October 25, 2010, 03:41:17 pm
Thanks:

Quote
1) Basic MinGW installation
MinGW-5.1.4.exe
binutils-2.19.1-mingw32-bin.tar.gz
gcc-core-3.4.5-20060117-3.tar.gz
gcc-g++-3.4.5-20060117-3.tar.gz
w32api-3.13-mingw32-dev.tar.gz
MSYS-1.0.11-rc-1.exe

2) Extra stuff
msysDTK-1.0.1.exe
autoconf2.5-2.61-1-bin.tar.bz2
automake1.9-1.9.6-2-bin.tar.bz2
bison-2.0-MSYS.tar.gz (not necessary for OpenOCD)
libtool1.5-1.5.25a-1-bin.tar.bz2
m4-1.4.7-MSYS.tar.bz2
msys-autoconf-2.59.tar.bz2
msys-automake-1.8.2.tar.bz2
msys-libtool-1.5.tar.bz2

3) Building OpenOCD 0.2.0 with J-Link
./configure --enable-jlink
make
Title: Re: Help with openOCD on windows
Post by: ian on November 14, 2010, 10:40:20 am
I'm getting closer on this. I built the most recent Bus Blaster prototype and have been doing some initial testing with OpenOCD. It looks like I'll need to write a custom Bus Blaster mode. The pinout and buffer is the same as a lot of other programmers, but it uses a newer chip and I think I need to add the updated ID to one of those modes. Not a major change, but it will require compiling :)
Title: Re: Help with openOCD on windows
Post by: jamz on January 20, 2011, 07:24:13 pm
I managed to cross-compile openocd on my debian build which runs on a win7 environment.  Although there are some problems during the compilation process which can be solve by looking at the config.log.

Documentation at http://dangerousprototypes.com/docs/Com ... on_Windows (http://dangerousprototypes.com/docs/Compile_OpenOCD_for_Windows#Testing_and_running_on_Windows)

( ! ) 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.01122089784session_write_close ( )...(null):0
20.01152221376ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01152222152Database_MySQL->query( ).../DatabaseHandler.php:119
40.05712360880Database_MySQL->error( ).../Db-mysql.class.php:273