Add comments and tiny improvements to STM32 flash loader algorithm
[openocd.git] / src / server / httpd / erase.tcl
1 # converted to .tcl by html2tcl.tcl
2 set buffer ""
3 append buffer {
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28 <html xmlns="http://www.w3.org/TR/REC-html40">
29 <head>
30 <title>OpenOCD debugger</title>
31 <meta charset="utf-8" content="text/html" http-equiv="Content-Type"/>
32 <link type="text/css" rel="stylesheet" href="menuweb.css"/>
33 </head>
34 }
35
36 set console ""
37 set upload_filename /ram/upload
38
39 append buffer {
40 <body style="margin:0px;">
41 <div style="width:974px;height:85px;">
42 <div style="float:left;position:relative;left:32px;width:478px;">
43 <a href="/">
44 OpenOCD
45 </a>
46 </div>
47 <div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('menu_cuts/top_right.png');">
48 <div style="position:relative;left:15px;top:4px;" class="textlight">
49 }
50 append buffer [capture version]
51 append buffer {
52 </div>
53 </div>
54 </div>
55 <table style="padding:0px;border-collapse:collapse;">
56 <tr>
57 <td style="width:33px;">
58 <div style="width:20px;height:510px;">
59 &nbsp;
60 </div>
61 </td>
62 <td style="vertical-align:top;height:100%;width:140px;padding:0px;">
63 <table style="padding:0px;border-collapse:collapse;height:100%;width:140px;">
64 <tr style="height:59px;">
65 <td/>
66 </tr>
67 <tr>
68 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">
69 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
70 <a href="flashinfo.tcl" style="">Info</a>
71 </div>
72 </td>
73 </tr>
74 <tr>
75 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab_selected.png');background-repeat: no-repeat;">
76 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
77 <a href="erase.tcl" style="font-weight: bold;">Erase</a>
78 </div>
79 </td>
80 </tr>
81 <tr>
82 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">
83 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
84 <a href="flash.tcl" style="">Program / Verify</a>
85 </div>
86 </td>
87 </tr>
88 <tr>
89 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">
90 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
91 <a href="production.tcl" style="">Production</a>
92 </div>
93 </td>
94 </tr>
95 <tr>
96 <td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"/>
97 </tr>
98 <tr>
99 <td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"/>
100 </tr>
101 <tr>
102 <td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"/>
103 </tr>
104 </table>
105 </td>
106 <td style="vertical-align:top;padding:0px;height:100%">
107 <table style="padding:0px;border-collapse:collapse;height:100%;">
108 <tr>
109 <td>
110 <table style="padding:0px;border-collapse:collapse;">
111 <tr>
112 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
113 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
114 <a href="index.tcl">Config Target</a>
115 </div>
116 </td>
117 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1_selected.png');background-repeat: no-repeat;">
118 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
119 <a href="flashinfo.tcl" style="font-weight: bold;">Flash</a>
120 </div>
121 </td>
122 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
123 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
124 <a href="browsemem.tcl">Memory</a>
125 </div>
126 </td>
127 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
128 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
129 <a href="openocd.tcl">OpenOCD</a>
130 </div>
131 </td>
132 </tr>
133 </table>
134 </td>
135 </tr>
136 <tr>
137 <td style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;" colspan="6">
138 <div style="width:500px;background-color:#ffffff;height:100%;">
139 &nbsp;
140 </div>
141 </td>
142 </tr>
143 <tr>
144 <td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6">
145 <H1>Erase Flash</H1>
146 </td>
147 </tr>
148 <tr style="height:100%;">
149 <td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6">
150
151
152
153 }
154
155
156 set form_address [formfetch form_address]
157 set form_length [formfetch form_length]
158 set form_action [formfetch form_action]
159
160 if {[string compare $form_length ""]==0} {
161 set form_length 0x10000
162 }
163 if {[string compare $form_address ""]==0} {
164 if {[catch {[first_flash_base]} result]==0} {
165 set form_address "0x[tohex $result]"
166 }
167 }
168
169
170 if {[string compare $form_address ""]!=0} {
171 if {[string compare $form_action "Erase"]==0} {
172 append buffer "<code style=\"white-space: nowrap;\">"
173 append console [encode [capture_catch {
174 reset init
175 flash erase_address $form_address $form_length}]]
176 append buffer </code>
177 }
178 }
179
180
181
182 append buffer {
183
184 <form action="erase.tcl" method="post">
185 <table>
186 <tr><td class="formtext" style="padding-right:10px;">Address</td><td><input type="text" name="form_address" value="}
187 append buffer $form_address
188 append buffer {"></td></tr>
189 <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="}
190 append buffer $form_length
191 append buffer {"></td></tr>
192 </td></tr>
193 </table>
194 <table>
195 <tr><td style="height:15px;width:535px;">&nbsp</td></tr>
196 <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
197 <tr><td style="height:15px;width:535px;">&nbsp</td></tr>
198 </table>
199
200 <input type="submit" name="form_action" value="Erase"><br>
201
202
203 </form>
204
205
206
207 </td>
208 </tr>
209 }
210
211
212 set toggle_details [formfetch toggle_details]
213 if {[string length $toggle_details]==0} {
214 set toggle_details 0
215 }
216 set show_details [load_var show_details]
217 if {[string length $show_details]==0} {
218 set show_details 0
219 }
220 if {$toggle_details==1} {
221 set show_details [expr 1-$show_details]
222 save_var show_details $show_details
223 }
224
225 if {[string length $console]!=0} {
226
227 append buffer {
228 <tr style="height:100%;">
229 <td style="height:100%;background-color:red;" colspan="6">
230 <table style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%" class="textgray">
231 <td style="width:25px;">&nbsp;</td>
232 }
233
234 if {$show_details==1} {
235 append buffer <
236 append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"}
237 append buffer >
238 } else {
239 append buffer <
240 append buffer {td style="background-image:url('menu_cuts/h_tab_free.png');width:110px;height:29px;background-repeat: no-repeat;background-position:top left;"}
241 append buffer >
242 }
243
244 append buffer {
245 <a class="openocd" href="erase.tcl?toggle_details=1">
246 }
247
248 if {$show_details==1} {
249 append buffer "Hide details"
250 append buffer <br/>
251 } else {
252 append buffer {<div style="position:relative;top:7px;text-align:center;">}
253 append buffer "Show details"
254 append buffer {</div>}
255 }
256
257 append buffer {
258 </a>
259 }
260
261 if {$show_details==1} {
262 append buffer $console
263 }
264
265 append buffer {</td>}
266
267 if {$show_details!=1} {
268 append buffer {<td>&nbsp;</td>}
269 }
270
271 append buffer {
272 <td style="width:25px;">&nbsp;</td>
273 </table>
274 </td>
275 </tr>
276 }
277
278 }
279
280 append buffer {
281 <tr>
282 <td style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;" colspan="6">
283 <div style="width:500px;background-color:#ffffff;height:100%;">
284 &nbsp;
285 </div>
286 </td>
287 </tr>
288 </table>
289 </td>
290 <td style="width:6px;"/>
291 <td style="width:245px;height:100%">
292 <table style="padding:0px;border-collapse:collapse;height:100%;">
293 <tr>
294 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;">
295 <div style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;" class="textgray">
296 Documentation
297 </div>
298 </td>
299 <td width="40px">
300 &nbsp;
301 </td>
302 <td/>
303 </tr>
304 <tr>
305 <td style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');" colspan="3"/>
306 </tr>
307 <tr>
308 <td style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;" colspan="3">
309 <a target="_blank" href="http://openocd.berlios.de/doc/openocd.pdf">OpenOCD Manual</a>
310 <br/>
311 </td>
312 </tr>
313 <tr>
314 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>
315 </tr>
316 <tr>
317 <td colspan="3">
318 <table style="padding:0px;border-collapse:collapse;">
319 <td style="background-color:#d8d7d7;width:10px;height:1px"/>
320 <td style="background-color:#999999;width:225px; height:1px;"/>
321 <td style="background-color:#d8d7d7;width:10px;height:1px"/>
322 </table>
323 </td>
324 </tr>
325 <tr>
326 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>
327 </tr>
328 <tr style="height:100%;">
329 <td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray">
330
331 <p>Note that flash programming will erase flash if required.<p/>
332 <p>Reset and init CPU, then erase address range.</p>
333 <p>The length field is specified in number of bytes.</p>
334
335 </td>
336 </tr>
337 <tr>
338 <td style="height:30px;background-image:url('menu_cuts/right_bottom.png');" colspan="3">
339 &nbsp;
340 </td>
341 </tr>
342 </table>
343 </td>
344 </tr>
345 </table>
346 </body>
347 </html>
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382 }
383
384 start_chunked "html"
385 write_chunked $buffer
386 end_chunked
387

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)