OpenOCD 0.4.0 cofiguration for OLIMEX ARM-USB-TINY-H

The board I’m using is Olimex SAM7-P256 with the ARM-USB-TINY-H.

Is there any ‘officially recommended setup’ ?

I’m asking, because I’m writing an IDE (for Mac OS X 10.5), which I hope can include a script to set up everything needed, including tools for other microcontroller development.

Currently I’ve made scripts that compile the following:

  • - binutils-2.20.1 (with patches)
  • - gcc-4.2.3 (currently I can't go any higher than that)
  • - gdb-7.1
  • - libftdi-0.17
  • - newlib-1.18.0
  • - openocd-0.4.0
  • - libusb-0.1 (can't get libusb 1.0 to work with libftdi-1.18)
  • My question is, in other words: Can I avoid changing too much of the configuration files (to keep them as close to the originals as possible) ?

    My goal is to get flashing to work from within a makefile.

    I tried editing olimex-arm-usb-tiny-h.cfg to look like the following:

    interface ft2232
    ft2232_device_desc "Olimex OpenOCD JTAG ARM-USB-TINY-H"
    ft2232_layout olimex-jtag
    ft2232_vid_pid 0x15ba 0x002a
    jtag_khz 15000
    jtag_nsrst_delay 200
    jtag_ntrst_delay 200
    

    Then running the following command on the command-line:

    openocd -f /usr/local/share/openocd/scripts/interface/olimex-arm-usb-tiny-h.cfg -f /usr/local/share/openocd/scripts/target/at91sam7sx.cfg --command "init" --command "exit"
    

    I now got this output:

    Open On-Chip Debugger 0.4.0 (2010-12-01-05:17)
    Licensed under GNU GPL v2
    For bug reports, read
    	http://openocd.berlios.de/doc/doxygen/bugs.html
    15000 kHz
    jtag_nsrst_delay: 200
    jtag_ntrst_delay: 200
    srst_only srst_pulls_trst srst_gates_jtag srst_open_drain
    Warn : use 'at91sam7s.cpu' as target identifier, not '0'
    Info : max TCK change to: 30000 kHz
    Info : clock speed 15000 kHz
    Info : JTAG tap: at91sam7s.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)
    Info : Embedded ICE version 1
    Info : at91sam7s.cpu: hardware has 2 breakpoint/watchpoint units
    make: *** [flash] Error 1
    (note: echo "$?" shows that the exit code is 1)
    

    In addition, if I try…

    openocd -f /usr/local/share/openocd/scripts/interface/olimex-arm-usb-tiny-h.cfg -f /usr/local/share/openocd/scripts/target/at91sam7sx.cfg --command "flash write_bank 0 Example.bin 0x0" --command "init" --command "exit"
    

    …I get this:

    Warn : use 'at91sam7s.cpu' as target identifier, not '0'
    flash write_bank 0 Example.bin 0x0: command requires more arguments
    make: *** [flash] Error 1
    

    I’m probably close now, but I still haven’t gotten flashing to work.