stlink: rename stlink cmd names
[openocd.git] / src / jtag / startup.tcl
1 # Defines basic Tcl procs for OpenOCD JTAG module
2
3 # Executed during "init". Can be overridden
4 # by board/target/... scripts
5 proc jtag_init {} {
6 if {[catch {jtag arp_init} err]!=0} {
7 # try resetting additionally
8 init_reset startup
9 }
10 }
11
12 # This reset logic may be overridden by board/target/... scripts as needed
13 # to provide a reset that, if possible, is close to a power-up reset.
14 #
15 # Exit requirements include: (a) JTAG must be working, (b) the scan
16 # chain was validated with "jtag arp_init" (or equivalent), (c) nothing
17 # stays in reset. No TAP-specific scans were performed. It's OK if
18 # some targets haven't been reset yet; they may need TAP-specific scans.
19 #
20 # The "mode" values include: halt, init, run (from "reset" command);
21 # startup (at OpenOCD server startup, when JTAG may not yet work); and
22 # potentially more (for reset types like cold, warm, etc)
23 proc init_reset { mode } {
24 jtag arp_init-reset
25 }
26
27 #########
28
29 # TODO: power_restore and power_dropout are currently neither
30 # documented nor supported except on ZY1000.
31
32 proc power_restore {} {
33 echo "Sensed power restore, running reset init and halting GDB."
34 reset init
35
36 # Halt GDB so user can deal with a detected power restore.
37 #
38 # After GDB is halted, then output is no longer forwarded
39 # to the GDB console.
40 set targets [target names]
41 foreach t $targets {
42 # New event script.
43 $t invoke-event arp_halt_gdb
44 }
45 }
46
47 add_help_text power_restore "Overridable procedure run when power restore is detected. Runs 'reset init' by default."
48
49 proc power_dropout {} {
50 echo "Sensed power dropout."
51 }
52
53 #########
54
55 # TODO: srst_deasserted and srst_asserted are currently neither
56 # documented nor supported except on ZY1000.
57
58 proc srst_deasserted {} {
59 echo "Sensed nSRST deasserted, running reset init and halting GDB."
60 reset init
61
62 # Halt GDB so user can deal with a detected reset.
63 #
64 # After GDB is halted, then output is no longer forwarded
65 # to the GDB console.
66 set targets [target names]
67 foreach t $targets {
68 # New event script.
69 $t invoke-event arp_halt_gdb
70 }
71 }
72
73 add_help_text srst_deasserted "Overridable procedure run when srst deassert is detected. Runs 'reset init' by default."
74
75 proc srst_asserted {} {
76 echo "Sensed nSRST asserted."
77 }
78
79 # measure actual JTAG clock
80 proc measure_clk {} {
81 set start_time [ms];
82 runtest 10000000;
83 echo "Running at more than [expr 10000.0 / ([ms]-$start_time)] kHz";
84 }
85
86 add_help_text measure_clk "Runs a test to measure the JTAG clk. Useful with RCLK / RTCK."
87
88 # BEGIN MIGRATION AIDS ... these adapter operations originally had
89 # JTAG-specific names despite the fact that the operations were not
90 # specific to JTAG, or otherewise had troublesome/misleading names.
91 #
92 # FIXME phase these aids out after about April 2011
93 #
94 proc jtag_khz args {
95 echo "DEPRECATED! use 'adapter_khz' not 'jtag_khz'"
96 eval adapter_khz $args
97 }
98
99 proc jtag_nsrst_delay args {
100 echo "DEPRECATED! use 'adapter_nsrst_delay' not 'jtag_nsrst_delay'"
101 eval adapter_nsrst_delay $args
102 }
103
104 proc jtag_nsrst_assert_width args {
105 echo "DEPRECATED! use 'adapter_nsrst_assert_width' not 'jtag_nsrst_assert_width'"
106 eval adapter_nsrst_assert_width $args
107 }
108
109 # stlink migration helpers
110 proc stlink_device_desc args {
111 echo "DEPRECATED! use 'hla_device_desc' not 'stlink_device_desc'"
112 eval hla_device_desc $args
113 }
114
115 proc stlink_serial args {
116 echo "DEPRECATED! use 'hla_serial' not 'stlink_serial'"
117 eval hla_serial $args
118 }
119
120 proc stlink_layout args {
121 echo "DEPRECATED! use 'hla_layout' not 'stlink_layout'"
122 eval hla_layout $args
123 }
124
125 proc stlink_vid_pid args {
126 echo "DEPRECATED! use 'hla_vid_pid' not 'stlink_vid_pid'"
127 eval hla_vid_pid $args
128 }
129
130 proc stlink args {
131 echo "DEPRECATED! use 'hla' not 'stlink'"
132 eval hla $args
133 }
134
135 # END MIGRATION AIDS

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)