Add comments and tiny improvements to STM32 flash loader algorithm
[openocd.git] / src / server / httpd / flashinfo.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 <html xmlns="http://www.w3.org/TR/REC-html40">
18 <head>
19 <title>OpenOCD debugger</title>
20 <meta charset="utf-8" content="text/html" http-equiv="Content-Type"/>
21 <link type="text/css" rel="stylesheet" href="menuweb.css"/>
22 </head>
23 }
24
25 set console ""
26 set upload_filename /ram/upload
27
28 append buffer {
29 <body style="margin:0px;">
30 <div style="width:974px;height:85px;">
31 <div style="float:left;position:relative;left:32px;width:478px;">
32 <a href="/">
33 OpenOCD
34 </a>
35 </div>
36 <div style="float:left;position:relative;height:26px; width:278px;left:122px;background-image:url('menu_cuts/top_right.png');">
37 <div style="position:relative;left:15px;top:4px;" class="textlight">
38 }
39 append buffer [capture version]
40 append buffer {
41 </div>
42 </div>
43 </div>
44 <table style="padding:0px;border-collapse:collapse;">
45 <tr>
46 <td style="width:33px;">
47 <div style="width:20px;height:510px;">
48 &nbsp;
49 </div>
50 </td>
51 <td style="vertical-align:top;height:100%;width:140px;padding:0px;">
52 <table style="padding:0px;border-collapse:collapse;height:100%;width:140px;">
53 <tr style="height:59px;">
54 <td/>
55 </tr>
56 <tr>
57 <td style="width:140px;height:38px;background-image:url('menu_cuts/v_tab_selected.png');background-repeat: no-repeat;">
58 <div style="position:relative;left:10px;top:10px;font-weight:bold;">
59 <a href="flashinfo.tcl" style="font-weight: bold;">Info</a>
60 </div>
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="erase.tcl" style="">Erase</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="flash.tcl" style="">Program / Verify</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="production.tcl" style="">Production</a>
81 </div>
82 </td>
83 </tr>
84 <tr>
85 <td style="width:140px;height:35px;background-image:url('menu_cuts/v_1.png')"/>
86 </tr>
87 <tr>
88 <td style="width:140px;background-image:url('menu_cuts/v_2_tile.png')"/>
89 </tr>
90 <tr>
91 <td style="width:140px;height:140px;background-image:url('menu_cuts/v_3.png')"/>
92 </tr>
93 </table>
94 </td>
95 <td style="vertical-align:top;padding:0px;height:100%">
96 <table style="padding:0px;border-collapse:collapse;height:100%;">
97 <tr>
98 <td>
99 <table style="padding:0px;border-collapse:collapse;">
100 <tr>
101 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
102 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
103 <a href="index.tcl">Config Target</a>
104 </div>
105 </td>
106 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1_selected.png');background-repeat: no-repeat;">
107 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
108 <a href="flashinfo.tcl" style="font-weight: bold;">Flash</a>
109 </div>
110 </td>
111 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
112 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
113 <a href="browsemem.tcl">Memory</a>
114 </div>
115 </td>
116 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab1.png');background-repeat: no-repeat;">
117 <div style="position:relative;top:7px;font-weight:bold;text-align:center;width:100px;">
118 <a href="openocd.tcl">OpenOCD</a>
119 </div>
120 </td>
121 </tr>
122 </table>
123 </td>
124 </tr>
125 <tr>
126 <td style="height:30px;width:535px;background-image:url('menu_cuts/center_top.png');background-repeat: no-repeat;background-position:top right;" colspan="6">
127 <div style="width:500px;background-color:#ffffff;height:100%;">
128 &nbsp;
129 </div>
130 </td>
131 </tr>
132 <tr>
133 <td style="background-color:#ffffff;text-indent:30px;height:40px;" colspan="6">
134 <H1>Flash Information</H1>
135 </td>
136 </tr>
137 <tr style="height:100%;">
138 <td style="background-color:#ffffff;padding-left:30px;padding-right:30px;width=535px;height:100%;" colspan="6">
139
140 <div style="font-size:14px;">Configured flash banks:</div>
141 <p>
142 <code style="white-space: nowrap;">
143 }
144
145 set flash_return [ocd_flash_banks]
146 if {[llength $flash_return]!=0} {
147 append buffer [encode [flash banks]]
148
149 set form_action [formfetch form_action]
150 if {[string compare $form_action "Reset CPU and probe flash"]==0} {
151 append console [encode [capture_catch "reset init"]]
152 append buffer [encode [capture_catch "flash probe 0"]]
153 append buffer [encode [capture_catch "flash info 0"]]
154 }
155 } else {
156 append buffer "No flash bank configured."
157 }
158
159 append buffer {
160 <p>
161 <form action="flashinfo.tcl" method="post">
162 <input type="submit" name="form_action" value="Reset CPU and probe flash">
163 </form>
164 }
165
166 foreach a [ocd_flash_banks] {
167 append buffer "Flash bank at [format "0x%08x size 0x%08x" $a(base) $a(size)]: "
168
169 append buffer {
170 <form action="downloadmem.tcl" method="post">
171 <input type="hidden" name="form_address" value="}
172 append buffer [format "0x%08x" $a(base)]
173 append buffer {">
174 <input type="hidden" name="form_length" value="}
175 append buffer [format "0x%08x" $a(size)]
176 append buffer {">
177
178 <input type="submit" value="Download" name="form_action">
179 <br>
180 </form>
181 }
182
183 }
184
185 append buffer {
186 </code>
187
188
189 </td>
190 </tr>
191 }
192
193
194 set toggle_details [formfetch toggle_details]
195 if {[string length $toggle_details]==0} {
196 set toggle_details 0
197 }
198 set show_details [load_var show_details]
199 if {[string length $show_details]==0} {
200 set show_details 0
201 }
202 if {$toggle_details==1} {
203 set show_details [expr 1-$show_details]
204 save_var show_details $show_details
205 }
206
207 if {[string length $console]!=0} {
208
209 append buffer {
210 <tr style="height:100%;">
211 <td style="height:100%;background-color:red;" colspan="6">
212 <table style="padding:0px;border-collapse:collapse;background-color:#ffffff;width:100%" class="textgray">
213 <td style="width:25px;">&nbsp;</td>
214 }
215
216 if {$show_details==1} {
217 append buffer <
218 append buffer {td style="background-color:#dddddd;padding-left:5px;padding-right:5px;padding-top:3px;padding-bottom:3px;"}
219 append buffer >
220 } else {
221 append buffer <
222 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;"}
223 append buffer >
224 }
225
226 append buffer {
227 <a class="openocd" href="flashinfo.tcl?toggle_details=1">
228 }
229
230 if {$show_details==1} {
231 append buffer "Hide details"
232 append buffer <br/>
233 } else {
234 append buffer {<div style="position:relative;top:7px;text-align:center;">}
235 append buffer "Show details"
236 append buffer {</div>}
237 }
238
239 append buffer {
240 </a>
241 }
242
243 if {$show_details==1} {
244 append buffer $console
245 }
246
247 append buffer {</td>}
248
249 if {$show_details!=1} {
250 append buffer {<td>&nbsp;</td>}
251 }
252
253 append buffer {
254 <td style="width:25px;">&nbsp;</td>
255 </table>
256 </td>
257 </tr>
258 }
259
260 }
261
262 append buffer {
263 <tr>
264 <td style="height:30px;background-image:url('menu_cuts/center_bottom.png');background-repeat: no-repeat;background-position:top right;" colspan="6">
265 <div style="width:500px;background-color:#ffffff;height:100%;">
266 &nbsp;
267 </div>
268 </td>
269 </tr>
270 </table>
271 </td>
272 <td style="width:6px;"/>
273 <td style="width:245px;height:100%">
274 <table style="padding:0px;border-collapse:collapse;height:100%;">
275 <tr>
276 <td style="width:103px;height:29px;background-image:url('menu_cuts/h_tab2_selected.png');background-repeat: no-repeat;">
277 <div style="position:relative;top:7px;;font-weight:bold;text-align:center;width:100px;" class="textgray">
278 Documentation
279 </div>
280 </td>
281 <td width="40px">
282 &nbsp;
283 </td>
284 <td/>
285 </tr>
286 <tr>
287 <td style="height:10px;width:245px;background-image:url('menu_cuts/right_top_small.png');" colspan="3"/>
288 </tr>
289 <tr>
290 <td style="background-color:#d8d7d7;width:245px;padding-left:10px;padding-buttom:10px;line-height:17px;" colspan="3">
291 <a target="_blank" href="http://openocd.berlios.de/doc/openocd.pdf">OpenOCD Manual</a>
292 <br/>
293 </td>
294 </tr>
295 <tr>
296 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>
297 </tr>
298 <tr>
299 <td colspan="3">
300 <table style="padding:0px;border-collapse:collapse;">
301 <td style="background-color:#d8d7d7;width:10px;height:1px"/>
302 <td style="background-color:#999999;width:225px; height:1px;"/>
303 <td style="background-color:#d8d7d7;width:10px;height:1px"/>
304 </table>
305 </td>
306 </tr>
307 <tr>
308 <td style="background-color:#d8d7d7;height:15px;" colspan="3"/>
309 </tr>
310 <tr style="height:100%;">
311 <td style="height:100%;background-color:#d8d7d7;padding-left:10px;padding-right:10px;" colspan="3" class="textgray">
312
313 <p>Here you will find information about the flash chips that you have
314 in your configuration.<p/>
315 <p><b>Reset CPU and probe flash</b> - This will reset the CPU and show
316 you more detailed information about your flash. This includes information about
317 the different sectors in the flash, and the flash driver used.</p>
318
319 </td>
320 </tr>
321 <tr>
322 <td style="height:30px;background-image:url('menu_cuts/right_bottom.png');" colspan="3">
323 &nbsp;
324 </td>
325 </tr>
326 </table>
327 </td>
328 </tr>
329 </table>
330 </body>
331 </html>
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
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 start_chunked "html"
380 write_chunked $buffer
381 end_chunked
382