"flash banks" is now implemented in Tcl on top of "flash_banks". openocd_throw prefix...
[openocd.git] / src / tcl / commands.tcl
1
2 # Production command
3 # FIX!!! need to figure out how to feed back relevant output
4 # from e.g. "flash banks" command...
5 proc board_produce {filename serialnumber} {
6 openocd "reset init"
7 openocd "flash write_image erase $filename [flash] bin"]]
8 openocd "verify_image $filename [flash] bin"]]
9 echo "Successfully ran production procedure"
10 }
11
12 proc board_test {} {
13 echo "Production test not implemented"
14 }
15
16 # Show flash in human readable form
17 # This is an example of a human readable form of a low level fn
18 proc flash_banks_pretty {} {
19 set i 0
20 set result ""
21 foreach {a} [flash_banks] {
22 if {$i > 0} {
23 set result "$result\n"
24 }
25 set result [format "$result#%d: %s at 0x%08x, size 0x%08x, buswidth %d, chipwidth %d" $i [lindex $a 0] [lindex $a 1] [lindex $a 2] [lindex $a 3] [lindex $a 4]]
26 set i [expr $i+1]
27 }
28 return $result
29 }
30
31 # We need to explicitly redirect this to the OpenOCD command
32 # as Tcl defines the exit proc
33 proc exit {} {
34 openocd_throw exit
35 }
36
37 # If a fn is unknown to Tcl, we try to execute it as an OpenOCD command
38 proc unknown {args} {
39
40 # This is uglier than it needs to be since the "flash banks" is really
41 # a single command. For now only "flash banks" has been converted from
42 # C to Tcl as an example, but if we do decide to go down this path, then
43 # some more generic scheme will be put in place here.
44 #
45 # Help texts need a makeover. There needs to be help texts for
46 # tcl procs + perhaps some work w.r.t. making the help command
47 # format things prettier.
48 if {[string compare [lindex $args 0] flash]==0 && [string compare [lindex $args 1] banks]==0} {
49 return [flash_banks_pretty]
50 }
51
52 # We print out as we run the command
53 if {[string length $args]>0} {
54 openocd_throw "$args"
55 }
56 # The primary return value have been set by "openocd" above,
57 # so we need to clear it, lest we print out the output from
58 # the command twice.
59 return ""
60 }

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)