1 <?xml version =
"1.0" encoding=
"iso-8859-1" standalone=
"yes"?>
2 <?xml-stylesheet type=
"text/xsl" href=
"plaintext.xsl"?>
5 <language lang=
"Norsk">
8 <outfile>index.tcl
</outfile>
9 <menutext>Config Target
</menutext>
10 <menulink>index.tcl
</menulink>
11 <pageheading>OpenOCD debugger
</pageheading>
12 <level2parent>index.tcl
</level2parent>
13 <level2menu href=
"index.tcl" title=
"Target Status" titlestyle=
"color:#4e6627;">
16 <level2menu href="terminal.tcl" title="UART forwarding" titlestyle="color:#4e6627;">
21 <markup_code><![CDATA[
25 <tr><td style=
"height:10px;width:535px;"> 
</td></tr>
26 <tr><td style=
"height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
27 <tr><td style=
"height:5px;width:535px;"> 
</td></tr>
30 <H1>Target Status
</H1>
34 <td class=
"fontbigger">
36 set form_address [formfetch form_address]
37 set form_action [formfetch form_action]
39 if {[string compare $form_action
"Halt"]==
0} {
40 append console [encode [capture_catch
"halt"]]
42 if {[string compare $form_action
"Resume"]==
0} {
43 append console [encode [capture_catch
"resume"]]
46 if {[string compare $form_action
"Reset and run"]==
0} {
47 append console [encode [capture_catch
"reset run"]]
50 if {[string compare $form_action
"Power on"]==
0} {
51 append console [encode [capture_catch
"power on"]]
53 if {[string compare $form_action
"Power off"]==
0} {
54 append console [encode [capture_catch
"power off"]]
58 <tcl>append console [encode [capture_catch poll]]
</tcl>
63 <form action=
"index.tcl" method=
"post">
65 <td><input type=
"submit" name=
"form_action" value=
"Reset and run"></td>
66 <td class=
"buttonspacesmall"></td><td><input type=
"submit" name=
"form_action" value=
"Halt"></td>
67 <td class=
"buttonspacesmall"></td><td><input type=
"submit" name=
"form_action" value=
"Resume"></td>
68 <td style=
"width:50px;"></td><td><input type=
"submit" name=
"form_action" value=
"Power on"></td>
69 <td class=
"buttonspacesmall"></td><td><input type=
"submit" name=
"form_action" value=
"Power off"></td>
79 <markup_code><![CDATA[
80 <p>Target status shows that status of the connected target.
</p>
81 <p><b>Current target
</b> - selected target configuration.
<br>
82 <p><b>Startup
</b> - whether or not the target script ran to completion. Note
83 that even if the target is disconnected, powered down or unresponsive, the
84 startup script will still run to completion. Startup - OK does not mean
85 that the target is fully operational, simply that the configuration script
86 did not contain syntax errors for instance.
87 See log for details.
<br>
88 <p><b>Target power
</b> - Detects power on target.
<br>
89 If the JTAG cable is not connected, or the target has no power, then no target power will be detected.
</p>
90 <p><b>Power on
</b> - Turn on ZY1000 target power relay.
</p>
91 <p><b>Power off
</b> - Turn off ZY1000 target power relay.
</p>
92 <p>Type
"help power" in telnet for command to control power relay.
</p>
93 <p><b>Reboot ZY1000
</b> - Reboots ZY1000 unit. Type
"help reboot" in telnet.
</p>
104 <outfile>targets.tcl
</outfile>
105 <level2parent>documentation.tcl
</level2parent>
106 <pageheading>Target config quick start guide
</pageheading>
108 <markup_code><![CDATA[
110 A target needs an openocd.cfg file. This config file sets up
111 the CPU, flash and reset init script. Either ZY1000 ships with an
112 openocd.cfg file for your target or you need to take an existing
113 config file and modify it for your needs.
115 The reset init script is crucial. It will set up e.g. MMU, chip
116 select registers, etc. after a reset. The init.cfg (reset init script)
117 is embedded into the openocd.cfg file in the sampls Zylin provides.
119 Writing an openocd.cfg from scratch is a non-trivial exercise, but
120 fortunally it only has to be done once for a target and afterwards it
121 rarely if ever needs to be changed.
127 Quick start guide on how to configure a target.
137 <outfile>reload.tcl
</outfile>
138 <level2parent>index.tcl
</level2parent>
139 <pageheading>Reload Config Scripts
</pageheading>
141 <markup_code><![CDATA[
144 set form_action [formfetch form_action]
146 if {[string compare $form_action
"Reload"]==
0} {
147 append buffer
"Reloading Config Scripts...<p>"
151 <form enctype=
"multipart/form-data" action=
"reload.tcl" method=
"post">
152 <input type=
"submit" name=
"form_action" value=
"Reload">
157 Restart ZY1000 to reload selected target config script.
165 <outfile>flashinfo.tcl
</outfile>
166 <menutext>Flash
</menutext>
167 <menulink>flashinfo.tcl
</menulink>
168 <pageheading>Flash Information
</pageheading>
169 <level2parent>flashinfo.tcl
</level2parent>
170 <level2menu href=
"flashinfo.tcl" title=
"Info" titlestyle=
"color:#4e6627;">
172 <level2menu href=
"erase.tcl" title=
"Erase" titlestyle=
"color:#4e6627;">
174 <level2menu href=
"flash.tcl" title=
"Program / Verify" titlestyle=
"color:#4e6627;">
176 <level2menu href=
"production.tcl" title=
"Production" titlestyle=
"color:#4e6627;">
180 <markup_code><![CDATA[
182 <div style=
"font-size:14px;">Configured flash banks:
</div>
184 <code style=
"white-space: nowrap;">
186 set flash_return [ocd_flash_banks]
187 if {[llength $flash_return]!=
0} {
188 append buffer [encode [flash banks]]
190 set form_action [formfetch form_action]
191 if {[string compare $form_action
"Reset CPU and probe flash"]==
0} {
192 append console [encode [capture_catch
"reset init"]]
193 append buffer [encode [capture_catch
"flash probe 0"]]
194 append buffer [encode [capture_catch
"flash info 0"]]
197 append buffer
"No flash bank configured."
201 <form action=
"flashinfo.tcl" method=
"post">
202 <input type=
"submit" name=
"form_action" value=
"Reset CPU and probe flash">
205 foreach a [ocd_flash_banks] {
206 append buffer
"Flash bank at [format "0x%
08x size
0x%
08x
" $a(base) $a(size)]: "
208 <form action=
"downloadmem.tcl" method=
"post">
209 <input type=
"hidden" name=
"form_address" value=
"<tcl>append buffer [format "0x%
08x
" $a(base)]</tcl>">
210 <input type=
"hidden" name=
"form_length" value=
"<tcl>append buffer [format "0x%
08x
" $a(size)]</tcl>">
212 <input type=
"submit" value=
"Download" name=
"form_action">
224 <p>Here you will find information about the flash chips that you have
225 in your configuration.
<p/>
226 <p><b>Reset CPU and probe flash
</b> - This will reset the CPU and show
227 you more detailed information about your flash. This includes information about
228 the different sectors in the flash, and the flash driver used.
</p>
236 <outfile>flash.tcl
</outfile>
237 <level2parent>flashinfo.tcl
</level2parent>
238 <pageheading>Program / Verify Flash
</pageheading>
240 <markup_code><![CDATA[
244 set form_offset [formfetch form_offset]
245 set form_action [formfetch form_action]
246 set form_type [formfetch form_type]
250 catch {set post $post_data} err
252 if {[string compare $form_offset
""]==
0} {
255 if {[string compare $form_type
""]==
0} {
259 </tcl><code style=
"white-space: nowrap;"><tcl>
262 append buffer {
<form enctype=
"multipart/form-data" action=
"flash.tcl" method=
"post">}
264 set action_reset [expr {[string length $form_action]!=
0}]
265 set action_flash [expr {[string compare $form_action
"Flash"]==
0 || [string compare $form_action
"Flash and verify"]==
0}]
266 set action_verify [expr {[string compare $form_action
"Verify"]==
0 || [string compare $form_action
"Flash and verify"]==
0}]
269 append console [encode [capture_catch
"reset init"]]
274 append buffer {
<table>}
275 append buffer {
<tr><td class=
"formtext">File
</td><td><input type=
"file" name=
"form_filecontent"></td></tr>}
276 append buffer
"<tr><td class=\"formtext\
" >Offset</td><td><input type=\"text\
" name=\"form_offset\
" value=\"$form_offset\
"></td></tr>"
279 <tr><td class=
"formtext" style=
"padding-top:1px;">Type
</td><td>
280 <select name=
"form_type">
282 <tcl>if {[string compare $form_type
""]==
0} { append buffer {
selected=
"selected"} }
</tcl>
283 value =
"">auto
</option>
285 <tcl>if {[string compare $form_type
"elf"]==
0} { append buffer {
selected=
"selected"} }
</tcl>
286 value =
"elf">elf
</option>
288 <tcl>if {[string compare $form_type
"bin"]==
0} { append buffer {
selected=
"selected"} }
</tcl>
289 value =
"bin">binary
</option>
291 <tcl>if {[string compare $form_type
"ihex"]==
0} { append buffer {
selected=
"selected"} }
</tcl>
292 value =
"ihex">ihex
</option>
293 <!-- broken <option value ="s19">s19</option> -->
303 <tr><td style=
"height:15px;width:535px;"> 
</td></tr>
304 <tr><td style=
"height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
305 <tr><td style=
"height:15px;width:535px;"> 
</td></tr>
309 <td><input type=
"submit" name=
"form_action" value=
"Flash" ></td>
310 <td class=
"buttonspacesmall"></td><td><input type=
"submit" name=
"form_action" value=
"Flash and verify" ></td>
311 <td class=
"buttonspacesmall"></td><td><input type=
"submit" name=
"form_action" value=
"Verify" ></td>
317 if {$action_flash||$action_verify} {
318 catch {writeform form_filecontent $upload_filename} result
319 append console [encode $result]
323 append console [encode [capture_catch
"halt"]]
325 if {[catch {capture_catch {eval
"flash write_image erase $upload_filename $form_offset $form_type"}} result]} {
326 append buffer
"Flash write failed<br>"
327 append console [encode $result]
329 append buffer [encode $result]
330 append buffer
"Flash write succeed<br>"
334 if {$action_verify} {
335 append console [encode [capture_catch
"halt"]]
337 if {[catch {capture_catch {eval
"verify_image $upload_filename $form_offset $form_type"}} result]} {
338 append buffer
"Verify failed<br>"
339 append console [encode $result]
341 append buffer [encode $result]
342 append buffer
"Verify succeed<br>"
354 <p>Program and/or verify the flash on your target.
</p>
355 <p><b>Flash
</b> - Halt CPU, automatically erase flash if required and program flash with image.
</p>
356 <p><b>Flash and verify
</b> - Programs the flash and verifies the programmed flash content is correct.
</p>
357 <p><b>Verify
</b> - Halt CPU and verify image in flash or RAM.
</p>
358 <p><b>Offset
</b> - This value is added to the address of the image.
<br>
359 Binary images start at address
0 by default, whereas elf and ihex have addresses encoded into the image.
<br>
360 Typically
0 for elf/ihex and the address to write the image to for binary files.
</p>
373 <outfile>production.tcl
</outfile>
374 <level2parent>flashinfo.tcl
</level2parent>
375 <pageheading>Production
</pageheading>
377 <markup_code><![CDATA[
379 set form_action [formfetch form_action]
380 set form_serialnumber [formfetch form_serialnumber]
381 append buffer [production_info]
384 <form enctype=
"multipart/form-data" action=
"production.tcl" method=
"post">
385 <code style=
"white-space: nowrap;">
387 if {[string compare $form_action
"Upload firmware"]==
0} {
388 set wrotedata [catch {writeform form_filecontent $upload_filename} result]
389 append buffer [encode $result]
391 append buffer
"<br>Running production procedure<p>"
392 append buffer
"<br>Reset and init: <br>"
394 append console [encode [capture_catch {catch
"production $upload_filename $form_serialnumber"}]]
397 if {[string compare $form_action
"Test"]==
0} {
398 append buffer
"<br>Running production test. Output from first 10 seconds printed below. <p>"
400 append console [encode [capture_catch {catch production_test}]]
402 if {[string compare $form_action
"Power on"]==
0} {
403 append console [encode [capture_catch
"power on"]]
405 if {[string compare $form_action
"Power off"]==
0} {
406 append console [encode [capture_catch
"power off"]]
411 append buffer {
<p class=
"formtext">Firmware file(raw binary)
<input type=
"file" name=
"form_filecontent"><p>}
412 append buffer {
<p class=
"formtext">Serial number
<input type=
"text" name=
"form_serialnumber"><p>}
416 <tr><td style=
"height:15px;width:535px;"> 
</td></tr>
417 <tr><td style=
"height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
418 <tr><td style=
"height:15px;width:535px;"> 
</td></tr>
422 <td><input type=
"submit" name=
"form_action" value=
"Upload firmware" ></td>
423 <td class=
"buttonspacesmall"> 
</td><td><input type=
"submit" name=
"form_action" value=
"Test"></td>
424 <td class=
"buttonspacesmall"> 
</td><td><input type=
"submit" name=
"form_action" value=
"Power on"></td>
425 <td class=
"buttonspacesmall"> 
</td><td><input type=
"submit" name=
"form_action" value=
"Power off">
433 The target script can implement the
"production",
"production_info" and
"production_test" tcl proc's. These procedures
434 are used on this page. There are default implementations that do nothing.
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>
437 <p><b>Test
</b> - Power up target, run
10 second target test. Output is provided via the DCC output channel.
</p>
438 <p><b>Power on
</b> - Power on target.
</p>
439 <p><b>Power off
</b> - Power off target.
</p>
440 <p><b>Serial number
</b> - A target script can use this string in the production procedure. Type
"help production" for more info.
</p>
452 <outfile>erase.tcl
</outfile>
453 <menulink>erase.tcl
</menulink>
454 <pageheading>Erase Flash
</pageheading>
455 <level2parent>flashinfo.tcl
</level2parent>
457 <markup_code><![CDATA[
463 set form_address [formfetch form_address]
464 set form_length [formfetch form_length]
465 set form_action [formfetch form_action]
467 if {[string compare $form_length
""]==
0} {
468 set form_length
0x10000
470 if {[string compare $form_address
""]==
0} {
471 if {[catch {[zy1000_flash]} result]==
0} {
472 set form_address
"0x[tohex $result]"
477 if {[string compare $form_address
""]!=
0} {
478 if {[string compare $form_action
"Erase"]==
0} {
479 append buffer
"<code style=\"white-space: nowrap;\
">"
480 append console [encode [capture_catch {
482 flash erase_address $form_address $form_length}]]
483 append buffer
</code>
490 <form action=
"erase.tcl" method=
"post">
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>
493 <tr><td class=
"formtext">Length
</td><td><input type=
"text" name=
"form_length" value=
"<tcl>append buffer $form_length</tcl>"></td></tr>
497 <tr><td style=
"height:15px;width:535px;"> 
</td></tr>
498 <tr><td style=
"height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
499 <tr><td style=
"height:15px;width:535px;"> 
</td></tr>
502 <input type=
"submit" name=
"form_action" value=
"Erase"><br>
512 <p>Note that flash programming will erase flash if required.
<p/>
513 <p>Reset and init CPU, then erase address range.
</p>
514 <p>The length field is specified in number of bytes.
</p>
523 <outfile>run.tcl
</outfile>
524 <menulink>run.tcl
</menulink>
525 <pageheading>Run program
</pageheading>
526 <level2parent>flashinfo.tcl
</level2parent>
528 <markup_code><![CDATA[
534 set form_address [formfetch form_address]
535 set form_action [formfetch form_action]
537 if {[string compare $form_action
"Run from address"]==
0} {
538 append console [encode [capture_catch
"halt"]]
539 append console [encode [capture_catch
"wait_halt"]]
540 append console [encode [capture_catch
"resume $form_address"]]
543 if {[string compare $form_action
"Halt"]==
0} {
544 append console [encode [capture_catch
"halt"]]
545 append console [encode [capture_catch
"wait_halt"]]
548 if {[string compare $form_action
"Reset and run"]==
0} {
549 append console [encode [capture_catch
"reset run"]]
552 if {[string compare $form_action
"Reset and init"]==
0} {
553 append console [encode [capture_catch
"reset init"]]
556 append console [encode [capture_catch poll]]
560 <form action=
"run.tcl" method=
"post">
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>
566 <tr><td style=
"height:15px;width:535px;"> 
</td></tr>
567 <tr><td style=
"height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
568 <tr><td style=
"height:15px;width:535px;"> 
</td></tr>
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>
579 <p>Reset and run - reset CPU and let it run.
</p>
580 <p>Halt - halt CPU.
</p>
581 <p>Run from address - halt CPU and resume from address. Default is resume from current address.
</p>
582 <p>Reset and init - reset CPU and run init script.
</p>
591 <outfile>browsemem.tcl
</outfile>
592 <menutext>Memory
</menutext>
593 <menulink>browsemem.tcl
</menulink>
594 <pageheading>Browse / Edit Memory
</pageheading>
595 <level2parent>browsemem.tcl
</level2parent>
596 <level2menu href=
"browsemem.tcl" title=
"Browse / Edit" titlestyle=
"color:#4e6627;">
598 Browse and edit memory.
601 <level2menu href=
"downloadmem.tcl" title=
"Download" titlestyle=
"color:#4e6627;">
603 Copy memory range to developer machine
608 <markup_code><![CDATA[
614 set form_address [formfetch form_address]
615 set form_length [formfetch form_length]
616 set form_type [formfetch form_type]
617 set form_action [formfetch form_action]
618 set form_value [formfetch form_value]
620 if {[string compare $form_length
""]==
0} {
623 if {$form_length<=
0} {
626 if {$form_length
>0x1000} {
627 set form_length
0x1000
630 if {[string compare $form_type
""]==
0} {
634 if {[string compare $form_type
"mdw"]==
0} {
638 if {[string compare $form_type
"mdh"]==
0} {
642 if {[string compare $form_type
"mdb"]==
0} {
650 if {[string compare $form_address
""]!=
0} {
651 if {[string compare $form_action
"Previous"]==
0} {
652 # Kludge! Work around problems parsing hex in Jim Tcl expressions
653 incr form_address ; set form_address [expr $form_address-
1]
654 if {$form_address-$form_length
>0} {
655 set form_address
"0x[tohex [expr $form_address-$form_length]]"
657 set form_address
"0x0"
660 if {[string compare $form_action
"Next"]==
0} {
661 # Kludge! Work around problems parsing hex in Jim Tcl expressions
662 incr form_address ; set form_address [expr $form_address-
1]
663 set form_address
"0x[tohex [expr $form_address+$form_length]]"
665 if {[string compare $form_action
"Modify"]==
0} {
666 append console [capture_catch
"$modify_cmd $form_address $form_value"]
668 if {[string compare $form_action
"Fill"]==
0} {
669 append console [capture_catch
"$modify_cmd $form_address $form_value $form_length"]
676 <form action=
"browsemem.tcl" method=
"post">
678 <tr><td class=
"formtext">Address
</td><td><input type=
"text" name=
"form_address" value=
"<tcl>append buffer $form_address</tcl>"></td></tr>
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>
680 <tr><td class=
"formtext">Value
</td><td><input type=
"text" name=
"form_value" value=
"<tcl>append buffer $form_value</tcl>"></td>
681 <td class=
"buttonspacesmall"> 
</td><td><input type=
"submit" name=
"form_action" value=
"Modify"></td>
682 <td class=
"buttonspacesmall"> 
</td><td><input type=
"submit" name=
"form_action" value=
"Fill"></td></tr>
683 <tr><td class=
"formtext">Type
</td><td style=
"padding-top:1px;">
684 <select name=
"form_type">
686 <tcl>if {[string compare $form_type
"mdb"]==
0} { append buffer {
selected=
"selected"} }
</tcl> value =
"mdb">8 bit
689 <tcl>if {[string compare $form_type
"mdh"]==
0} { append buffer {
selected=
"selected"} }
</tcl> value =
"mdh">16 bit
692 <tcl>if {[string compare $form_type
"mdw"]==
0} { append buffer {
selected=
"selected"} }
</tcl>value =
"mdw">32 bit
699 <tr><td style=
"height:15px;width:535px;"> 
</td></tr>
700 <tr><td style=
"height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
701 <tr><td style=
"height:15px;width:535px;"> 
</td></tr>
705 <td><input type=
"submit" name=
"form_action" value=
"Refresh"></td>
706 <td class=
"buttonspacesmall"> 
</td><td><input type=
"submit" name=
"form_action" value=
"Previous" ></td>
707 <td class=
"buttonspacesmall"> 
</td><td><input type=
"submit" name=
"form_action" value=
"Next" ></td>
713 <div class=
"fontbigger">Memory:
</div><p>
714 <code style=
"white-space: nowrap; font-size:11px;font:courier new;">
716 if {[string compare $form_address
""]!=
0} {
717 append console [encode [capture_catch halt]]
718 append buffer [encode [capture_catch
"$form_type $form_address [expr $form_length]"]]
730 <p>Browse and edit target memory.
<br>
731 Length is in bytes, maximum
4096 bytes.
</p>
732 <p>An error message is shown when trying to browse or edit memory which cases a CPU fault.
</p>
733 <p>CPU will be halted if required.
</p>
734 <p><b>Modify
</b> - Will modify only one byte, half-word or word starting at Address.
</p>
735 <p><b>Fill
</b> - Will fill the specified region with the specified value.
</p>
736 <p><b>Refresh
</b> - Display the content of the specified memory area.
</p>
747 <outfile>downloadmem.tcl
</outfile>
748 <level2parent>browsemem.tcl
</level2parent>
749 <pageheading>Download Memory Range
</pageheading>
751 <markup_code><![CDATA[
753 set form_address [formfetch form_address]
754 set form_length [formfetch form_length]
755 set form_action [formfetch form_action]
757 <form action=
"downloadmem.tcl" method=
"post">
759 <tr><td class=
"formtext">Address
</td><td><input type=
"text" name=
"form_address" value=
"<tcl>append buffer $form_address</tcl>"></td></tr>
760 <tr><td class=
"formtext">Length
</td><td><input type=
"text" name=
"form_length" value=
"<tcl>append buffer $form_length</tcl>"></td></tr>
765 <tr><td style=
"height:15px;width:535px;"> 
</td></tr>
766 <tr><td style=
"height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
767 <tr><td style=
"height:15px;width:535px;"> 
</td></tr>
770 <input type=
"submit" value=
"Download" name=
"form_action">
775 if {[string compare $form_action
"Download"]==
0} {
776 append console [encode [capture_catch
"reset init"]]
777 append console [encode [capture_catch
"dump_image /tmp/dump.bin $form_address $form_length"]]
779 <form action=
"../dump.bin" target=
"_blank">
780 <input type=
"submit" name=
"form_action" value=
"Save downloaded memory">
792 Download memory to ZY1000 from target.
<br>
793 <b>Note
</b> that download memory can take
794 a long time(potentially minutes for megabytes at low JTAG clk speeds).
796 Once the memory is downloaded a link is available on the page to download
797 the file from ZY1000 to your PC.
807 <outfile>openocd.tcl
</outfile>
808 <menutext>OpenOCD
</menutext>
809 <menulink>openocd.tcl
</menulink>
810 <pageheading>Run Command
</pageheading>
811 <level2parent>openocd.tcl
</level2parent>
812 <level2menu href=
"openocd.tcl" title=
"Run Command" titlestyle=
"color:#4e6627;">
814 <level2menu href=
"guiupload.tcl" title=
"Upload File to ZY1000" titlestyle=
"color:#4e6627;">
816 Upload file to ZY1000
821 <markup_code><![CDATA[
824 set form_command [formfetch form_command]
827 if {[string length $form_command]
>0} {
828 catch {capture_catch {eval
"$form_command"}} form_edittext
831 append buffer {
<form action=
"openocd.tcl" method=
"post">}
"\n"
832 append buffer {Command
<br>}
833 append buffer {
<textarea style=
"overflow:auto;" rows=
"5" cols=
"65" name=
"form_command" wrap=
"off">}
834 append buffer [to_textarea $form_command]
835 append buffer {
</textarea><br>}
836 append buffer {
<input type=
"submit" value=
"Run" name=
"form_action" ><br>}
837 append buffer {
<textarea style=
"overflow:auto;" rows=
"21" cols=
"65" name=
"form_edittext" readonly=
1 wrap=
"off">}
838 append buffer [to_textarea $form_edittext]
839 append buffer {
</textarea><br>}
841 append buffer {
</form>}
"\n"
849 <p>Run tcl statement(s). Add
"ocd_" prefix to OpenOCD commands otherwise
850 there will be no output, e.g.
"reset init" use
"ocd_reset init".
852 <p><a href=
"/ram/log">Click here to download log
</a>.
</p>
853 <p>To download log you can also use commands like
"wget http://<tcl>append buffer [ip]</tcl>/ram/log", or
854 point your web browser to said address.
</p>
856 You can also execute tcl commands using curl from your developer PC:
859 curl --form form_command=ocd_version
<tcl>append buffer [ip]
</tcl>runtcl.tcl
870 <outfile>guiupload.tcl
</outfile>
871 <level2parent>openocd.tcl
</level2parent>
872 <pageheading>Upload File to ZY1000
</pageheading>
874 <markup_code><![CDATA[
877 set form_filename [formfetch form_filename];
878 set form_action [formfetch form_action];
879 #set form_filecontent [formfetch form_filecontent];
881 append buffer {
<form enctype=
"multipart/form-data" action=
"guiupload.tcl" method=
"post">}
883 if {[string compare $form_action
"Upload"]==
0} {
884 if {[catch {writeform form_filecontent $form_filename} result]==
0} {
885 append buffer [encode $result]
887 append buffer Wrote $form_filename
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>}
892 append buffer {
<td class=
"formtext">File to upload
</td><td><input type=
"file" name=
"form_filecontent"></td></tr></table>}
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>}
894 append buffer {
<input type=
"submit" name=
"form_action" value=
"Upload" ><br> }
895 append buffer {
</form>}
902 <p>The ZY1000 has three filing systems
"/rom",
"/ram" and
"/config".
"/rom" is a read only filing
903 embedded into the firmware.
</p>
905 <p>Use
"/ram" to store temporary files.
<p/>
908 You can browse filing systems and download files by pointing your web browser to:
910 <li><a href=
"/ram" target=
"_blank">/ram
</a>
911 <li><a href=
"/rom" target=
"_blank">/rom
</a>
912 <li><a href=
"/config" target=
"_blank">/config
</a>
917 You can also upload files using e.g. curl from the command line. Example:
920 curl --form form_filecontent=@/tmp/myfile.elf --form form_filename=/ram/myfile.elf
<tcl>append buffer [ip]
</tcl>upload.tcl
923 If you have a tftp server installed on your development PC, you can access
924 files on your developer PC using a /tftp/ip/ prefix to the file to be accessed
925 on your developer PC. Note that if you do not increase the default packet
926 size for your tftp server, then the performance will be very poor. Normal
927 performance is about
500-
600kBytes/s.
930 cp /tftp/
10.0.0.106/build/src/openocd /ram/test
942 <outfile>targets.tcl
</outfile>
943 <level2parent>documentation.tcl
</level2parent>
944 <pageheading>Target config quick start guide
</pageheading>
946 <markup_code><![CDATA[
948 A target needs an openocd.cfg file. This config file sets up
949 the CPU, flash and reset init script. Either ZY1000 ships with an
950 openocd.cfg file for your target or you need to take an existing
951 config file and modify it for your needs.
953 The reset init script is crucial. It will set up e.g. MMU, chip
954 select registers, etc. after a reset. The init.cfg (reset init script)
955 is embedded into the openocd.cfg file in the sampls Zylin provides.
957 Writing an openocd.cfg from scratch is a non-trivial exercise, but
958 fortunally it only has to be done once for a target and afterwards it
959 rarely if ever needs to be changed.
965 Quick start guide on how to configure a target.
977 <menulink>index.tcl
</menulink>
978 <level2parent>index.tcl
</level2parent>
979 <outfile>terminal.tcl
</outfile>
980 <pageheading>UART forwarding
</pageheading>
982 <markup_code><![CDATA[
984 set form_baudrate [formfetch form_baudrate]
985 if {[string length $form_baudrate]==
0} {
986 set form_baudrate [ocd_uart]
987 set form_baudrate [string range $form_baudrate
0 [expr [string length $form_baudrate]-
2]]
989 set form_action [formfetch form_action]
991 <form action=
"terminal.tcl" method=
"post">
993 <select name=
"form_baudrate">
995 foreach i {
9600 19200 38400 57600 115200} {
997 <option <tcl>if {[string compare $form_baudrate $i]==
0} { append buffer {
selected=
"selected"} }
</tcl>
998 value =
"<tcl>append buffer $i</tcl>"><tcl>append buffer $i
</tcl></option>
1005 <input type=
"submit" name=
"form_action" value=
"Set baudrate" >
1008 if {[string compare $form_action
"Set baudrate"]==
0} {
1009 append console [encode [ocd_uart $form_baudrate]]
1013 <h2>Simple UART
</h2>
1014 This terminal window is purely for illustrative purposes. Use telnet or a terminal program
1015 to talk to the target over TCP/IP for anything but trivial case of reading/writing a few
1016 lines of texts in simple tests.
1021 Serial port data to target is forwarded(both directions) in the simple terminal window
1022 to the left. Alternatively you can
<b>telnet
<tcl>append buffer [ip]
</tcl> 5555</b>
1023 or connect via TCP/IP from e.g. HyperTerminal.
1025 Type
"help uart" in telnet for information on how to set uart speed for target. Normally
1026 the uart speed is set from the target configuration script by adding an
"uart N", where