[<<][arm][>>][..]
Wed Feb 2 12:22:38 EST 2011

Setting up AT91SAM7S-EK + Olimex ARM-USB-OCD

The Olimex ARM-USB-OCD has a RS232 port which can be plugged to the
Atmel AT91SAM7S-EK (AT9).  It is an FTDI2232C:

Feb  2 12:26:50 zoo kernel: [4894878.109218] usb 1-4.4.4: new full speed USB device using ehci_hcd and address 35
Feb  2 12:26:50 zoo kernel: [4894878.226327] usb 1-4.4.4: New USB device found, idVendor=15ba, idProduct=0003
Feb  2 12:26:50 zoo kernel: [4894878.226330] usb 1-4.4.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
Feb  2 12:26:50 zoo kernel: [4894878.226393] usb 1-4.4.4: Product: Olimex OpenOCD JTAG
Feb  2 12:26:50 zoo kernel: [4894878.226395] usb 1-4.4.4: Manufacturer: Olimex
Feb  2 12:26:50 zoo kernel: [4894878.229669] usb 1-4.4.4: Ignoring serial port reserved for JTAG
Feb  2 12:26:50 zoo kernel: [4894878.232305] ftdi_sio 1-4.4.4:1.1: FTDI USB Serial Device converter detected
Feb  2 12:26:50 zoo kernel: [4894878.232333] usb 1-4.4.4: Detected FT2232C
Feb  2 12:26:50 zoo kernel: [4894878.232348] usb 1-4.4.4: Number of endpoints 2
Feb  2 12:26:50 zoo kernel: [4894878.232350] usb 1-4.4.4: Endpoint 1 MaxPacketSize 64
Feb  2 12:26:50 zoo kernel: [4894878.232352] usb 1-4.4.4: Endpoint 2 MaxPacketSize 64
Feb  2 12:26:50 zoo kernel: [4894878.232355] usb 1-4.4.4: Setting MaxPacketSize 64
Feb  2 12:26:50 zoo kernel: [4894878.233289] usb 1-4.4.4: FTDI USB Serial Device converter now attached to ttyUSB2


To identify usb serial ports I have a small script[1][2] that resides
in /lib/udev and tries to provide a unique name for the device.  The
OCD doesn't seem to expose a serial number, so i'm generating a tty
name based on the idVendor idProduct info, which then becomes
/dev/tty-15ba0003 which I've linked to /dev/ttyOCD.

Out of the box, the AT91 doesn't seem to produce any serial output, at
least not at 9600 baud.

Starting the OpenOCD script[3] I used for the other SAM7 board seems
to work:

tom@zoo:~/bin$ ./ocd.SAM7-H256
#!/bin/bash
cat $0
SCRIPTS=/usr/local/share/openocd/scripts
exec openocd \
    --file $SCRIPTS/interface/arm-usb-ocd.cfg  \
    --file $SCRIPTS/target/sam7x256.cfg \
    --file $0.cfg \
    "$@"
Open On-Chip Debugger 0.5.0-dev-00586-gc62fb3f (2010-11-11-14:30)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
srst_only srst_pulls_trst srst_gates_jtag srst_open_drain
300 kHz
dcc downloads are enabled
fast memory access is enabled
force hard breakpoints
Info : clock speed 300 kHz
Info : JTAG tap: sam7x256.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)
Info : Embedded ICE version 1
Info : sam7x256.cpu: hardware has 2 breakpoint/watchpoint units
Info : JTAG tap: sam7x256.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)
Warn : srst pulls trst - can not reset into halted mode. Issuing halt after reset.
target state: halted
target halted in Thumb state due to debug-request, current mode: Supervisor
cpsr: 0x40000033 pc: 0x000007f4


I spent some time in november getting the other ARM board setup after
my move.  That took some time: I had to work around an issue by
setting the clock slower before reset, then setting faster before
load.  See [3][4].

Next: get something running on the arm board.

So I got something to run + output to the serial port (DBGU 9600
baud).  However, only 2 or 3 times this worked, after that I no longer
get any signal on the debug port.  Also measured on the analog scope.

I'm able to single-step code on the ARM, but breakpoints (actually I
tried the "next" command) don't work reliably.

My guess is there's a bug with the OpenOCD somewhere.  Let's see if
there are any config issues I should be aware of.

I've upgraded OpenOCD to git tag
75cdbff5aa93d93e414cb22d413f41fb38a076bb.  After power cylcing the
board and the OCD it seems to work again.

When using just `load' and `continue' everything seems to work just
fine.  Using `reset' (see eCos.gdb) messes things up for good.


[1] http://zwizwa.be/darcs/pool/bin/ttyUSB_id
[2] entry://../pool/20101231-230904
[3] entry://20101111-142340
[4] http://zwizwa.be/darcs/ecos/bin/eCos.gdb





[Reply][About]
[<<][arm][>>][..]