gdb: clean up error handling in step/continue
[fw/openocd] / src / server / httpd / production.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                 <html xmlns="http://www.w3.org/TR/REC-html40">
25 <head>
26 <title>OpenOCD debugger</title>
27 <meta charset="utf-8" content="text/html" http-equiv="Content-Type"/>
28 <link type="text/css" rel="stylesheet" href="menuweb.css"/>
29 </head>
30 }
31
32                                 set console ""
33                                 set upload_filename /ram/upload
34                         
35 append buffer {
36 <body style="margin:0px;">
37 <div style="width:974px;height:85px;">
38 <div style="float:left;position:relative;left:32px;width:478px;">
39 <a href="/">
40                                                         OpenOCD
41                                                 </a>
42 </div>
43 <div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('menu_cuts/top_right.png');">
44 <div style="position:relative;left:15px;top:4px;" class="textlight">
45 }
46 append buffer [capture version]
47 append buffer {
48 </div>
49 </div>
50 </div>
51 <table style="padding:0px;border-collapse:collapse;">
52 <tr>
53 <td style="width:33px;">
54 <div style="width:20px;height:510px;">
55                                                                 &nbsp;
56                                                         </div>
57 </td>
58 <td style="vertical-align:top;height:100%;width:140px;padding:0px;">
59 <table style="padding:0px;border-collapse:collapse;height:100%;width:140px;">
60 <tr style="height:59px;">
61 <td/>
62 </tr>
63 <tr>
64 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">
65 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
66 <a href="flashinfo.tcl" style="">Info</a>
67 </div>
68 </td>
69 </tr>
70 <tr>
71 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">
72 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
73 <a href="erase.tcl" style="">Erase</a>
74 </div>
75 </td>
76 </tr>
77 <tr>
78 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab.png');background-repeat: no-repeat;">
79 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
80 <a href="flash.tcl" style="">Program / Verify</a>
81 </div>
82 </td>
83 </tr>
84 <tr>
85 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab_selected.png');background-repeat: no-repeat;">
86 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
87 <a href="production.tcl" style="font-weight: bold;">Production</a>
88 </div>
89 </td>
90 </tr>
91 <tr>
92 <td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"/>
93 </tr>
94 <tr>
95 <td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"/>
96 </tr>
97 <tr>
98 <td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"/>
99 </tr>
100 </table>
101 </td>
102 <td style="vertical-align:top;padding:0px;height:100%">
103 <table style="padding:0px;border-collapse:collapse;height:100%;">
104 <tr>
105 <td>
106 <table style="padding:0px;border-collapse:collapse;">
107 <tr>
108 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
109 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
110 <a href="index.tcl">Config Target</a>
111 </div>
112 </td>
113 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1_selected.png');background-repeat: no-repeat;">
114 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
115 <a href="flashinfo.tcl" style="font-weight: bold;">Flash</a>
116 </div>
117 </td>
118 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
119 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
120 <a href="browsemem.tcl">Memory</a>
121 </div>
122 </td>
123 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
124 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
125 <a href="openocd.tcl">OpenOCD</a>
126 </div>
127 </td>
128 </tr>
129 </table>
130 </td>
131 </tr>
132 <tr>
133 <td style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;" colspan="6">
134 <div style="width:500px;background-color:#ffffff;height:100%;">
135                                                                                         &nbsp;
136                                                                                 </div>
137 </td>
138 </tr>
139 <tr>
140 <td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6">
141 <H1>Production</H1>
142 </td>
143 </tr>
144 <tr style="height:100%;">
145 <td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6">
146                         }
147
148                                 set form_action [formfetch form_action]
149                                 set form_serialnumber [formfetch form_serialnumber]
150                                 append buffer [production_info]
151                         
152 append buffer {
153                                 
154                         <form enctype="multipart/form-data" action="production.tcl" method="post">
155                                 <code style="white-space: nowrap;">
156                                         }
157         
158                                                 if {[string compare $form_action "Upload firmware"]==0} {
159                                                         set wrotedata [catch {writeform form_filecontent $upload_filename} result]  
160                                                         append buffer [encode $result]
161                                                         if {$wrotedata==0} {
162                                                                 append buffer "<br>Running production procedure<p>"
163                                                                 append buffer "<br>Reset and init: <br>"
164                                                                 
165                                                                 append console [encode [capture_catch {catch "production $upload_filename $form_serialnumber"}]]
166                                                         }
167                                                 }
168                                                 if {[string compare $form_action "Test"]==0} {
169                                                         append buffer "<br>Running production test. Output from first 10 seconds printed below. <p>"
170                                                         
171                                                         append console [encode [capture_catch {catch production_test}]]
172                                                 }
173                                                 if {[string compare $form_action "Power on"]==0} {
174                                                         append console [encode [capture_catch "power on"]]
175                                                 }
176                                                 if {[string compare $form_action "Power off"]==0} {
177                                                         append console [encode [capture_catch "power off"]]
178                                                 }
179                                         
180 append buffer {
181                                 </code>
182                                 }
183
184                                         append buffer {<p class="formtext">Firmware file(raw binary) <input type="file" name="form_filecontent"><p>}
185                                         append buffer {<p class="formtext">Serial number <input type="text" name="form_serialnumber"><p>}
186                                 
187 append buffer {
188                                 
189                                 <table>
190                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>
191                                         <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
192                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>
193                                 </table>
194                         
195                                 <table><tr>
196                                         <td><input type="submit" name="form_action" value="Upload firmware" ></td>
197                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Test"></td>
198                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Power on"></td>
199                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Power off">
200                                 </tr></table>
201                         </form>
202                         
203                         </td>
204 </tr>
205 }
206
207                                                                         
208                                                                         set toggle_details [formfetch toggle_details]
209                                                                         if {[string length $toggle_details]==0} {
210                                                                                 set toggle_details 0
211                                                                         }
212                                                                         set show_details [load_var show_details]
213                                                                         if {[string length $show_details]==0} {
214                                                                                 set show_details 0
215                                                                         }
216                                                                         if {$toggle_details==1} {
217                                                                                 set show_details [expr 1-$show_details]
218                                                                                 save_var show_details $show_details
219                                                                         }
220                                                                         
221                                                                         if {[string length $console]!=0} {
222                                                                                 
223 append buffer {
224 <tr style="height:100%;">
225 <td style="height:100%;background-color:red;" colspan="6">
226 <table style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%" class="textgray">
227 <td style="width:25px;">&nbsp;</td>
228 }
229
230                                                                                                                 if {$show_details==1} {
231                                                                                                                         append buffer <
232                                                                                                                         append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"}
233                                                                                                                         append buffer >
234                                                                                                                 } else {
235                                                                                                                         append buffer <
236                                                                                                                         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;"}
237                                                                                                                         append buffer >
238                                                                                                                 }
239                                                                                                         
240 append buffer {
241 <a class="openocd" href="production.tcl?toggle_details=1">
242 }
243
244                                                                                                                         if {$show_details==1} {
245                                                                                                                                 append buffer "Hide details"
246                                                                                                                                 append buffer <br/>
247                                                                                                                         } else {
248                                                                                                                                 append buffer {<div style="position:relative;top:7px;text-align:center;">}
249                                                                                                                                 append buffer "Show details"
250                                                                                                                                 append buffer {</div>}
251                                                                                                                         }
252                                                                                                                         
253 append buffer {
254 </a>
255 }
256
257                                                                                                                         if {$show_details==1} {
258                                                                                                                                 append buffer $console
259                                                                                                                         }
260                                                                                                                 
261 append buffer {</td>}
262
263                                                                                                                 if {$show_details!=1} {
264                                                                                                                         append buffer {<td>&nbsp;</td>}
265                                                                                                                 }
266                                                                                                          
267 append buffer {
268 <td style="width:25px;">&nbsp;</td>
269 </table>
270 </td>
271 </tr>
272 }
273
274                                                                          }
275                                                                 
276 append buffer {
277 <tr>
278 <td style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;" colspan="6">
279 <div style="width:500px;background-color:#ffffff;height:100%;">
280                                                                                         &nbsp;
281                                                                                 </div>
282 </td>
283 </tr>
284 </table>
285 </td>
286 <td style="width:6px;"/>
287 <td style="width:245px;height:100%">
288 <table style="padding:0px;border-collapse:collapse;height:100%;">
289 <tr>
290 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;">
291 <div style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;" class="textgray">
292                                                                                     Documentation
293                                                                                  </div>
294 </td>
295 <td width="40px">
296                                                                                 &nbsp;
297                                                                         </td>
298 <td/>
299 </tr>
300 <tr>
301 <td style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');" colspan="3"/>
302 </tr>
303 <tr>
304 <td style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;" colspan="3">
305 <a target="_blank" href="http://openocd.berlios.de/doc/openocd.pdf">OpenOCD Manual</a>
306 <br/>
307 </td>
308 </tr>
309 <tr>
310 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>
311 </tr>
312 <tr>
313 <td colspan="3">
314 <table style="padding:0px;border-collapse:collapse;">
315 <td style="background-color:#d8d7d7;width:10px;height:1px"/>
316 <td style="background-color:#999999;width:225px; height:1px;"/>
317 <td style="background-color:#d8d7d7;width:10px;height:1px"/>
318 </table>
319 </td>
320 </tr>
321 <tr>
322 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>
323 </tr>
324 <tr style="height:100%;">
325 <td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray">
326                                 
327                                 The target script can implement the "production", "production_info" and "production_test" tcl proc's. These procedures
328                                 are used on this page. There are default implementations that do nothing.
329                                 
330                                 <p><b>Upload firmware</b> - Power cycle target, reset target and program raw binary file to flash bank 0, offset 0 and verify flash programming. Leave target powered on.</p>
331                                 <p><b>Test</b> -  Power up target, run 10 second target test. Output is provided via the DCC output channel. </p>
332                                 <p><b>Power on</b> - Power on target.</p>
333                                 <p><b>Power off</b> - Power off target.</p>
334                                 <p><b>Serial number</b> - A target script can use this string in the production procedure. Type "help production" for more info.</p>
335                                          
336                         </td>
337 </tr>
338 <tr>
339 <td style="height:30px;background-image:url('menu_cuts/right_bottom.png');" colspan="3">
340                                                                                 &nbsp;
341                                                                         </td>
342 </tr>
343 </table>
344 </td>
345 </tr>
346 </table>
347 </body>
348 </html>
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                 
385         
386         
387 }
388
389 start_chunked "html"
390 write_chunked $buffer
391 end_chunked
392