tcl/target: add SPDX tag
[fw/openocd] / tcl / target / readme.txt
1 # SPDX-License-Identifier: GPL-2.0-or-later
2
3 Prerequisites:
4 The users of OpenOCD as well as computer programs interacting with OpenOCD are expecting that certain commands
5 do the same thing across all the targets.
6
7 Rules to follow when writing scripts:
8
9 1. The configuration script should be defined such as , for example, the following sequences are working:
10         reset
11         flash info <bank>
12 and
13         reset
14         flash erase_address <start> <len>
15 and
16         reset init
17         load
18
19 In most cases this can be accomplished by specifying the default startup mode as reset_init (target command
20 in the configuration file).
21
22 2. If the target is correctly configured, flash must be writable without any other helper commands. It is
23 assumed that all write-protect mechanisms should be disabled.
24
25 3. The configuration scripts should be defined such as the binary that was written to flash verifies
26 (turn off remapping, checksums, etc...)
27
28 flash write_image [file] <parameters>
29 verify_image [file] <parameters>
30
31 4. adapter speed sets the maximum speed (or alternatively RCLK). If invoked
32 multiple times only the last setting is used.
33
34 interface/xxx.cfg files are always executed *before* target/xxx.cfg
35 files, so any adapter speed in interface/xxx.cfg will be overridden by
36 target/xxx.cfg. adapter speed in interface/xxx.cfg would then, effectively,
37 set the default JTAG speed.
38
39 Note that a target/xxx.cfg file can invoke another target/yyy.cfg file,
40 so one can create target subtype configurations where e.g. only
41 amount of DRAM, oscillator speeds differ and having a single
42 config file for the default/common settings.