httpd wip
[fw/openocd] / src / server / httpd / menu.xml
1 <?xml version = "1.0" encoding="iso-8859-1" standalone="yes"?>\r
2 <?xml-stylesheet type="text/xsl" href="plaintext.xsl"?>\r
3 <website>\r
4         \r
5         <language lang="Norsk">\r
6 \r
7                 <page lang="eng">\r
8                         <outfile>index.tcl</outfile>\r
9                         <menutext>Config Target</menutext> \r
10                         <menulink>index.tcl</menulink> \r
11                         <pageheading>OpenOCD debugger</pageheading>\r
12                         <level2parent>index.tcl</level2parent>\r
13                         <level2menu href="index.tcl" title="Target Status" titlestyle="color:#4e6627;">\r
14                         </level2menu>\r
15                         <!-- \r
16                         <level2menu href="terminal.tcl" title="UART forwarding" titlestyle="color:#4e6627;">\r
17                         </level2menu>\r
18                          -->\r
19                 \r
20                         <pagetext>\r
21                         <markup_code><![CDATA[\r
22 \r
23                         \r
24                         <table>\r
25                                 <tr><td style="height:10px;width:535px;">&nbsp</td></tr>\r
26                                 <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>\r
27                                 <tr><td style="height:5px;width:535px;">&nbsp</td></tr>\r
28                         </table>\r
29 \r
30                         <H1>Target Status</H1>\r
31 \r
32                         <table>\r
33                                 <tr>\r
34                                         <td class="fontbigger">\r
35                                                 <tcl>\r
36                                                         set form_address [formfetch form_address]\r
37                                                         set form_action [formfetch form_action]\r
38                                                         \r
39                                                         if {[string compare $form_action "Halt"]==0} {\r
40                                                                 append console [encode [capture_catch "halt"]]\r
41                                                         }\r
42                                                         if {[string compare $form_action "Resume"]==0} {\r
43                                                                 append console [encode [capture_catch "resume"]]\r
44                                                         }\r
45                                                           \r
46                                                         if {[string compare $form_action "Reset and run"]==0} {\r
47                                                                 append console [encode [capture_catch "reset run"]]\r
48                                                         }\r
49                                                         \r
50                                                         if {[string compare $form_action "Power on"]==0} {\r
51                                                                 append console [encode [capture_catch "power on"]]\r
52                                                         }\r
53                                                         if {[string compare $form_action "Power off"]==0} {\r
54                                                                 append console [encode [capture_catch "power off"]]\r
55                                                         }\r
56                                                 </tcl>\r
57                                         \r
58                                                 <tcl>append console [encode [capture_catch poll]]</tcl>\r
59                                         </td>\r
60                                 </tr>\r
61                         </table>\r
62 \r
63                         <form action="index.tcl" method="post"> \r
64                                 <table><tr>\r
65                                         <td><input type="submit" name="form_action" value="Reset and run"></td>\r
66                                         <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Halt"></td>\r
67                                         <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Resume"></td>\r
68                                         <td style="width:50px;"></td><td><input type="submit" name="form_action" value="Power on"></td>\r
69                                         <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Power off"></td>\r
70                                 </tr></table>\r
71 \r
72                                 <br>                                            \r
73                                 <br>                                            \r
74                                                                                 \r
75                                 <p>\r
76                         </form>\r
77                         ]]></markup_code>\r
78                         <right_column>\r
79                                 <markup_code><![CDATA[\r
80                                         <p>Target status shows that status of the connected target. </p> \r
81                                         <p><b>Current target</b> - selected target configuration. <br>\r
82                                         <p><b>Startup</b> - whether or not the target script ran to completion. Note\r
83                                         that even if the target is disconnected, powered down or unresponsive, the\r
84                                         startup script will still run to completion. Startup - OK does not mean\r
85                                         that the target is fully operational, simply that the configuration script\r
86                                         did not contain syntax errors for instance. \r
87                                         See log for details. <br>\r
88                                         <p><b>Target power</b> - Detects power on target. <br>\r
89                                         If the JTAG cable is not connected, or the target has no power, then no target power will be detected.</p>\r
90                                         <p><b>Power on</b> - Turn on ZY1000 target power relay.</p>\r
91                                         <p><b>Power off</b> - Turn off ZY1000  target power relay.</p>\r
92                                         <p>Type "help power" in telnet for command to control power relay.</p>\r
93                                         <p><b>Reboot ZY1000</b> - Reboots ZY1000 unit. Type "help reboot" in telnet.</p>\r
94                                 ]]></markup_code>\r
95                         </right_column>\r
96                         \r
97                         </pagetext>\r
98                 </page>\r
99                 \r
100                 \r
101 \r
102 \r
103                 <page lang="eng">\r
104                         <outfile>targets.tcl</outfile>\r
105                         <level2parent>documentation.tcl</level2parent>\r
106                         <pageheading>Target config quick start guide</pageheading>\r
107                         <pagetext>\r
108                                 <markup_code><![CDATA[\r
109                                 \r
110                                 A target needs an openocd.cfg file. This config file sets up\r
111                                 the CPU, flash and reset init script. Either ZY1000 ships with an\r
112                                 openocd.cfg file for your target or you need to take an existing\r
113                                 config file and modify it for your needs.\r
114                                 <p> \r
115                                 The reset init script is crucial. It will set up e.g. MMU, chip\r
116                                 select registers, etc. after a reset. The init.cfg (reset init script)\r
117                                 is embedded into the openocd.cfg file in the sampls Zylin provides.\r
118                                 <p>\r
119                                 Writing an openocd.cfg from scratch is a non-trivial exercise, but\r
120                                 fortunally it only has to be done once for a target and afterwards it\r
121                                 rarely if ever needs to be changed.\r
122                                 \r
123                                 \r
124                                 ]]></markup_code>\r
125                                 <right_column>\r
126                                         \r
127                                           Quick start guide on how to configure a target.\r
128                                 </right_column>\r
129                         </pagetext>\r
130                         \r
131                         \r
132                 </page>\r
133 \r
134 \r
135 \r
136                 <page lang="eng">\r
137                         <outfile>reload.tcl</outfile>\r
138                         <level2parent>index.tcl</level2parent>\r
139                         <pageheading>Reload Config Scripts</pageheading>\r
140                         <pagetext>\r
141                         <markup_code><![CDATA[\r
142                         \r
143                         <tcl>\r
144                                 set form_action [formfetch form_action]\r
145         \r
146                                 if {[string compare $form_action "Reload"]==0} {\r
147                                         append buffer "Reloading Config Scripts...<p>"\r
148                                         reboot\r
149                                 }\r
150                         </tcl>\r
151                         <form enctype="multipart/form-data" action="reload.tcl" method="post">\r
152                                 <input type="submit" name="form_action" value="Reload">\r
153                         </form>\r
154                         \r
155                         ]]></markup_code>\r
156                         <right_column>\r
157                                 Restart ZY1000 to reload selected target config script.                         \r
158                         </right_column>\r
159                         </pagetext>\r
160                         \r
161                 </page>\r
162 \r
163                 \r
164                 <page lang="eng">\r
165                         <outfile>flashinfo.tcl</outfile>\r
166                         <menutext>Flash</menutext> \r
167                         <menulink>flashinfo.tcl</menulink> \r
168                         <pageheading>Flash Information</pageheading>\r
169                         <level2parent>flashinfo.tcl</level2parent>\r
170                         <level2menu href="flashinfo.tcl" title="Info" titlestyle="color:#4e6627;">\r
171                         </level2menu>\r
172                         <level2menu href="erase.tcl" title="Erase" titlestyle="color:#4e6627;">\r
173                         </level2menu>\r
174                         <level2menu href="flash.tcl" title="Program / Verify" titlestyle="color:#4e6627;">\r
175                         </level2menu>\r
176                         <level2menu href="production.tcl" title="Production" titlestyle="color:#4e6627;">\r
177                         </level2menu>\r
178 \r
179                         <pagetext>\r
180                         <markup_code><![CDATA[\r
181 \r
182                         <div style="font-size:14px;">Configured flash banks:</div>\r
183                         <p>                     \r
184                         <code style="white-space: nowrap;">\r
185                                 <tcl>\r
186                                         set flash_return [ocd_flash_banks]\r
187                                         if {[llength $flash_return]!=0} {\r
188                                                 append buffer [encode [flash banks]]\r
189                                         \r
190                                                 set form_action [formfetch form_action]\r
191                                                 if {[string compare $form_action "Reset CPU and probe flash"]==0} {\r
192                                                         append console [encode [capture_catch "reset init"]]\r
193                                                         append buffer [encode [capture_catch "flash probe 0"]]\r
194                                                         append buffer [encode [capture_catch "flash info 0"]]\r
195                                                 }\r
196                                         } else {\r
197                                                 append buffer "No flash bank configured."\r
198                                         }\r
199                                 </tcl>\r
200                                 <p>\r
201                                 <form action="flashinfo.tcl" method="post"> \r
202                                         <input type="submit" name="form_action" value="Reset CPU and probe flash">\r
203                                 </form>\r
204                                 <tcl>\r
205                                         foreach a [ocd_flash_banks] {\r
206                                                 append buffer "Flash bank at [format "0x%08x size 0x%08x" $a(base) $a(size)]: "\r
207                                                 </tcl>\r
208                                                         <form action="downloadmem.tcl" method="post"> \r
209                                                                 <input type="hidden" name="form_address" value="<tcl>append buffer [format "0x%08x" $a(base)]</tcl>">\r
210                                                                 <input type="hidden" name="form_length" value="<tcl>append buffer [format "0x%08x" $a(size)]</tcl>">\r
211                 \r
212                                                                 <input type="submit" value="Download" name="form_action">\r
213                                                                 <br>\r
214                                                         </form>\r
215                                                 <tcl>\r
216                                         }\r
217                                 </tcl>\r
218                         </code>\r
219                         \r
220 \r
221                         ]]></markup_code>\r
222                         <right_column>\r
223                                 <![CDATA[\r
224                                 <p>Here you will find information about the flash chips that you have\r
225                                 in your configuration.<p/>\r
226                                 <p><b>Reset CPU and probe flash</b> - This will reset the CPU and show\r
227                                 you more detailed information about your flash. This includes information about\r
228                                 the different sectors in the flash, and the flash driver used.</p>\r
229                                 ]]>\r
230                         </right_column>\r
231                         \r
232                         </pagetext>\r
233                 </page>\r
234 \r
235                 <page lang="eng">\r
236                         <outfile>flash.tcl</outfile>\r
237                         <level2parent>flashinfo.tcl</level2parent>\r
238                         <pageheading>Program / Verify Flash</pageheading>\r
239                         <pagetext>\r
240                         <markup_code><![CDATA[\r
241                         \r
242                         <tcl>\r
243                         \r
244                         set form_offset [formfetch form_offset]\r
245                         set form_action [formfetch form_action]\r
246                         set form_type [formfetch form_type]\r
247                         \r
248                         \r
249                         set post ""\r
250                         catch {set post $post_data} err\r
251                         \r
252                         if {[string compare $form_offset ""]==0} {\r
253                                 set form_offset 0\r
254                         }\r
255                         if {[string compare $form_type ""]==0} {\r
256                                 set form_type ""\r
257                         }\r
258                         \r
259                         </tcl><code style="white-space: nowrap;"><tcl>\r
260                         \r
261                         set data ""\r
262                         append buffer {<form enctype="multipart/form-data" action="flash.tcl" method="post">}\r
263                         \r
264                         set action_reset [expr {[string length $form_action]!=0}] \r
265                         set action_flash [expr {[string compare $form_action "Flash"]==0 || [string compare $form_action "Flash and verify"]==0}] \r
266                         set action_verify [expr {[string compare $form_action "Verify"]==0 || [string compare $form_action "Flash and verify"]==0}]\r
267                         \r
268                         if {$action_reset} {\r
269                                 append console [encode [capture_catch "reset init"]]\r
270                         }\r
271                         </tcl>\r
272                         </code><tcl>\r
273                                 \r
274                         append buffer {<table>}\r
275                         append buffer {<tr><td class="formtext">File</td><td><input type="file" name="form_filecontent"></td></tr>}\r
276                         append buffer "<tr><td class=\"formtext\" >Offset</td><td><input type=\"text\" name=\"form_offset\" value=\"$form_offset\"></td></tr>"\r
277                         \r
278                         </tcl>\r
279                         <tr><td class="formtext" style="padding-top:1px;">Type</td><td>\r
280                         <select name="form_type">\r
281                                         <option\r
282                            <tcl>if {[string compare $form_type ""]==0} { append buffer {selected="selected"} }  </tcl>\r
283                                         value ="">auto</option>\r
284                           <option \r
285                            <tcl>if {[string compare $form_type "elf"]==0} { append buffer {selected="selected"} }  </tcl>\r
286                           value ="elf">elf</option>\r
287                           <option \r
288                            <tcl>if {[string compare $form_type "bin"]==0} { append buffer {selected="selected"} }  </tcl>\r
289                           value ="bin">binary</option>\r
290                           <option \r
291                            <tcl>if {[string compare $form_type "ihex"]==0} { append buffer {selected="selected"} }  </tcl>\r
292                           value ="ihex">ihex</option>\r
293                           <!-- broken <option value ="s19">s19</option> -->\r
294                         </select>\r
295                         </td>\r
296                         \r
297                         </tr>\r
298                         \r
299                         \r
300                         </table>\r
301                         \r
302                                 <table>\r
303                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
304                                         <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>\r
305                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
306                                 </table>\r
307                         \r
308                         <table><tr>\r
309                                 <td><input type="submit" name="form_action" value="Flash" ></td>\r
310                                 <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Flash and verify" ></td>\r
311                                 <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Verify" ></td>\r
312                         </tr></table>\r
313                 \r
314                         <p>\r
315                         <tcl>\r
316                         \r
317                         if {$action_flash||$action_verify} {\r
318                                 catch {writeform form_filecontent $upload_filename} result\r
319                                 append console [encode $result]\r
320                         }\r
321                         append buffer "<br>"\r
322                         if {$action_flash} {\r
323                                 append console [encode [capture_catch "halt"]]\r
324                                 append buffer "<b>"\r
325                                 if {[catch {capture_catch {eval "flash write_image erase $upload_filename $form_offset $form_type"}} result]} {\r
326                                         append buffer "Flash write failed<br>"\r
327                                         append console [encode $result]\r
328                                 } else {\r
329                                         append buffer [encode $result]\r
330                                         append buffer "Flash write succeed<br>"\r
331                                 }\r
332                                 append buffer "</b>"\r
333                         }\r
334                         if {$action_verify} {\r
335                                 append console [encode [capture_catch "halt"]]\r
336                                 append buffer "<b>"\r
337                                 if {[catch {capture_catch {eval "verify_image $upload_filename $form_offset $form_type"}} result]} {\r
338                                         append buffer "Verify failed<br>"\r
339                                         append console [encode $result]\r
340                                 } else {\r
341                                         append buffer [encode $result]\r
342                                         append buffer "Verify succeed<br>"\r
343                                 }\r
344                                 append buffer "</b>"\r
345                         }\r
346                         </tcl>          \r
347                                 \r
348                         </form>\r
349                         \r
350                         ]]></markup_code>\r
351                         \r
352                         <right_column>\r
353                                 <![CDATA[\r
354                                 <p>Program and/or verify the flash on your target.</p>\r
355                                 <p><b>Flash</b> - Halt CPU, automatically erase flash if required and program flash with image.</p>\r
356                                 <p><b>Flash and verify</b> - Programs the flash and verifies the programmed flash content is correct.</p>\r
357                                 <p><b>Verify</b> - Halt CPU and verify image in flash or RAM.</p>\r
358                                 <p><b>Offset</b> - This value is added to the address of the image.<br> \r
359                                         Binary images start at address 0 by default, whereas elf and ihex have addresses encoded into the image.<br> \r
360                                         Typically 0 for elf/ihex and the address to     write the image to for binary files.</p>\r
361                                         ]]> \r
362                         </right_column>\r
363                         \r
364                         \r
365                         </pagetext>\r
366                         \r
367                 </page>\r
368 \r
369 \r
370 \r
371 \r
372                 <page lang="eng">\r
373                         <outfile>production.tcl</outfile>\r
374                         <level2parent>flashinfo.tcl</level2parent>\r
375                         <pageheading>Production</pageheading>\r
376                         <pagetext>\r
377                         <markup_code><![CDATA[\r
378                         <tcl>\r
379                                 set form_action [formfetch form_action]\r
380                                 set form_serialnumber [formfetch form_serialnumber]\r
381                                 append buffer [production_info]\r
382                         </tcl>\r
383                                 \r
384                         <form enctype="multipart/form-data" action="production.tcl" method="post">\r
385                                 <code style="white-space: nowrap;">\r
386                                         <tcl>   \r
387                                                 if {[string compare $form_action "Upload firmware"]==0} {\r
388                                                         set wrotedata [catch {writeform form_filecontent $upload_filename} result]  \r
389                                                         append buffer [encode $result]\r
390                                                         if {$wrotedata==0} {\r
391                                                                 append buffer "<br>Running production procedure<p>"\r
392                                                                 append buffer "<br>Reset and init: <br>"\r
393                                                                 \r
394                                                                 append console [encode [capture_catch {catch "production $upload_filename $form_serialnumber"}]]\r
395                                                         }\r
396                                                 }\r
397                                                 if {[string compare $form_action "Test"]==0} {\r
398                                                         append buffer "<br>Running production test. Output from first 10 seconds printed below. <p>"\r
399                                                         \r
400                                                         append console [encode [capture_catch {catch production_test}]]\r
401                                                 }\r
402                                                 if {[string compare $form_action "Power on"]==0} {\r
403                                                         append console [encode [capture_catch "power on"]]\r
404                                                 }\r
405                                                 if {[string compare $form_action "Power off"]==0} {\r
406                                                         append console [encode [capture_catch "power off"]]\r
407                                                 }\r
408                                         </tcl>\r
409                                 </code>\r
410                                 <tcl>\r
411                                         append buffer {<p class="formtext">Firmware file(raw binary) <input type="file" name="form_filecontent"><p>}\r
412                                         append buffer {<p class="formtext">Serial number <input type="text" name="form_serialnumber"><p>}\r
413                                 </tcl>\r
414                                 \r
415                                 <table>\r
416                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
417                                         <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>\r
418                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
419                                 </table>\r
420                         \r
421                                 <table><tr>\r
422                                         <td><input type="submit" name="form_action" value="Upload firmware" ></td>\r
423                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Test"></td>\r
424                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Power on"></td>\r
425                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Power off">\r
426                                 </tr></table>\r
427                         </form>\r
428                         \r
429                         ]]></markup_code>\r
430                         \r
431                         <right_column>\r
432                                 <![CDATA[\r
433                                 The target script can implement the "production", "production_info" and "production_test" tcl proc's. These procedures\r
434                                 are used on this page. There are default implementations that do nothing.\r
435                                 \r
436                                 <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>\r
437                                 <p><b>Test</b> -  Power up target, run 10 second target test. Output is provided via the DCC output channel. </p>\r
438                                 <p><b>Power on</b> - Power on target.</p>\r
439                                 <p><b>Power off</b> - Power off target.</p>\r
440                                 <p><b>Serial number</b> - A target script can use this string in the production procedure. Type "help production" for more info.</p>\r
441                                         ]]> \r
442                         </right_column>\r
443                         \r
444                         \r
445                         </pagetext>\r
446                         \r
447                 </page>\r
448 \r
449 \r
450 \r
451                 <page lang="eng">\r
452                         <outfile>erase.tcl</outfile>\r
453                         <menulink>erase.tcl</menulink> \r
454                         <pageheading>Erase Flash</pageheading>\r
455                         <level2parent>flashinfo.tcl</level2parent>\r
456                         <pagetext>\r
457                         <markup_code><![CDATA[\r
458 \r
459 \r
460                         \r
461                         <tcl>\r
462                         \r
463                         set form_address [formfetch form_address]\r
464                         set form_length [formfetch form_length]\r
465                         set form_action [formfetch form_action]\r
466                         \r
467                         if {[string compare $form_length ""]==0} {\r
468                                 set form_length 0x10000\r
469                         }  \r
470                         if {[string compare $form_address ""]==0} {\r
471                                 if {[catch {[zy1000_flash]} result]==0} {\r
472                                                 set form_address "0x[tohex $result]"\r
473                                         }                       \r
474                         }  \r
475                         \r
476                         \r
477                         if {[string compare $form_address ""]!=0} {\r
478                                 if {[string compare $form_action "Erase"]==0} {\r
479                                                 append buffer "<code style=\"white-space: nowrap;\">"\r
480                                                 append console [encode [capture_catch {\r
481                                                 reset init\r
482                                                 flash erase_address $form_address $form_length}]]\r
483                                                 append buffer </code>\r
484                                 }  \r
485                         }\r
486                         \r
487                         \r
488                         </tcl>\r
489                         \r
490                         <form action="erase.tcl" method="post"> \r
491                                 <table>\r
492                                 <tr><td class="formtext" style="padding-right:10px;">Address</td><td><input type="text" name="form_address" value="<tcl>append buffer $form_address</tcl>"></td></tr>\r
493                                 <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="<tcl>append buffer $form_length</tcl>"></td></tr>\r
494                                 </td></tr>\r
495                                 </table>\r
496                                 <table>\r
497                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
498                                         <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>\r
499                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
500                                 </table>\r
501                         \r
502                                 <input type="submit" name="form_action" value="Erase"><br>\r
503                                 \r
504                                 \r
505                         </form>\r
506                         \r
507 \r
508                         \r
509                         ]]></markup_code>\r
510                         <right_column>\r
511                                 <![CDATA[\r
512                                 <p>Note that flash programming will erase flash if required.<p/>\r
513                                 <p>Reset and init CPU, then erase address range.</p>\r
514                                 <p>The length field is specified in number of bytes.</p>\r
515                                         ]]>\r
516                         </right_column>\r
517                         \r
518                         </pagetext>\r
519                 </page>\r
520 \r
521 \r
522                 <page lang="eng">\r
523                         <outfile>run.tcl</outfile>\r
524                         <menulink>run.tcl</menulink> \r
525                         <pageheading>Run program</pageheading>\r
526                         <level2parent>flashinfo.tcl</level2parent>\r
527                         <pagetext>\r
528                         <markup_code><![CDATA[\r
529 \r
530 \r
531                         \r
532 <tcl>\r
533 \r
534 set form_address [formfetch form_address]\r
535 set form_action [formfetch form_action]\r
536 \r
537 if {[string compare $form_action "Run from address"]==0} {\r
538         append console [encode [capture_catch "halt"]]\r
539         append console [encode [capture_catch "wait_halt"]]\r
540         append console [encode [capture_catch "resume $form_address"]]\r
541 }  \r
542 \r
543 if {[string compare $form_action "Halt"]==0} {\r
544         append console [encode [capture_catch "halt"]]\r
545         append console [encode [capture_catch "wait_halt"]]\r
546 }\r
547   \r
548 if {[string compare $form_action "Reset and run"]==0} {\r
549         append console [encode [capture_catch "reset run"]]\r
550 }\r
551   \r
552 if {[string compare $form_action "Reset and init"]==0} {\r
553         append console [encode [capture_catch "reset init"]]\r
554 }  \r
555 \r
556 append console [encode [capture_catch poll]]\r
557 \r
558 </tcl>\r
559 \r
560 <form action="run.tcl" method="post"> \r
561         <table>\r
562         <tr><td class="formtext" style="padding-right:10px;">Address</td><td><input type="text" name="form_address" value="<tcl>append buffer $form_address</tcl>"></td></tr>\r
563         </td></tr>\r
564         </table>\r
565         <table>\r
566                 <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
567                 <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>\r
568                 <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
569         </table>\r
570         \r
571         <input type="submit" name="form_action" value="Reset and run"> <input type="submit" name="form_action" value="Run from address"> <input type="submit" name="form_action" value="Halt"><input type="submit" name="form_action" value="Reset and init"><br>\r
572 </form>\r
573                         \r
574 \r
575                         \r
576                         ]]></markup_code>\r
577                         <right_column>\r
578                                 <![CDATA[\r
579                                 <p>Reset and run - reset CPU and let it run.</p>\r
580                                 <p>Halt - halt CPU.</p>\r
581                                 <p>Run from address - halt CPU and resume from address. Default is resume from current address.</p>\r
582                                 <p>Reset and init - reset CPU and run init script.</p>\r
583                                 ]]>\r
584                         </right_column>\r
585                         \r
586                         </pagetext>\r
587                 </page>\r
588 \r
589 \r
590                 <page lang="eng">\r
591                         <outfile>browsemem.tcl</outfile>\r
592                         <menutext>Memory</menutext> \r
593                         <menulink>browsemem.tcl</menulink> \r
594                         <pageheading>Browse / Edit Memory</pageheading>\r
595                         <level2parent>browsemem.tcl</level2parent>\r
596                         <level2menu href="browsemem.tcl" title="Browse / Edit" titlestyle="color:#4e6627;">\r
597                         <![CDATA[\r
598                                 Browse and edit memory.\r
599                         ]]>\r
600                         </level2menu>\r
601                         <level2menu href="downloadmem.tcl" title="Download" titlestyle="color:#4e6627;">\r
602                         <![CDATA[\r
603                             Copy memory range to developer machine\r
604                         ]]>\r
605                         </level2menu>\r
606                         \r
607                         <pagetext>\r
608                         <markup_code><![CDATA[\r
609 \r
610 \r
611                         \r
612                         <tcl>\r
613                         \r
614                         set form_address [formfetch form_address]\r
615                         set form_length [formfetch form_length]\r
616                         set form_type [formfetch form_type]\r
617                         set form_action [formfetch form_action]\r
618                         set form_value [formfetch form_value]\r
619                         \r
620                         if {[string compare $form_length ""]==0} {\r
621                                 set form_length 0\r
622                         }  \r
623                         if {$form_length<=0} {\r
624                                 set form_length 0x80\r
625                         } \r
626                         if {$form_length>0x1000} {\r
627                                 set form_length 0x1000\r
628                         } \r
629                         \r
630                         if {[string compare $form_type ""]==0} {\r
631                                 set form_type mdw\r
632                         }\r
633                         \r
634                         if {[string compare $form_type "mdw"]==0} {\r
635                                 set wordsize 4\r
636                                 set modify_cmd mww \r
637                         }\r
638                         if {[string compare $form_type "mdh"]==0} {\r
639                                 set wordsize 2\r
640                                 set modify_cmd mwh \r
641                         }\r
642                         if {[string compare $form_type "mdb"]==0} {\r
643                                 set wordsize 1\r
644                                 set modify_cmd mwb \r
645                         }\r
646                         \r
647                         \r
648                         \r
649                         \r
650                         if {[string compare $form_address ""]!=0} {\r
651                                 if {[string compare $form_action "Previous"]==0} {\r
652                                         # Kludge! Work around problems parsing hex in Jim Tcl expressions\r
653                                         incr form_address ; set form_address [expr $form_address-1]\r
654                                         if {$form_address-$form_length>0} {\r
655                                                 set form_address "0x[tohex [expr $form_address-$form_length]]"\r
656                                         } else {\r
657                                                 set form_address "0x0"\r
658                                         }\r
659                                 }  \r
660                                 if {[string compare $form_action "Next"]==0} {\r
661                                         # Kludge! Work around problems parsing hex in Jim Tcl expressions\r
662                                         incr form_address ; set form_address [expr $form_address-1]\r
663                                         set form_address "0x[tohex [expr $form_address+$form_length]]"\r
664                                 }  \r
665                                 if {[string compare $form_action "Modify"]==0} {\r
666                                         append console [capture_catch "$modify_cmd $form_address $form_value"]\r
667                                 }  \r
668                                 if {[string compare $form_action "Fill"]==0} {\r
669                                         append console [capture_catch "$modify_cmd $form_address $form_value $form_length"]\r
670                                 }  \r
671                         }\r
672                         \r
673                         \r
674                         </tcl>\r
675                         \r
676                         <form action="browsemem.tcl" method="post"> \r
677                                 <table>\r
678                                 <tr><td class="formtext">Address</td><td><input type="text" name="form_address" value="<tcl>append buffer $form_address</tcl>"></td></tr>\r
679                                 <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="<tcl>append buffer "0x[tohex $form_length]"</tcl>"></td></tr>\r
680                                 <tr><td class="formtext">Value</td><td><input type="text" name="form_value" value="<tcl>append buffer $form_value</tcl>"></td>\r
681                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Modify"></td>\r
682                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Fill"></td></tr>\r
683                                 <tr><td class="formtext">Type</td><td style="padding-top:1px;">\r
684                                 <select name="form_type">\r
685                                   <option \r
686                                     <tcl>if {[string compare $form_type "mdb"]==0} { append buffer {selected="selected"} }  </tcl> value ="mdb">8 bit\r
687                                   </option>\r
688                                   <option \r
689                                    <tcl>if {[string compare $form_type "mdh"]==0} { append buffer {selected="selected"} }  </tcl> value ="mdh">16 bit\r
690                                   </option>\r
691                                         <option\r
692                                            <tcl>if {[string compare $form_type "mdw"]==0} { append buffer {selected="selected"} }  </tcl>value ="mdw">32 bit\r
693                                         </option>\r
694                                 </select>\r
695                                 \r
696                                 </td></tr>\r
697                                 </table>\r
698                                 <table>\r
699                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
700                                         <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>\r
701                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
702                                 </table>\r
703                         \r
704                                 <table><tr>\r
705                                         <td><input type="submit" name="form_action" value="Refresh"></td>\r
706                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Previous" ></td>\r
707                                         <td class="buttonspacesmall">&nbsp</td><td><input type="submit" name="form_action" value="Next" ></td>\r
708                                 </tr></table>\r
709                                 <br>\r
710                                 \r
711                         </form>\r
712                         <p>\r
713                         <div class="fontbigger">Memory:</div><p>\r
714                         <code style="white-space: nowrap; font-size:11px;font:courier new;">\r
715                                 <tcl>\r
716                                 if {[string compare $form_address ""]!=0} {\r
717                                         append console [encode [capture_catch halt]]\r
718                                         append buffer [encode [capture_catch "$form_type $form_address [expr $form_length]"]]\r
719                                 } \r
720                                 </tcl>\r
721                         </code>\r
722 \r
723 \r
724                         \r
725 \r
726                         \r
727                         ]]></markup_code>\r
728                         <right_column>\r
729                                 <![CDATA[\r
730                                 <p>Browse and edit target memory.<br>\r
731                                    Length is in bytes, maximum 4096 bytes.</p> \r
732                                 <p>An error message is shown when trying to browse or edit memory which cases a CPU fault.</p>\r
733                                 <p>CPU will be halted if required.</p>\r
734                                 <p><b>Modify</b> - Will modify only one byte, half-word or word starting at Address.</p>\r
735                                 <p><b>Fill</b> - Will fill the specified region with the specified value.</p>\r
736                                 <p><b>Refresh</b> - Display the content of the specified memory area.</p>\r
737                                         ]]>\r
738                         </right_column>\r
739                         \r
740                         </pagetext>\r
741                 </page>\r
742 \r
743                 \r
744 \r
745 \r
746                 <page lang="eng">\r
747                         <outfile>downloadmem.tcl</outfile>\r
748                         <level2parent>browsemem.tcl</level2parent>\r
749                         <pageheading>Download Memory Range</pageheading>\r
750                         <pagetext>\r
751                         <markup_code><![CDATA[\r
752                         <tcl>\r
753                                 set form_address [formfetch form_address]\r
754                                 set form_length [formfetch form_length]\r
755                                 set form_action [formfetch form_action]\r
756                         </tcl>                  \r
757                         <form action="downloadmem.tcl" method="post"> \r
758                                 <table>\r
759                                 <tr><td class="formtext">Address</td><td><input type="text" name="form_address" value="<tcl>append buffer $form_address</tcl>"></td></tr>\r
760                                 <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="<tcl>append buffer $form_length</tcl>"></td></tr>\r
761                                 </td></tr>\r
762                                 </table>\r
763 \r
764                                 <table>\r
765                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
766                                         <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>\r
767                                         <tr><td style="height:15px;width:535px;">&nbsp</td></tr>\r
768                                 </table>\r
769                         \r
770                                 <input type="submit" value="Download" name="form_action">\r
771                                 \r
772                                 \r
773                         </form>\r
774                         <tcl>\r
775                                 if {[string compare $form_action "Download"]==0} {\r
776                                         append console [encode [capture_catch "reset init"]]\r
777                                         append console [encode [capture_catch "dump_image /tmp/dump.bin $form_address $form_length"]]\r
778                                         </tcl>\r
779                                         <form action="../dump.bin" target="_blank"> \r
780                                                 <input type="submit" name="form_action" value="Save downloaded memory">\r
781                                         </form>\r
782                                         <tcl> \r
783                                 }\r
784                                 \r
785                         </tcl>\r
786 \r
787 \r
788                         \r
789                         ]]></markup_code>\r
790                         <right_column>\r
791                                 <![CDATA[       \r
792                                 Download memory to ZY1000 from target. <br>\r
793                                 <b>Note</b> that download memory can take\r
794                                 a long time(potentially minutes for megabytes at low JTAG clk speeds).\r
795                                 <p/>\r
796                                 Once the memory is downloaded a link is available on the page to download\r
797                                 the file from ZY1000 to your PC.\r
798                                 ]]>\r
799                         </right_column>\r
800                         </pagetext>\r
801                         \r
802                 </page>\r
803 \r
804 \r
805 \r
806                 <page lang="eng">\r
807                         <outfile>openocd.tcl</outfile>\r
808                         <menutext>OpenOCD</menutext> \r
809                         <menulink>openocd.tcl</menulink> \r
810                         <pageheading>Run Command</pageheading>\r
811                         <level2parent>openocd.tcl</level2parent>\r
812                         <level2menu href="openocd.tcl" title="Run Command" titlestyle="color:#4e6627;">\r
813                         </level2menu>\r
814                         <level2menu href="guiupload.tcl" title="Upload File to ZY1000" titlestyle="color:#4e6627;">\r
815                         <![CDATA[\r
816                             Upload file to ZY1000\r
817                         ]]>\r
818                         </level2menu>\r
819                         \r
820                         <pagetext>\r
821                         <markup_code><![CDATA[\r
822 \r
823                         <tcl>\r
824                                 set form_command [formfetch form_command]\r
825 \r
826                                 set form_edittext ""\r
827                                 if {[string length $form_command]>0} {                          \r
828                                         catch {capture_catch {eval "$form_command"}} form_edittext\r
829                                 }\r
830                                 \r
831                                 append buffer {<form action="openocd.tcl" method="post">} "\n"\r
832                                 append buffer {Command<br>}\r
833                                 append buffer {<textarea  style="overflow:auto;"  rows="5" cols="65" name="form_command" wrap="off">}\r
834                                 append buffer [to_textarea $form_command]\r
835                                 append buffer {</textarea><br>}\r
836                                 append buffer {<input type="submit" value="Run" name="form_action" ><br>}\r
837                                 append buffer {<textarea  style="overflow:auto;"  rows="21" cols="65" name="form_edittext" readonly=1 wrap="off">}\r
838                                 append buffer [to_textarea $form_edittext]\r
839                                 append buffer {</textarea><br>}\r
840                                 \r
841                                 append buffer {</form>} "\n"\r
842                         \r
843                         </tcl>\r
844 \r
845                         ]]></markup_code>\r
846                         \r
847                         <right_column>\r
848                                 <![CDATA[\r
849                                 <p>Run tcl statement(s). Add "ocd_" prefix to OpenOCD commands otherwise\r
850                                 there will be no output, e.g. "reset init" use "ocd_reset init".\r
851                                 <p/>\r
852                                 <p><a href="/ram/log">Click here to download log</a>.</p>\r
853                                 <p>To download log you can also use commands like "wget http://<tcl>append buffer [ip]</tcl>/ram/log", or\r
854                                 point your web browser to said address.</p>\r
855                                 <p>\r
856                                 You can also execute tcl commands using curl from your developer PC:\r
857                                 </p>\r
858                                 <code>\r
859                                 curl --form form_command=ocd_version <tcl>append buffer [ip]</tcl>runtcl.tcl\r
860                                 </code>\r
861                                 \r
862                                 ]]>\r
863                         </right_column>\r
864                         </pagetext>\r
865                 </page>\r
866 \r
867                 \r
868                 \r
869                 <page lang="eng">\r
870                         <outfile>guiupload.tcl</outfile>\r
871                         <level2parent>openocd.tcl</level2parent>\r
872                         <pageheading>Upload File to ZY1000</pageheading>\r
873                         <pagetext>\r
874                         <markup_code><![CDATA[\r
875                         \r
876                         <tcl>\r
877                                 set form_filename [formfetch form_filename];\r
878                                 set form_action [formfetch form_action];\r
879                                 #set form_filecontent [formfetch form_filecontent];\r
880                                 \r
881                                 append buffer {<form enctype="multipart/form-data" action="guiupload.tcl" method="post">}\r
882                                 append buffer <br> \r
883                                 if {[string compare $form_action "Upload"]==0} {\r
884                                         if {[catch {writeform form_filecontent $form_filename} result]==0} {\r
885                                                 append buffer [encode $result]\r
886                                         } else {\r
887                                                 append buffer Wrote $form_filename\r
888                                         }\r
889                                 }\r
890                                 \r
891                                 append buffer {<table style="padding:0px;border-collapse:collapse;"><tr><td class="formtext">Filename on ZY1000</td><td><input type="text" name="form_filename"></td></tr>}\r
892                                 append buffer {<td class="formtext">File to upload</td><td><input type="file" name="form_filecontent"></td></tr></table>}\r
893                                 append buffer {<table><tr><td style="height:15px;width:535px;">&nbsp</td></tr><tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr><tr><td style="height:15px;width:535px;">&nbsp</td></tr></table>}\r
894                                 append buffer {<input type="submit" name="form_action" value="Upload" ><br> }\r
895                                 append buffer {</form>}\r
896                         \r
897                         </tcl>\r
898                         \r
899                         ]]></markup_code>\r
900                         <right_column>  \r
901                                 <![CDATA[\r
902                                   <p>The ZY1000 has three filing systems "/rom", "/ram" and "/config". "/rom" is a read only filing\r
903                                   embedded into the firmware.</p>\r
904 \r
905                                   <p>Use "/ram" to store temporary files.<p/>\r
906                                   \r
907                                   <p>\r
908                                   You can browse filing systems and download files by pointing your web browser to:\r
909                                   <ul> \r
910                                   <li><a href="/ram" target="_blank">/ram</a>\r
911                                   <li><a href="/rom" target="_blank">/rom</a>\r
912                                   <li><a href="/config" target="_blank">/config</a>\r
913                                   </ul>\r
914                                   </p> \r
915                                   \r
916                                   <p>\r
917                                   You can also upload files using e.g. curl from the command line. Example:\r
918                                   </p>\r
919                                   <code>\r
920                                   curl --form form_filecontent=@/tmp/myfile.elf --form form_filename=/ram/myfile.elf <tcl>append buffer [ip]</tcl>upload.tcl\r
921                                   </code>\r
922                                   <p> \r
923                                   If you have a tftp server installed on your development PC, you can access\r
924                                   files on your developer PC using a /tftp/ip/ prefix to the file to be accessed\r
925                                   on your developer PC. Note that if you do not increase the default packet\r
926                                   size for your tftp server, then the performance will be very poor. Normal\r
927                                   performance is about 500-600kBytes/s.\r
928                                   </p>\r
929                                   <code> \r
930                                   cp /tftp/10.0.0.106/build/src/openocd /ram/test\r
931                                   </code>\r
932                                   \r
933                                   ]]>\r
934                         </right_column>\r
935                         </pagetext>\r
936                         \r
937                 </page>\r
938                 \r
939 \r
940 \r
941                 <page lang="eng">\r
942                         <outfile>targets.tcl</outfile>\r
943                         <level2parent>documentation.tcl</level2parent>\r
944                         <pageheading>Target config quick start guide</pageheading>\r
945                         <pagetext>\r
946                                 <markup_code><![CDATA[\r
947                                 \r
948                                 A target needs an openocd.cfg file. This config file sets up\r
949                                 the CPU, flash and reset init script. Either ZY1000 ships with an\r
950                                 openocd.cfg file for your target or you need to take an existing\r
951                                 config file and modify it for your needs.\r
952                                 <p> \r
953                                 The reset init script is crucial. It will set up e.g. MMU, chip\r
954                                 select registers, etc. after a reset. The init.cfg (reset init script)\r
955                                 is embedded into the openocd.cfg file in the sampls Zylin provides.\r
956                                 <p>\r
957                                 Writing an openocd.cfg from scratch is a non-trivial exercise, but\r
958                                 fortunally it only has to be done once for a target and afterwards it\r
959                                 rarely if ever needs to be changed.\r
960                                 \r
961                                 \r
962                                 ]]></markup_code>\r
963                                 <right_column>\r
964                                         \r
965                                           Quick start guide on how to configure a target.\r
966                                 </right_column>\r
967                         </pagetext>\r
968                         \r
969                         \r
970                 </page>\r
971 \r
972 \r
973                 \r
974 \r
975 \r
976                 <page lang="eng">\r
977                         <menulink>index.tcl</menulink> \r
978                         <level2parent>index.tcl</level2parent>\r
979                         <outfile>terminal.tcl</outfile>\r
980                         <pageheading>UART forwarding</pageheading>\r
981                         <pagetext>\r
982                         <markup_code><![CDATA[\r
983                         <tcl>\r
984                                 set form_baudrate [formfetch form_baudrate]\r
985                                 if {[string length $form_baudrate]==0} {\r
986                                         set form_baudrate [ocd_uart]\r
987                                         set form_baudrate [string range $form_baudrate 0 [expr [string length $form_baudrate]-2]]\r
988                                 }\r
989                                 set form_action [formfetch form_action]\r
990                         </tcl>\r
991                         <form action="terminal.tcl" method="post">\r
992                                 Target baudrate: \r
993                                         <select name="form_baudrate">\r
994                                                 <tcl>\r
995                                                         foreach i {9600 19200 38400 57600 115200} { \r
996                                                         </tcl>\r
997                                                                 <option <tcl>if {[string compare $form_baudrate $i]==0} { append buffer {selected="selected"} }  </tcl>\r
998                                                                 value ="<tcl>append buffer $i</tcl>"><tcl>append buffer $i</tcl></option>\r
999                                                         <tcl>\r
1000                                                         }\r
1001                                                         </tcl>\r
1002                                                 </select>\r
1003 \r
1004                                         <p>     \r
1005                                         <input type="submit" name="form_action" value="Set baudrate" >\r
1006                                 </form>                 \r
1007                         <tcl>\r
1008                                 if {[string compare $form_action "Set baudrate"]==0} {\r
1009                                         append console [encode [ocd_uart $form_baudrate]]\r
1010                                 }\r
1011                         </tcl>\r
1012                         \r
1013                         <h2>Simple UART</h2>\r
1014                         This terminal window is purely for illustrative purposes. Use telnet or a terminal program\r
1015                         to talk to the target over TCP/IP for anything but trivial case of reading/writing a few\r
1016                         lines of texts in simple tests.\r
1017                         <p>\r
1018                         ]]></markup_code>\r
1019                         <right_column>\r
1020                                 <![CDATA[\r
1021                                 Serial port data to target is forwarded(both directions) in the simple terminal window\r
1022                                 to the left. Alternatively you can <b>telnet <tcl>append buffer [ip]</tcl> 5555</b>\r
1023                                 or connect via TCP/IP from e.g. HyperTerminal.\r
1024                                 <p>\r
1025                                 Type "help uart" in telnet for information on how to set uart speed for target. Normally\r
1026                                 the uart speed is set from the target configuration script by adding an "uart N", where\r
1027                                 N is the baudrate.\r
1028                                 ]]>\r
1029                         </right_column>\r
1030                         </pagetext>\r
1031                         \r
1032                 </page>\r
1033 \r
1034 \r
1035                 \r
1036         </language>\r
1037         \r
1038 </website>