Ok, so, I tried to build a copy of OpenOCD 0.2.0 from its source code, using Cygwin and lib ftdi (the opensource one). Ive used the tutorial stick post, but I’ve not managed to successfully build OpenOCD - I keep getting the following error when typing the ./configure command:
check Build & Link with libftdi...... configure: error: Cannot build & run test program using libftdi
I do have an STM32 board hooked up via a J-Link device. Also, I have an unused Olimex arm-usb-ocd device plugged in as well. Both devices are installed, and I have installed both devices for the device.
I did build both libusb and libftdi, and have the lib*.a files for both, so why’s it not working?
Ok, update - I managed to get it ‘working’ per say, but the output exe doesn’t work - add to that, its around 3.25 MB which, compared to the output exe from the website, is around 2.25 MB big.
Btw, it seems to be that I didn’t have the autoconf, automake, and libtool installed right.
Just download the installer from here - viewtopic.php?t=16422 - building OpenOCD on Windows is not so trivial, and you won’t get anything more than the package that I posted, as you want to use libftdi.
To shrink the exe size you need to do “strip -s src/openocd.exe” to remove the debugging information and other useless junk from the file.
Freddie Chopin:
Just download the installer from here - viewtopic.php?t=16422 - building OpenOCD on Windows is not so trivial, and you won’t get anything more than the package that I posted, as you want to use libftdi.
To shrink the exe size you need to do “strip -s src/openocd.exe” to remove the debugging information and other useless junk from the file.
4/3!!
Thanks for the advice, and I have been using your for most boards, but I’m trying to get a LPC1768 working, and I haven’t had any luck getting that one working as the lpc17xx range doesn’t seem to be supported yet.
Well, thats why I was trying to compile OpenOCD - see if I can modify it myself; someone on the forum emailed me a version that sort of works with the LPC17xx, but its having alot of troubles - he’s not shown me his source code though.
Freddie Chopin:
Indeed - LPC17xx is not supported in 0.2.0. I’ve seen some messages with patches that add LPC17xx support, but that hasn’t been accepted yet.
4/3!!
Is there anywhere I can look to find the source code for the people who’ve submitted these patches then? Or failing that, is there any idea of when LPC17xx support will be added to OpenOCD?
Freddie Chopin:
That’s a clear violation of GPL then…
The code that uses this patch has been commited. If you want to try it out and you will fail in building OpenOCD, I can send you an executable of current trunk.
Freddie Chopin:
The code that uses this patch has been commited. If you want to try it out and you will fail in building OpenOCD, I can send you an executable of current trunk.
4/3!!
That’d be great actually - the trunk with the support for 17xx enabled? Btw, thanks for your help so far, you’ve been brilliant.
Sorry for a lack of reply, I’ve just be having trouble with the exe you sent - does it work with the Olimex ARM-USB-OCD? I did try using libusb driver for it (came with the previous OpenOCD 0.2.0 installer) and the ftd2xx driver; both seem to get the same error:
Error: unable to open ftdi device: device not found
Runtime error, file “command.c”, line 469
I did also test this with the original OpenOCD (0.2.0), and that one works with the ftd2xx driver, apparently not the libusb-style driver; though I need to check that out more before I’m sure.
I’ve just checked again, and the exact same file I’ve send you works for me with JTAGkey clone and STM32. This version was compiled for use with libusb-win32 drivers.
Open On-Chip Debugger 0.3.0-in-development (2009-08-17-16:16) svn:unknown
$URL: svn://svn.berlios.de/openocd/trunk/src/openocd.c $
For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS
1000 kHz
jtag_nsrst_delay: 100
jtag_ntrst_delay: 100
1000 kHz
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG Tap/device matched
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
Info : JTAG Tap/device matched
i am having the same problem with dougm84 about unable to open ftdi device… i am currently using layout oocdlink… using FT2232D chip. I have tried the openocd 0.2.0 and have install manually for the USB to LibUSB-Win32 Devices.
About the part where you mention in another topic about the uninstalling the USB devices if you happen to download from s/w updates or FTDI website installer. So the communication port wont have any port left after i manually install the USB devices from the inf file where i have edited the vid and pid to customize to my chip.
Much thanks if any advice could be given. hope to hear from you soon
FT2232 is an USB Composite Device - like “2 in 1”, as you have two separate channels - one for JTAG, other for UART. You should install libusb-win32 drivers for the JTAG channel, and ftdi drivers for uart channel.
Oki… i think i get what you mean… After some try, i manage to install one of the usb drive to libusb-win32 drivers and the other i use CDM 2.04.16 to customize install the driver.
i Using the following cfg to test:
interface ft2232
ft2232_device_desc “OOCDLINK (Channel A)”
ft2232_layout oocdlink
ft2232_vid_pid 0x0403 0x6010
jtag_khz 5
But i still get the following output.
C:>openocd -f\interface\oocdlink_1.cfg
Open On-Chip Debugger 0.2.0 (2009-07-18-09:50) Release
Ok, I finally managed to get the lib USB version sorted. Sort of.
For “wannabefren”, the problem is that you need to make an edit to the .inf that goes with the libusb-win32 drivers. Specifically, in file “libusb_olimex.inf”, you need to add the lines:
Editting the names (the bits inside the “” s) to whatever you prefer, and then the VID and PID values (should be easy enough to find on Device Manager). These lines should replace whatever is under “[Devices.NT]” before “[Devices.NTAMD64]”
That said, I’ve had some … odd problems. I’ve been able to upload to the LPC1768 several times in a row before the Olimex simply doesn’t respond to the .exe anymore. As far as I can tell, the only way to fix this is to reinstall the drivers, restart the machine, and hard reset the board. Also, I haven’t been able to get the debugging working…
Its most confusing.
EDIT:
I think the edit the .inf file idea came from one of your message board posts, Freddie, but I lost the link.