nds32: add new target type nds32_v2, nds32_v3, nds32_v3m
[openocd.git] / src / flash / startup.tcl
1 # Defines basic Tcl procs for OpenOCD flash module
2
3 #
4 # program utility proc
5 # usage: program filename
6 # optional args: verify, reset and address
7 #
8
9 proc program {filename args} {
10
11 foreach arg $args {
12 if {[string equal $arg "verify"]} {
13 set verify 1
14 } elseif {[string equal $arg "reset"]} {
15 set reset 1
16 } else {
17 set address $arg
18 }
19 }
20
21 # make sure init is called
22 if {[catch {init}] != 0} {
23 echo "** OpenOCD init Failed **"
24 shutdown
25 return
26 }
27
28 # reset target and call any init scripts
29 if {[catch {reset init}] != 0} {
30 echo "** Unable to reset target **"
31 shutdown
32 return
33 }
34
35 # start programming phase
36 echo "** Programming Started **"
37 if {[info exists address]} {
38 set flash_args "$filename $address"
39 } else {
40 set flash_args "$filename"
41 }
42
43 if {[catch {eval flash write_image erase $flash_args}] == 0} {
44 echo "** Programming Finished **"
45 if {[info exists verify]} {
46 # verify phase
47 echo "** Verify Started **"
48 if {[catch {eval verify_image $flash_args}] == 0} {
49 echo "** Verified OK **"
50 } else {
51 echo "** Verify Failed **"
52 }
53 }
54
55 if {[info exists reset]} {
56 # reset target if requested
57 # also disable target polling, we are shutting down anyway
58 poll off
59 echo "** Resetting Target **"
60 reset run
61 }
62 } else {
63 echo "** Programming Failed **"
64 }
65
66 # shutdown OpenOCD
67 shutdown
68 }
69
70 add_help_text program "write an image to flash, address is only required for binary images. verify, reset are optional"
71 add_usage_text program "<filename> \[address\] \[verify\] \[reset\]"
72
73 # ease migration to updated flash driver
74 proc stm32x args {
75 echo "DEPRECATED! use 'stm32f1x $args' not 'stm32x $args'"
76 eval stm32f1x $args
77 }
78
79 proc stm32f2xxx args {
80 echo "DEPRECATED! use 'stm32f2x $args' not 'stm32f2xxx $args'"
81 eval stm32f2x $args
82 }

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)