SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By rastro
#119793
I'm looking for some help running openocd with Teensy++2.0 (Arduino) using a MacBook/snow leopard.

Objective:
Run JTAGenum on teensy++2

Tool Chain:
MacBook 1,1 (32-bit), OSX:10.6.6
Open On-Chip Debugger 0.4.0 built with --enable-ft2232_ftd2xx --enable-usbprog
Teensy++2.0, loaded with JTAGenum.pde

Problem:
I've run into problems getting openocd to communicate with the Teensy++2. Right now I'm working with my own paired down .cfg file (refer below) but get the following error messages when running openocd:

Warn : Unable to open FTDI Device tried: 'libftd2xx' and 'libftd2xx A'
Error: unable to open ftdi device: 2
Error: ListDevices: 0

Troubleshooting Actions:
I've gone through some of the other threads and followed up on those suggestions.
- I believe I've have the correct ftdi drivers installed, openocd was built with these added into the configure file.
- I also addressed the kernel driver "FTDIUSBSerialDriver.kext" both with load/unload commands and selected deletion of that file to remove the A port.
- I've tested most of the .cfg files that come with the openocd installation and these all fail to get the openocd running.

Question:
1) The Teensy++2 appears as a modem on the system; is this a problem?
/dev/cu.usbmodem12341 /dev/tty.usbmodem12341
2) The Teensy++2 doesn't use a FTDI chip, could it still be using the ft2232 driver? Or am I going down the wrong path?
3) The main chip AT90USB1286 user guide doesn't give any clear indication of what driver to use with the USB and I didn't see any references in the openocd guide.

Any help would be appreciated
Thanks


Attached Additional Background Information......

========================================================
BUILDING OPENOCD TEENSY++2.CFG FILE:
-----------------------------------------------------------------------------
#daemon configuration
telnet_port 4444

#interface
interface ft2232
ft2232_device_desc libftd2xx
ft2232_layout usbjtag
ft2232_vid_pid 0x16c0 0x0483

========================================================
INSTALL OS X D2XX LIBRARY VERSION 1.0.2
-----------------------------------------------------------------------------
- Followed ReadMe instructions from D2XX1.0.2.dmg
- Installed library for snow leopard:
D2XX1.0.2/D2XX/bin/10.5\ -\ 10.6/libftd2xx.1.0.2.dylib
- Verified files and links are installed:
-rwxr-xr-x@ 1 root wheel ... /usr/local/include/ftd2xx.h
-rwxr-xr-x@ 1 root wheel ... /usr/local/lib/libftd2xx.1.0.2.dylib
lrwxr-xr-x 1 root wheel ... /usr/local/lib/libftd2xx.dylib -> /usr/local/lib/libftd2xx.1.0.2.dylib
-rwxr-xr-x@ 1 root wheel ... /usr/local/include/WinTypes.h

========================================================
BUILDING & VERIFY CORRECT VERSION OF OPENOCD USING "MACPORT"
-----------------------------------------------------------------------------
- Installed & linked FTID2 drivers: libftd2xx.1.0.2.dylib
- Found port configuration file for openocd
$ sudo port dir openocd /opt/local/var/macports/sources/rsync.macports.org/release/ports/cross/openocd
- Opened the "Portfile" under that directory
- Found the configuration line and made the following edits:
Replace "--enable-ft2232_libftdi" with --enable-ft2232_ftd2xx
Added --enable-usbprog
- Save Portfile
- Build the program
$ sudo port install openocd
_ The openocd compiled and installed OK
- Verify that openocd is using the correct driver.
$ otool -L /opt/local/bin/openocd
/opt/local/bin/openocd:
/opt/local/lib/libusb-0.1.4.dylib (compatibility version 9.0.0, current version 9.4.0)
/opt/local/lib/libusb-1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/usr/local/lib/libftd2xx.1.0.2.dylib (compatibility version 0.1.0, current version 1.0.2)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.2.1)
User avatar
By itikhonov
#120105
The main chip AT90USB1286 user guide doesn't give any clear indication of what driver to use with the USB and I didn't see any references in the openocd guide.
There is no driver for it, probably the only way is to use external jtag adapter.