1 <?xml version = "1.0" encoding="iso-8859-1" standalone="yes"?>
\r
2 <?xml-stylesheet type="text/xsl" href="plaintext.xsl"?>
\r
5 <language lang="Norsk">
\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
16 <level2menu href="terminal.tcl" title="UART forwarding" titlestyle="color:#4e6627;">
\r
21 <markup_code><![CDATA[
\r
25 <tr><td style="height:10px;width:535px;"> </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;"> </td></tr>
\r
30 <H1>Target Status</H1>
\r
34 <td class="fontbigger">
\r
36 set form_address [formfetch form_address]
\r
37 set form_action [formfetch form_action]
\r
39 if {[string compare $form_action "Halt"]==0} {
\r
40 append console [encode [capture_catch "halt"]]
\r
42 if {[string compare $form_action "Resume"]==0} {
\r
43 append console [encode [capture_catch "resume"]]
\r
46 if {[string compare $form_action "Reset and run"]==0} {
\r
47 append console [encode [capture_catch "reset run"]]
\r
50 if {[string compare $form_action "Power on"]==0} {
\r
51 append console [encode [capture_catch "power on"]]
\r
53 if {[string compare $form_action "Power off"]==0} {
\r
54 append console [encode [capture_catch "power off"]]
\r
58 <tcl>append console [encode [capture_catch poll]]</tcl>
\r
63 <form action="index.tcl" method="post">
\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
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
104 <outfile>targets.tcl</outfile>
\r
105 <level2parent>documentation.tcl</level2parent>
\r
106 <pageheading>Target config quick start guide</pageheading>
\r
108 <markup_code><![CDATA[
\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
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
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
127 Quick start guide on how to configure a target.
\r
137 <outfile>reload.tcl</outfile>
\r
138 <level2parent>index.tcl</level2parent>
\r
139 <pageheading>Reload Config Scripts</pageheading>
\r
141 <markup_code><![CDATA[
\r
144 set form_action [formfetch form_action]
\r
146 if {[string compare $form_action "Reload"]==0} {
\r
147 append buffer "Reloading Config Scripts...<p>"
\r
151 <form enctype="multipart/form-data" action="reload.tcl" method="post">
\r
152 <input type="submit" name="form_action" value="Reload">
\r
157 Restart ZY1000 to reload selected target config script.
\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
172 <level2menu href="erase.tcl" title="Erase" titlestyle="color:#4e6627;">
\r
174 <level2menu href="flash.tcl" title="Program / Verify" titlestyle="color:#4e6627;">
\r
176 <level2menu href="production.tcl" title="Production" titlestyle="color:#4e6627;">
\r
180 <markup_code><![CDATA[
\r
182 <div style="font-size:14px;">Configured flash banks:</div>
\r
184 <code style="white-space: nowrap;">
\r
186 set flash_return [ocd_flash_banks]
\r
187 if {[llength $flash_return]!=0} {
\r
188 append buffer [encode [flash banks]]
\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
197 append buffer "No flash bank configured."
\r
201 <form action="flashinfo.tcl" method="post">
\r
202 <input type="submit" name="form_action" value="Reset CPU and probe flash">
\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
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
212 <input type="submit" value="Download" name="form_action">
\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
236 <outfile>flash.tcl</outfile>
\r
237 <level2parent>flashinfo.tcl</level2parent>
\r
238 <pageheading>Program / Verify Flash</pageheading>
\r
240 <markup_code><![CDATA[
\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
250 catch {set post $post_data} err
\r
252 if {[string compare $form_offset ""]==0} {
\r
255 if {[string compare $form_type ""]==0} {
\r
259 </tcl><code style="white-space: nowrap;"><tcl>
\r
262 append buffer {<form enctype="multipart/form-data" action="flash.tcl" method="post">}
\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
268 if {$action_reset} {
\r
269 append console [encode [capture_catch "reset init"]]
\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
279 <tr><td class="formtext" style="padding-top:1px;">Type</td><td>
\r
280 <select name="form_type">
\r
282 <tcl>if {[string compare $form_type ""]==0} { append buffer {selected="selected"} } </tcl>
\r
283 value ="">auto</option>
\r
285 <tcl>if {[string compare $form_type "elf"]==0} { append buffer {selected="selected"} } </tcl>
\r
286 value ="elf">elf</option>
\r
288 <tcl>if {[string compare $form_type "bin"]==0} { append buffer {selected="selected"} } </tcl>
\r
289 value ="bin">binary</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
303 <tr><td style="height:15px;width:535px;"> </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;"> </td></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
317 if {$action_flash||$action_verify} {
\r
318 catch {writeform form_filecontent $upload_filename} result
\r
319 append console [encode $result]
\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
329 append buffer [encode $result]
\r
330 append buffer "Flash write succeed<br>"
\r
332 append buffer "</b>"
\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
341 append buffer [encode $result]
\r
342 append buffer "Verify succeed<br>"
\r
344 append buffer "</b>"
\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
373 <outfile>production.tcl</outfile>
\r
374 <level2parent>flashinfo.tcl</level2parent>
\r
375 <pageheading>Production</pageheading>
\r
377 <markup_code><![CDATA[
\r
379 set form_action [formfetch form_action]
\r
380 set form_serialnumber [formfetch form_serialnumber]
\r
381 append buffer [production_info]
\r
384 <form enctype="multipart/form-data" action="production.tcl" method="post">
\r
385 <code style="white-space: nowrap;">
\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
394 append console [encode [capture_catch {catch "production $upload_filename $form_serialnumber"}]]
\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
400 append console [encode [capture_catch {catch production_test}]]
\r
402 if {[string compare $form_action "Power on"]==0} {
\r
403 append console [encode [capture_catch "power on"]]
\r
405 if {[string compare $form_action "Power off"]==0} {
\r
406 append console [encode [capture_catch "power off"]]
\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
416 <tr><td style="height:15px;width:535px;"> </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;"> </td></tr>
\r
422 <td><input type="submit" name="form_action" value="Upload firmware" ></td>
\r
423 <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Test"></td>
\r
424 <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Power on"></td>
\r
425 <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Power off">
\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
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
452 <outfile>erase.tcl</outfile>
\r
453 <menulink>erase.tcl</menulink>
\r
454 <pageheading>Erase Flash</pageheading>
\r
455 <level2parent>flashinfo.tcl</level2parent>
\r
457 <markup_code><![CDATA[
\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
467 if {[string compare $form_length ""]==0} {
\r
468 set form_length 0x10000
\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
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
482 flash erase_address $form_address $form_length}]]
\r
483 append buffer </code>
\r
490 <form action="erase.tcl" method="post">
\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
497 <tr><td style="height:15px;width:535px;"> </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;"> </td></tr>
\r
502 <input type="submit" name="form_action" value="Erase"><br>
\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
523 <outfile>run.tcl</outfile>
\r
524 <menulink>run.tcl</menulink>
\r
525 <pageheading>Run program</pageheading>
\r
526 <level2parent>flashinfo.tcl</level2parent>
\r
528 <markup_code><![CDATA[
\r
534 set form_address [formfetch form_address]
\r
535 set form_action [formfetch form_action]
\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
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
548 if {[string compare $form_action "Reset and run"]==0} {
\r
549 append console [encode [capture_catch "reset run"]]
\r
552 if {[string compare $form_action "Reset and init"]==0} {
\r
553 append console [encode [capture_catch "reset init"]]
\r
556 append console [encode [capture_catch poll]]
\r
560 <form action="run.tcl" method="post">
\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
566 <tr><td style="height:15px;width:535px;"> </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;"> </td></tr>
\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
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
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
598 Browse and edit memory.
\r
601 <level2menu href="downloadmem.tcl" title="Download" titlestyle="color:#4e6627;">
\r
603 Copy memory range to developer machine
\r
608 <markup_code><![CDATA[
\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
620 if {[string compare $form_length ""]==0} {
\r
623 if {$form_length<=0} {
\r
624 set form_length 0x80
\r
626 if {$form_length>0x1000} {
\r
627 set form_length 0x1000
\r
630 if {[string compare $form_type ""]==0} {
\r
634 if {[string compare $form_type "mdw"]==0} {
\r
636 set modify_cmd mww
\r
638 if {[string compare $form_type "mdh"]==0} {
\r
640 set modify_cmd mwh
\r
642 if {[string compare $form_type "mdb"]==0} {
\r
644 set modify_cmd mwb
\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
657 set form_address "0x0"
\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
665 if {[string compare $form_action "Modify"]==0} {
\r
666 append console [capture_catch "$modify_cmd $form_address $form_value"]
\r
668 if {[string compare $form_action "Fill"]==0} {
\r
669 append console [capture_catch "$modify_cmd $form_address $form_value $form_length"]
\r
676 <form action="browsemem.tcl" method="post">
\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"> </td><td><input type="submit" name="form_action" value="Modify"></td>
\r
682 <td class="buttonspacesmall"> </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
686 <tcl>if {[string compare $form_type "mdb"]==0} { append buffer {selected="selected"} } </tcl> value ="mdb">8 bit
\r
689 <tcl>if {[string compare $form_type "mdh"]==0} { append buffer {selected="selected"} } </tcl> value ="mdh">16 bit
\r
692 <tcl>if {[string compare $form_type "mdw"]==0} { append buffer {selected="selected"} } </tcl>value ="mdw">32 bit
\r
699 <tr><td style="height:15px;width:535px;"> </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;"> </td></tr>
\r
705 <td><input type="submit" name="form_action" value="Refresh"></td>
\r
706 <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Previous" ></td>
\r
707 <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Next" ></td>
\r
713 <div class="fontbigger">Memory:</div><p>
\r
714 <code style="white-space: nowrap; font-size:11px;font:courier new;">
\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
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
747 <outfile>downloadmem.tcl</outfile>
\r
748 <level2parent>browsemem.tcl</level2parent>
\r
749 <pageheading>Download Memory Range</pageheading>
\r
751 <markup_code><![CDATA[
\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
757 <form action="downloadmem.tcl" method="post">
\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
765 <tr><td style="height:15px;width:535px;"> </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;"> </td></tr>
\r
770 <input type="submit" value="Download" name="form_action">
\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
779 <form action="../dump.bin" target="_blank">
\r
780 <input type="submit" name="form_action" value="Save downloaded memory">
\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
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
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
814 <level2menu href="guiupload.tcl" title="Upload File to ZY1000" titlestyle="color:#4e6627;">
\r
816 Upload file to ZY1000
\r
821 <markup_code><![CDATA[
\r
824 set form_command [formfetch form_command]
\r
826 set form_edittext ""
\r
827 if {[string length $form_command]>0} {
\r
828 catch {capture_catch {eval "$form_command"}} form_edittext
\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
841 append buffer {</form>} "\n"
\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
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
856 You can also execute tcl commands using curl from your developer PC:
\r
859 curl --form form_command=ocd_version <tcl>append buffer [ip]</tcl>runtcl.tcl
\r
870 <outfile>guiupload.tcl</outfile>
\r
871 <level2parent>openocd.tcl</level2parent>
\r
872 <pageheading>Upload File to ZY1000</pageheading>
\r
874 <markup_code><![CDATA[
\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
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
887 append buffer Wrote $form_filename
\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;"> </td></tr><tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr><tr><td style="height:15px;width:535px;"> </td></tr></table>}
\r
894 append buffer {<input type="submit" name="form_action" value="Upload" ><br> }
\r
895 append buffer {</form>}
\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
905 <p>Use "/ram" to store temporary files.<p/>
\r
908 You can browse filing systems and download files by pointing your web browser to:
\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
917 You can also upload files using e.g. curl from the command line. Example:
\r
920 curl --form form_filecontent=@/tmp/myfile.elf --form form_filename=/ram/myfile.elf <tcl>append buffer [ip]</tcl>upload.tcl
\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
930 cp /tftp/10.0.0.106/build/src/openocd /ram/test
\r
942 <outfile>targets.tcl</outfile>
\r
943 <level2parent>documentation.tcl</level2parent>
\r
944 <pageheading>Target config quick start guide</pageheading>
\r
946 <markup_code><![CDATA[
\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
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
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
965 Quick start guide on how to configure a target.
\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
982 <markup_code><![CDATA[
\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
989 set form_action [formfetch form_action]
\r
991 <form action="terminal.tcl" method="post">
\r
993 <select name="form_baudrate">
\r
995 foreach i {9600 19200 38400 57600 115200} {
\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
1005 <input type="submit" name="form_action" value="Set baudrate" >
\r
1008 if {[string compare $form_action "Set baudrate"]==0} {
\r
1009 append console [encode [ocd_uart $form_baudrate]]
\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
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
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