Monday 26 October 2015

arm - Strange error when connecting JTAG


My setup:


Common) CPU: at91sam7x512, JTAG: olimex-arm-usb-tiny-h, proprietary single-CPY board
1) Windows 7, OpenOCD 0.0.4 <- works 2) Ubuntu 13.04, OpenOCD 0.7.0 <- strange error


There are some config files written in past times and the windows version works. Now I am trying to make things work under linux.


The manufacturer's page doesn't seem to have a ready config file, although they have instructions for building OpenOCD.


I built it with ft2232 support. OpenOCD seems to locate the JTAG, but not the device:



sw3@pc90313-sw3:~/ocd_conf$ openocd -f ocdconfig.cfg 
Open On-Chip Debugger 0.7.0 (2013-08-16-13:27)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
adapter speed: 20 kHz
srst_only srst_pulls_trst srst_gates_jtag srst_open_drain connect_deassert_srst
Info : device: 6 "2232H"
Info : deviceID: 364511274

Info : SerialNumber: OLWKRKY?A
Info : Description: Olimex OpenOCD JTAG ARM-USB-TINY-H A
Info : max TCK change to: 30000 kHz
Info : clock speed 20 kHz
fError: couldn't read enough bytes from FT2232 device (70 < 81)
Error: couldn't read from FT2232
Error: Trying to use configured scan chain anyway...
Warn : Bypassing JTAG setup events due to errors
Info : Embedded ICE version 1
Info : sam7x512.cpu: hardware has 2 breakpoint/watchpoint units


Here is my config file:


sw3@pc90313-sw3:~/ocd_conf$ cat ocdconfig.cfg 
source [find interface/olimex-arm-usb-tiny-h.cfg]

adapter_khz 20

source [find target/at91sam7x512.cfg]

This error Error: couldn't read enough bytes from FT2232 device (70 < 81) seems to be the give-away. Other people in Googleland have experienced similar problems, but with (0 < 81) in which case it is clear that communication is not working at all. In my case, the number oscillates at 69-79-71.



Ideas?



Answer



The FT2232H uses High Speed USB, and the error translates into "problem in USB communication". I`d recommend trying another USB cable first - but this seems not to be a problem here, as it works in other configurations.


You should use the newer ftdi driver in OpenOCD 0.7.0:


source [find interface/ftdi/olimex-arm-usb-tiny-h.cfg]

You can ignore the warning, the interface was tested to be OK, but after the 0.7.0 release.


Updating the OpenOCD windows binaries might be a good idea, too - the 0.4.0 release is getting rusty.


No comments:

Post a Comment

arduino - Can I use TI&#39;s cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...