Next: , Previous: Running, Up: Top


5 Simple Configuration Files

5.1 Outline

There are 4 basic ways of “configurating” OpenOCD to run, they are:

  1. A small openocd.cfg file which “sources” other configuration files
  2. A monolithic openocd.cfg file
  3. Many -f filename options on the command line
  4. Your Mixed Solution

5.2 Small configuration file method

This is the prefered method, it is simple and is works well for many people. The developers of OpenOCD would encourage you to use this method. If you create a new configuration please email new configurations to the development list.

Here is an example of an openocd.cfg file for an ATMEL at91sam7x256

     source [find interface/signalyzer.cfg]
     
     # Change the default telnet port...
     telnet_port 4444
     # GDB connects here
     gdb_port 3333
     # GDB can also flash my flash!
     gdb_memory_map enable
     gdb_flash_program enable
     
     source [find target/sam7x256.cfg]

There are many example configuration scripts you can work with. You should look in the directory: $(INSTALLDIR)/lib/openocd. You should find:

  1. board - eval board level configurations
  2. interface - specific dongle configurations
  3. target - the target chips
  4. tcl - helper scripts
  5. xscale - things specific to the xscale.

Look first in the “boards” area, then the “targets” area. Often a board configuration is a good example to work from.

5.3 Many -f filename options

Some believe this is a wonderful solution, others find it painful.

You can use a series of “-f filename” options on the command line, OpenOCD will read each filename in sequence, for example:

             openocd -f file1.cfg -f file2.cfg -f file2.cfg

You can also intermix various commands with the “-c” command line option.

5.4 Monolithic file

The “Monolithic File” dispenses with all “source” statements and puts everything in one self contained (monolithic) file. This is not encouraged.

Please try to “source” various files or use the multiple -f technique.

5.5 Advice for you

Often, one uses a “mixed approach”. Where possible, please try to “source” common things, and if needed cut/paste parts of the standard distribution configuration files as needed.

REMEMBER: The “important parts” of your configuration file are:

  1. Interface - Defines the dongle
  2. Taps - Defines the JTAG Taps
  3. GDB Targets - What GDB talks to
  4. Flash Programing - Very Helpful

Some key things you should look at and understand are:

  1. The RESET configuration of your debug environment as a hole
  2. Is there a “work area” that OpenOCD can use?
    For ARM - work areas mean up to 10x faster downloads.
  3. For MMU/MPU based ARM chips (ie: ARM9 and later) will that work area still be available?
  4. For complex targets (multiple chips) the JTAG SPEED becomes an issue.