2008-04-09 02:31:24 -05:00
|
|
|
Prerequisites:
|
2009-09-21 13:48:22 -05:00
|
|
|
The users of OpenOCD as well as computer programs interacting with OpenOCD are expecting that certain commands
|
2008-04-09 02:31:24 -05:00
|
|
|
do the same thing across all the targets.
|
|
|
|
|
|
|
|
Rules to follow when writing scripts:
|
|
|
|
|
|
|
|
1. The configuration script should be defined such as , for example, the following sequences are working:
|
|
|
|
reset
|
|
|
|
flash info <bank>
|
|
|
|
and
|
2009-09-21 13:48:22 -05:00
|
|
|
reset
|
2008-04-09 02:31:24 -05:00
|
|
|
flash erase_address <start> <len>
|
2008-07-18 01:02:16 -05:00
|
|
|
and
|
2008-07-21 05:16:14 -05:00
|
|
|
reset init
|
2008-07-18 01:02:16 -05:00
|
|
|
load
|
2009-09-21 13:48:22 -05:00
|
|
|
|
|
|
|
In most cases this can be accomplished by specifying the default startup mode as reset_init (target command
|
2008-04-09 02:31:24 -05:00
|
|
|
in the configuration file).
|
2009-09-21 13:48:22 -05:00
|
|
|
|
|
|
|
2. If the target is correctly configured, flash must be writable without any other helper commands. It is
|
2008-04-09 02:31:24 -05:00
|
|
|
assumed that all write-protect mechanisms should be disabled.
|
2008-04-29 05:22:20 -05:00
|
|
|
|
|
|
|
3. The configuration scripts should be defined such as the binary that was written to flash verifies
|
2009-09-21 13:48:22 -05:00
|
|
|
(turn off remapping, checksums, etc...)
|
2008-04-29 05:22:20 -05:00
|
|
|
|
|
|
|
flash write_image [file] <parameters>
|
|
|
|
verify_image [file] <parameters>
|
2008-05-19 03:03:17 -05:00
|
|
|
|
|
|
|
4. jtag_khz sets the maximum speed (or alternatively RCLK). If invoked
|
|
|
|
multiple times only the last setting is used.
|
|
|
|
|
|
|
|
interface/xxx.cfg files are always executed *before* target/xxx.cfg
|
|
|
|
files, so any jtag_khz in interface/xxx.cfg will be overridden by
|
|
|
|
target/xxx.cfg. jtag_khz in interface/xxx.cfg would then, effectively,
|
|
|
|
set the default JTAG speed.
|
|
|
|
|
|
|
|
Note that a target/xxx.cfg file can invoke another target/yyy.cfg file,
|
|
|
|
so one can create target subtype configurations where e.g. only
|
2009-03-12 09:48:51 -05:00
|
|
|
amount of DRAM, oscillator speeds differ and having a single
|
2008-05-19 03:03:17 -05:00
|
|
|
config file for the default/common settings.
|
|
|
|
|