2008-04-09 07:31:24 +00:00
|
|
|
Prerequisites:
|
2009-09-21 18:48:22 +00:00
|
|
|
The users of OpenOCD as well as computer programs interacting with OpenOCD are expecting that certain commands
|
2008-04-09 07:31:24 +00: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 18:48:22 +00:00
|
|
|
reset
|
2008-04-09 07:31:24 +00:00
|
|
|
flash erase_address <start> <len>
|
2008-07-18 06:02:16 +00:00
|
|
|
and
|
2008-07-21 10:16:14 +00:00
|
|
|
reset init
|
2008-07-18 06:02:16 +00:00
|
|
|
load
|
2009-09-21 18:48:22 +00:00
|
|
|
|
|
|
|
In most cases this can be accomplished by specifying the default startup mode as reset_init (target command
|
2008-04-09 07:31:24 +00:00
|
|
|
in the configuration file).
|
2009-09-21 18:48:22 +00:00
|
|
|
|
|
|
|
2. If the target is correctly configured, flash must be writable without any other helper commands. It is
|
2008-04-09 07:31:24 +00:00
|
|
|
assumed that all write-protect mechanisms should be disabled.
|
2008-04-29 10:22:20 +00:00
|
|
|
|
|
|
|
3. The configuration scripts should be defined such as the binary that was written to flash verifies
|
2009-09-21 18:48:22 +00:00
|
|
|
(turn off remapping, checksums, etc...)
|
2008-04-29 10:22:20 +00:00
|
|
|
|
|
|
|
flash write_image [file] <parameters>
|
|
|
|
verify_image [file] <parameters>
|
2008-05-19 08:03:17 +00:00
|
|
|
|
2010-03-15 15:37:43 +00:00
|
|
|
4. adapter_khz sets the maximum speed (or alternatively RCLK). If invoked
|
2008-05-19 08:03:17 +00:00
|
|
|
multiple times only the last setting is used.
|
|
|
|
|
|
|
|
interface/xxx.cfg files are always executed *before* target/xxx.cfg
|
2010-03-15 15:37:43 +00:00
|
|
|
files, so any adapter_khz in interface/xxx.cfg will be overridden by
|
|
|
|
target/xxx.cfg. adapter_khz in interface/xxx.cfg would then, effectively,
|
2008-05-19 08:03:17 +00:00
|
|
|
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 14:48:51 +00:00
|
|
|
amount of DRAM, oscillator speeds differ and having a single
|
2008-05-19 08:03:17 +00:00
|
|
|
config file for the default/common settings.
|
|
|
|
|