Question about at91sam7s flash programming

Hi All,

First off, I’d like to extend my thanks to the many folks who are working to build and support openocd. It has been quite a bit of fun to get up and running over the past few days. On to my question…

I’m using the latest svn checkout of openocd (svn 880), under Ubuntu Hardy Heron. My target board is the Atmel Sam7S-EK board (with the SAM7S64 replaced with a SAM7S256). I am using the Olimex usb ocd tiny:

http://www.sparkfun.com/commerce/produc … ts_id=8278

I run openocd from the cmd line as follows:

openocd -d 3 -f interface/olimex-jtag-tiny.cfg -f target/sam7s256.cfg

(where I had to create the olimex-jtag-tiny.cfg file manually…the existing olimex-jtag-tiny-A.cfg file used a different USB PID (0x0004) instead of the PID that comes by default with the .cfg file (0x0003) ).

I telnet into 4444 just fine, and I can halt/flash info 0/etc. on the device just fine. My problem comes when I go to program it.

From the telnet session, I call the following:

flash write_bank 0 main.bin 0x0

(where my default hello-world LED blinking app from the Yagarto src code is called main.bin)

My telnet session returns to a openocd cmd prompt in about 2 seconds, and the shell running the openocd daemon’s debug output shows a whole series of write commands, with the last one looking like the following:

Debug: 684 174810 embeddedice.c:400 embeddedice_write_reg(): 0: 0x00000004

Debug: 685 174812 embeddedice.c:400 embeddedice_write_reg(): 0: 0x00000005

Debug: 686 174814 at91sam7.c:290 at91sam7_flash_command(): Flash command: 0x5a001301, flashplane: 0, pagenumber:19

Debug: 687 174814 arm7_9_common.c:1833 arm7_9_read_memory(): address: 0xffffff68, size: 0x00000004, count: 0x00000001

Debug: 688 174818 target.c:1098 target_read_u32(): address: 0xffffff68, value: 0x00000300

Debug: 689 174818 at91sam7.c:260 at91sam7_wait_status_busy(): status[0]: 0x300

Debug: 690 174819 arm7_9_common.c:1833 arm7_9_read_memory(): address: 0xffffff68, size: 0x00000004, count: 0x00000001

Debug: 691 174824 target.c:1098 target_read_u32(): address: 0xffffff68, value: 0x00000301

Debug: 692 174824 at91sam7.c:264 at91sam7_wait_status_busy(): status[0]: 0x301

Debug: 693 174824 at91sam7.c:776 at91sam7_write(): Write flash plane:0 page number:19

I don’t get ANY feedback at the telnet prompt (i.e., no msg indicating that main.bin downloaded X bytes at Y bytes/sec, or anything like that). I then type the reset command at the telnet prompt, but my code doesn’t seem to blink the LEDs as expected. I’ve tried unplugging/replugging in power to see if that works but it doesn’t. Unplugging JTAG also doesn’t work.

Is there some additional command I need to run after running the flash write_bank command to actually get the program to execute? Oddly, I thought I would see an indicator showing me download status (at least it looks like previous versions of openocd did). Also, I couldn’t find a command to read back the flash to verify that it is what I had written down.

I’m probably missing something silly, so any help would be appreciated.

Thanks and regards,

John O