httpd wip
[openocd.git] / src / server / httpd / flash.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 <html xmlns="http://www.w3.org/TR/REC-html40">
22 <head>
23 <title>OpenOCD debugger</title>
24 <meta charset="utf-8" content="text/html" http-equiv="Content-Type"/>
25 <link type="text/css" rel="stylesheet" href="menuweb.css"/>
26 </head>
27 }
28
29 set console ""
30 set upload_filename /ram/upload
31
32 append buffer {
33 <body style="margin:0px;">
34 <div style="width:974px;height:85px;">
35 <div style="float:left;position:relative;left:32px;width:478px;">
36 <a href="/">
37 OpenOCD
38 </a>
39 </div>
40 <div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('menu_cuts/top_right.png');">
41 <div style="position:relative;left:15px;top:4px;" class="textlight">
42 }
43 append buffer [capture version]
44 append buffer {
45 </div>
46 </div>
47 </div>
48 <table style="padding:0px;border-collapse:collapse;">
49 <tr>
50 <td style="width:33px;">
51 <div style="width:20px;height:510px;">
52 &nbsp;
53 </div>
54 </td>
55 <td style="vertical-align:top;height:100%;width:140px;padding:0px;">
56 <table style="padding:0px;border-collapse:collapse;height:100%;width:140px;">
57 <tr style="height:59px;">
58 <td/>
59 </tr>
60 <tr>
61 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">
62 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
63 <a href="flashinfo.tcl" style="">Info</a>
64 </div>
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="erase.tcl" style="">Erase</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="flash.tcl" style="font-weight: bold;">Program / Verify</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="production.tcl" style="">Production</a>
85 </div>
86 </td>
87 </tr>
88 <tr>
89 <td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"/>
90 </tr>
91 <tr>
92 <td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"/>
93 </tr>
94 <tr>
95 <td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"/>
96 </tr>
97 </table>
98 </td>
99 <td style="vertical-align:top;padding:0px;height:100%">
100 <table style="padding:0px;border-collapse:collapse;height:100%;">
101 <tr>
102 <td>
103 <table style="padding:0px;border-collapse:collapse;">
104 <tr>
105 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
106 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
107 <a href="index.tcl">Config Target</a>
108 </div>
109 </td>
110 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1_selected.png');background-repeat: no-repeat;">
111 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
112 <a href="flashinfo.tcl" style="font-weight: bold;">Flash</a>
113 </div>
114 </td>
115 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
116 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
117 <a href="browsemem.tcl">Memory</a>
118 </div>
119 </td>
120 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
121 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
122 <a href="openocd.tcl">OpenOCD</a>
123 </div>
124 </td>
125 </tr>
126 </table>
127 </td>
128 </tr>
129 <tr>
130 <td style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;" colspan="6">
131 <div style="width:500px;background-color:#ffffff;height:100%;">
132 &nbsp;
133 </div>
134 </td>
135 </tr>
136 <tr>
137 <td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6">
138 <H1>Program / Verify Flash</H1>
139 </td>
140 </tr>
141 <tr style="height:100%;">
142 <td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6">
143
144 }
145
146
147 set form_offset [formfetch form_offset]
148 set form_action [formfetch form_action]
149 set form_type [formfetch form_type]
150
151
152 set post ""
153 catch {set post $post_data} err
154
155 if {[string compare $form_offset ""]==0} {
156 set form_offset 0
157 }
158 if {[string compare $form_type ""]==0} {
159 set form_type ""
160 }
161
162
163 append buffer {<code style="white-space: nowrap;">}
164
165
166 set data ""
167 append buffer {<form enctype="multipart/form-data" action="flash.tcl" method="post">}
168
169 set action_reset [expr {[string length $form_action]!=0}]
170 set action_flash [expr {[string compare $form_action "Flash"]==0 || [string compare $form_action "Flash and verify"]==0}]
171 set action_verify [expr {[string compare $form_action "Verify"]==0 || [string compare $form_action "Flash and verify"]==0}]
172
173 if {$action_reset} {
174 append console [encode [capture_catch "reset init"]]
175 }
176
177 append buffer {
178 </code>}
179
180
181 append buffer {<table>}
182 append buffer {<tr><td class="formtext">File</td><td><input type="file" name="form_filecontent"></td></tr>}
183 append buffer "<tr><td class=\"formtext\" >Offset</td><td><input type=\"text\" name=\"form_offset\" value=\"$form_offset\"></td></tr>"
184
185
186 append buffer {
187 <tr><td class="formtext" style="padding-top:1px;">Type</td><td>
188 <select name="form_type">
189 <option
190 }
191 if {[string compare $form_type ""]==0} { append buffer {selected="selected"} }
192 append buffer {
193 value ="">auto</option>
194 <option
195 }
196 if {[string compare $form_type "elf"]==0} { append buffer {selected="selected"} }
197 append buffer {
198 value ="elf">elf</option>
199 <option
200 }
201 if {[string compare $form_type "bin"]==0} { append buffer {selected="selected"} }
202 append buffer {
203 value ="bin">binary</option>
204 <option
205 }
206 if {[string compare $form_type "ihex"]==0} { append buffer {selected="selected"} }
207 append buffer {
208 value ="ihex">ihex</option>
209 <!-- broken <option value ="s19">s19</option> -->
210 </select>
211 </td>
212
213 </tr>
214
215
216 </table>
217
218 <table>
219 <tr><td style="height:15px;width:535px;">&nbsp</td></tr>
220 <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
221 <tr><td style="height:15px;width:535px;">&nbsp</td></tr>
222 </table>
223
224 <table><tr>
225 <td><input type="submit" name="form_action" value="Flash" ></td>
226 <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Flash and verify" ></td>
227 <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Verify" ></td>
228 </tr></table>
229
230 <p>
231 }
232
233
234 if {$action_flash||$action_verify} {
235 catch {writeform form_filecontent $upload_filename} result
236 append console [encode $result]
237 }
238 append buffer "<br>"
239 if {$action_flash} {
240 append console [encode [capture_catch "halt"]]
241 append buffer "<b>"
242 if {[catch {capture_catch {eval "flash write_image erase $upload_filename $form_offset $form_type"}} result]} {
243 append buffer "Flash write failed<br>"
244 append console [encode $result]
245 } else {
246 append buffer [encode $result]
247 append buffer "Flash write succeed<br>"
248 }
249 append buffer "</b>"
250 }
251 if {$action_verify} {
252 append console [encode [capture_catch "halt"]]
253 append buffer "<b>"
254 if {[catch {capture_catch {eval "verify_image $upload_filename $form_offset $form_type"}} result]} {
255 append buffer "Verify failed<br>"
256 append console [encode $result]
257 } else {
258 append buffer [encode $result]
259 append buffer "Verify succeed<br>"
260 }
261 append buffer "</b>"
262 }
263
264 append buffer {
265
266 </form>
267
268 </td>
269 </tr>
270 }
271
272
273 set toggle_details [formfetch toggle_details]
274 if {[string length $toggle_details]==0} {
275 set toggle_details 0
276 }
277 set show_details [load_var show_details]
278 if {[string length $show_details]==0} {
279 set show_details 0
280 }
281 if {$toggle_details==1} {
282 set show_details [expr 1-$show_details]
283 save_var show_details $show_details
284 }
285
286 if {[string length $console]!=0} {
287
288 append buffer {
289 <tr style="height:100%;">
290 <td style="height:100%;background-color:red;" colspan="6">
291 <table style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%" class="textgray">
292 <td style="width:25px;">&nbsp;</td>
293 }
294
295 if {$show_details==1} {
296 append buffer <
297 append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"}
298 append buffer >
299 } else {
300 append buffer <
301 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;"}
302 append buffer >
303 }
304
305 append buffer {
306 <a class="openocd" href="flash.tcl?toggle_details=1">
307 }
308
309 if {$show_details==1} {
310 append buffer "Hide details"
311 append buffer <br/>
312 } else {
313 append buffer {<div style="position:relative;top:7px;text-align:center;">}
314 append buffer "Show details"
315 append buffer {</div>}
316 }
317
318 append buffer {
319 </a>
320 }
321
322 if {$show_details==1} {
323 append buffer $console
324 }
325
326 append buffer {</td>}
327
328 if {$show_details!=1} {
329 append buffer {<td>&nbsp;</td>}
330 }
331
332 append buffer {
333 <td style="width:25px;">&nbsp;</td>
334 </table>
335 </td>
336 </tr>
337 }
338
339 }
340
341 append buffer {
342 <tr>
343 <td style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;" colspan="6">
344 <div style="width:500px;background-color:#ffffff;height:100%;">
345 &nbsp;
346 </div>
347 </td>
348 </tr>
349 </table>
350 </td>
351 <td style="width:6px;"/>
352 <td style="width:245px;height:100%">
353 <table style="padding:0px;border-collapse:collapse;height:100%;">
354 <tr>
355 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;">
356 <div style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;" class="textgray">
357 Documentation
358 </div>
359 </td>
360 <td width="40px">
361 &nbsp;
362 </td>
363 <td/>
364 </tr>
365 <tr>
366 <td style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');" colspan="3"/>
367 </tr>
368 <tr>
369 <td style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;" colspan="3">
370 <a target="_blank" href="http://openocd.berlios.de/doc/openocd.pdf">OpenOCD Manual</a>
371 <br/>
372 </td>
373 </tr>
374 <tr>
375 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>
376 </tr>
377 <tr>
378 <td colspan="3">
379 <table style="padding:0px;border-collapse:collapse;">
380 <td style="background-color:#d8d7d7;width:10px;height:1px"/>
381 <td style="background-color:#999999;width:225px; height:1px;"/>
382 <td style="background-color:#d8d7d7;width:10px;height:1px"/>
383 </table>
384 </td>
385 </tr>
386 <tr>
387 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>
388 </tr>
389 <tr style="height:100%;">
390 <td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray">
391
392 <p>Program and/or verify the flash on your target.</p>
393 <p><b>Flash</b> - Halt CPU, automatically erase flash if required and program flash with image.</p>
394 <p><b>Flash and verify</b> - Programs the flash and verifies the programmed flash content is correct.</p>
395 <p><b>Verify</b> - Halt CPU and verify image in flash or RAM.</p>
396 <p><b>Offset</b> - This value is added to the address of the image.<br>
397 Binary images start at address 0 by default, whereas elf and ihex have addresses encoded into the image.<br>
398 Typically 0 for elf/ihex and the address to write the image to for binary files.</p>
399
400 </td>
401 </tr>
402 <tr>
403 <td style="height:30px;background-image:url('menu_cuts/right_bottom.png');" colspan="3">
404 &nbsp;
405 </td>
406 </tr>
407 </table>
408 </td>
409 </tr>
410 </table>
411 </body>
412 </html>
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456 }
457
458 start_chunked "html"
459 write_chunked $buffer
460 end_chunked
461

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)