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>Type "help power" in telnet for command to control power relay.</p>
101 <outfile>targets.tcl</outfile>
102 <level2parent>documentation.tcl</level2parent>
103 <pageheading>Target config quick start guide</pageheading>
105 <markup_code><![CDATA[
107 A target needs an openocd.cfg file. This config file sets up
108 the CPU, flash and reset init script. Either OpenOCD ships with an
109 openocd.cfg file for your target or you need to take an existing
110 config file and modify it for your needs.
112 The reset init script is crucial. It will set up e.g. MMU, chip
113 select registers, etc. after a reset. The init.cfg (reset init script)
114 is embedded into the openocd.cfg file in the sampls OpenOCD provides.
116 Writing an openocd.cfg from scratch is a non-trivial exercise, but
117 fortunally it only has to be done once for a target and afterwards it
118 rarely if ever needs to be changed.
124 Quick start guide on how to configure a target.
135 <outfile>flashinfo.tcl</outfile>
136 <menutext>Flash</menutext>
137 <menulink>flashinfo.tcl</menulink>
138 <pageheading>Flash Information</pageheading>
139 <level2parent>flashinfo.tcl</level2parent>
140 <level2menu href="flashinfo.tcl" title="Info" titlestyle="color:#4e6627;">
142 <level2menu href="erase.tcl" title="Erase" titlestyle="color:#4e6627;">
144 <level2menu href="flash.tcl" title="Program / Verify" titlestyle="color:#4e6627;">
146 <level2menu href="production.tcl" title="Production" titlestyle="color:#4e6627;">
150 <markup_code><![CDATA[
152 <div style="font-size:14px;">Configured flash banks:</div>
154 <code style="white-space: nowrap;">
156 set flash_return [ocd_flash_banks]
157 if {[llength $flash_return]!=0} {
158 append buffer [encode [flash banks]]
160 set form_action [formfetch form_action]
161 if {[string compare $form_action "Reset CPU and probe flash"]==0} {
162 append console [encode [capture_catch "reset init"]]
163 append buffer [encode [capture_catch "flash probe 0"]]
164 append buffer [encode [capture_catch "flash info 0"]]
167 append buffer "No flash bank configured."
171 <form action="flashinfo.tcl" method="post">
172 <input type="submit" name="form_action" value="Reset CPU and probe flash">
175 foreach a [ocd_flash_banks] {
176 append buffer "Flash bank at [format "0x%08x size 0x%08x" $a(base) $a(size)]: "
178 <form action="downloadmem.tcl" method="post">
179 <input type="hidden" name="form_address" value="<tcl>append buffer [format "0x%08x" $a(base)]</tcl>">
180 <input type="hidden" name="form_length" value="<tcl>append buffer [format "0x%08x" $a(size)]</tcl>">
182 <input type="submit" value="Download" name="form_action">
194 <p>Here you will find information about the flash chips that you have
195 in your configuration.<p/>
196 <p><b>Reset CPU and probe flash</b> - This will reset the CPU and show
197 you more detailed information about your flash. This includes information about
198 the different sectors in the flash, and the flash driver used.</p>
206 <outfile>flash.tcl</outfile>
207 <level2parent>flashinfo.tcl</level2parent>
208 <pageheading>Program / Verify Flash</pageheading>
210 <markup_code><![CDATA[
214 set form_offset [formfetch form_offset]
215 set form_action [formfetch form_action]
216 set form_type [formfetch form_type]
220 catch {set post $post_data} err
222 if {[string compare $form_offset ""]==0} {
225 if {[string compare $form_type ""]==0} {
229 </tcl><code style="white-space: nowrap;"><tcl>
232 append buffer {<form enctype="multipart/form-data" action="flash.tcl" method="post">}
234 set action_reset [expr {[string length $form_action]!=0}]
235 set action_flash [expr {[string compare $form_action "Flash"]==0 || [string compare $form_action "Flash and verify"]==0}]
236 set action_verify [expr {[string compare $form_action "Verify"]==0 || [string compare $form_action "Flash and verify"]==0}]
239 append console [encode [capture_catch "reset init"]]
244 append buffer {<table>}
245 append buffer {<tr><td class="formtext">File</td><td><input type="file" name="form_filecontent"></td></tr>}
246 append buffer "<tr><td class=\"formtext\" >Offset</td><td><input type=\"text\" name=\"form_offset\" value=\"$form_offset\"></td></tr>"
249 <tr><td class="formtext" style="padding-top:1px;">Type</td><td>
250 <select name="form_type">
252 <tcl>if {[string compare $form_type ""]==0} { append buffer {selected="selected"} } </tcl>
253 value ="">auto</option>
255 <tcl>if {[string compare $form_type "elf"]==0} { append buffer {selected="selected"} } </tcl>
256 value ="elf">elf</option>
258 <tcl>if {[string compare $form_type "bin"]==0} { append buffer {selected="selected"} } </tcl>
259 value ="bin">binary</option>
261 <tcl>if {[string compare $form_type "ihex"]==0} { append buffer {selected="selected"} } </tcl>
262 value ="ihex">ihex</option>
263 <!-- broken <option value ="s19">s19</option> -->
273 <tr><td style="height:15px;width:535px;"> </td></tr>
274 <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
275 <tr><td style="height:15px;width:535px;"> </td></tr>
279 <td><input type="submit" name="form_action" value="Flash" ></td>
280 <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Flash and verify" ></td>
281 <td class="buttonspacesmall"></td><td><input type="submit" name="form_action" value="Verify" ></td>
287 if {$action_flash||$action_verify} {
288 catch {writeform form_filecontent $upload_filename} result
289 append console [encode $result]
293 append console [encode [capture_catch "halt"]]
295 if {[catch {capture_catch {eval "flash write_image erase $upload_filename $form_offset $form_type"}} result]} {
296 append buffer "Flash write failed<br>"
297 append console [encode $result]
299 append buffer [encode $result]
300 append buffer "Flash write succeed<br>"
304 if {$action_verify} {
305 append console [encode [capture_catch "halt"]]
307 if {[catch {capture_catch {eval "verify_image $upload_filename $form_offset $form_type"}} result]} {
308 append buffer "Verify failed<br>"
309 append console [encode $result]
311 append buffer [encode $result]
312 append buffer "Verify succeed<br>"
324 <p>Program and/or verify the flash on your target.</p>
325 <p><b>Flash</b> - Halt CPU, automatically erase flash if required and program flash with image.</p>
326 <p><b>Flash and verify</b> - Programs the flash and verifies the programmed flash content is correct.</p>
327 <p><b>Verify</b> - Halt CPU and verify image in flash or RAM.</p>
328 <p><b>Offset</b> - This value is added to the address of the image.<br>
329 Binary images start at address 0 by default, whereas elf and ihex have addresses encoded into the image.<br>
330 Typically 0 for elf/ihex and the address to write the image to for binary files.</p>
343 <outfile>production.tcl</outfile>
344 <level2parent>flashinfo.tcl</level2parent>
345 <pageheading>Production</pageheading>
347 <markup_code><![CDATA[
349 set form_action [formfetch form_action]
350 set form_serialnumber [formfetch form_serialnumber]
351 append buffer [production_info]
354 <form enctype="multipart/form-data" action="production.tcl" method="post">
355 <code style="white-space: nowrap;">
357 if {[string compare $form_action "Upload firmware"]==0} {
358 set wrotedata [catch {writeform form_filecontent $upload_filename} result]
359 append buffer [encode $result]
361 append buffer "<br>Running production procedure<p>"
362 append buffer "<br>Reset and init: <br>"
364 append console [encode [capture_catch {catch "production $upload_filename $form_serialnumber"}]]
367 if {[string compare $form_action "Test"]==0} {
368 append buffer "<br>Running production test. Output from first 10 seconds printed below. <p>"
370 append console [encode [capture_catch {catch production_test}]]
372 if {[string compare $form_action "Power on"]==0} {
373 append console [encode [capture_catch "power on"]]
375 if {[string compare $form_action "Power off"]==0} {
376 append console [encode [capture_catch "power off"]]
381 append buffer {<p class="formtext">Firmware file(raw binary) <input type="file" name="form_filecontent"><p>}
382 append buffer {<p class="formtext">Serial number <input type="text" name="form_serialnumber"><p>}
386 <tr><td style="height:15px;width:535px;"> </td></tr>
387 <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
388 <tr><td style="height:15px;width:535px;"> </td></tr>
392 <td><input type="submit" name="form_action" value="Upload firmware" ></td>
393 <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Test"></td>
394 <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Power on"></td>
395 <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Power off">
403 The target script can implement the "production", "production_info" and "production_test" tcl proc's. These procedures
404 are used on this page. There are default implementations that do nothing.
406 <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>
407 <p><b>Test</b> - Power up target, run 10 second target test. Output is provided via the DCC output channel. </p>
408 <p><b>Power on</b> - Power on target.</p>
409 <p><b>Power off</b> - Power off target.</p>
410 <p><b>Serial number</b> - A target script can use this string in the production procedure. Type "help production" for more info.</p>
422 <outfile>erase.tcl</outfile>
423 <menulink>erase.tcl</menulink>
424 <pageheading>Erase Flash</pageheading>
425 <level2parent>flashinfo.tcl</level2parent>
427 <markup_code><![CDATA[
433 set form_address [formfetch form_address]
434 set form_length [formfetch form_length]
435 set form_action [formfetch form_action]
437 if {[string compare $form_length ""]==0} {
438 set form_length 0x10000
440 if {[string compare $form_address ""]==0} {
441 if {[catch {[first_flash_base]} result]==0} {
442 set form_address "0x[tohex $result]"
447 if {[string compare $form_address ""]!=0} {
448 if {[string compare $form_action "Erase"]==0} {
449 append buffer "<code style=\"white-space: nowrap;\">"
450 append console [encode [capture_catch {
452 flash erase_address $form_address $form_length}]]
453 append buffer </code>
460 <form action="erase.tcl" method="post">
462 <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>
463 <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="<tcl>append buffer $form_length</tcl>"></td></tr>
467 <tr><td style="height:15px;width:535px;"> </td></tr>
468 <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
469 <tr><td style="height:15px;width:535px;"> </td></tr>
472 <input type="submit" name="form_action" value="Erase"><br>
482 <p>Note that flash programming will erase flash if required.<p/>
483 <p>Reset and init CPU, then erase address range.</p>
484 <p>The length field is specified in number of bytes.</p>
493 <outfile>run.tcl</outfile>
494 <menulink>run.tcl</menulink>
495 <pageheading>Run program</pageheading>
496 <level2parent>flashinfo.tcl</level2parent>
498 <markup_code><![CDATA[
504 set form_address [formfetch form_address]
505 set form_action [formfetch form_action]
507 if {[string compare $form_action "Run from address"]==0} {
508 append console [encode [capture_catch "halt"]]
509 append console [encode [capture_catch "wait_halt"]]
510 append console [encode [capture_catch "resume $form_address"]]
513 if {[string compare $form_action "Halt"]==0} {
514 append console [encode [capture_catch "halt"]]
515 append console [encode [capture_catch "wait_halt"]]
518 if {[string compare $form_action "Reset and run"]==0} {
519 append console [encode [capture_catch "reset run"]]
522 if {[string compare $form_action "Reset and init"]==0} {
523 append console [encode [capture_catch "reset init"]]
526 append console [encode [capture_catch poll]]
530 <form action="run.tcl" method="post">
532 <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>
536 <tr><td style="height:15px;width:535px;"> </td></tr>
537 <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
538 <tr><td style="height:15px;width:535px;"> </td></tr>
541 <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>
549 <p>Reset and run - reset CPU and let it run.</p>
550 <p>Halt - halt CPU.</p>
551 <p>Run from address - halt CPU and resume from address. Default is resume from current address.</p>
552 <p>Reset and init - reset CPU and run init script.</p>
561 <outfile>browsemem.tcl</outfile>
562 <menutext>Memory</menutext>
563 <menulink>browsemem.tcl</menulink>
564 <pageheading>Browse / Edit Memory</pageheading>
565 <level2parent>browsemem.tcl</level2parent>
566 <level2menu href="browsemem.tcl" title="Browse / Edit" titlestyle="color:#4e6627;">
568 Browse and edit memory.
571 <level2menu href="downloadmem.tcl" title="Download" titlestyle="color:#4e6627;">
573 Copy memory range to developer machine
578 <markup_code><![CDATA[
584 set form_address [formfetch form_address]
585 set form_length [formfetch form_length]
586 set form_type [formfetch form_type]
587 set form_action [formfetch form_action]
588 set form_value [formfetch form_value]
590 if {[string compare $form_length ""]==0} {
593 if {$form_length<=0} {
596 if {$form_length>0x1000} {
597 set form_length 0x1000
600 if {[string compare $form_type ""]==0} {
604 if {[string compare $form_type "mdw"]==0} {
608 if {[string compare $form_type "mdh"]==0} {
612 if {[string compare $form_type "mdb"]==0} {
620 if {[string compare $form_address ""]!=0} {
621 if {[string compare $form_action "Previous"]==0} {
622 # Kludge! Work around problems parsing hex in Jim Tcl expressions
623 incr form_address ; set form_address [expr $form_address-1]
624 if {$form_address-$form_length>0} {
625 set form_address "0x[tohex [expr $form_address-$form_length]]"
627 set form_address "0x0"
630 if {[string compare $form_action "Next"]==0} {
631 # Kludge! Work around problems parsing hex in Jim Tcl expressions
632 incr form_address ; set form_address [expr $form_address-1]
633 set form_address "0x[tohex [expr $form_address+$form_length]]"
635 if {[string compare $form_action "Modify"]==0} {
636 append console [capture_catch "$modify_cmd $form_address $form_value"]
638 if {[string compare $form_action "Fill"]==0} {
639 append console [capture_catch "$modify_cmd $form_address $form_value $form_length"]
646 <form action="browsemem.tcl" method="post">
648 <tr><td class="formtext">Address</td><td><input type="text" name="form_address" value="<tcl>append buffer $form_address</tcl>"></td></tr>
649 <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="<tcl>append buffer "0x[tohex $form_length]"</tcl>"></td></tr>
650 <tr><td class="formtext">Value</td><td><input type="text" name="form_value" value="<tcl>append buffer $form_value</tcl>"></td>
651 <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Modify"></td>
652 <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Fill"></td></tr>
653 <tr><td class="formtext">Type</td><td style="padding-top:1px;">
654 <select name="form_type">
656 <tcl>if {[string compare $form_type "mdb"]==0} { append buffer {selected="selected"} } </tcl> value ="mdb">8 bit
659 <tcl>if {[string compare $form_type "mdh"]==0} { append buffer {selected="selected"} } </tcl> value ="mdh">16 bit
662 <tcl>if {[string compare $form_type "mdw"]==0} { append buffer {selected="selected"} } </tcl>value ="mdw">32 bit
669 <tr><td style="height:15px;width:535px;"> </td></tr>
670 <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
671 <tr><td style="height:15px;width:535px;"> </td></tr>
675 <td><input type="submit" name="form_action" value="Refresh"></td>
676 <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Previous" ></td>
677 <td class="buttonspacesmall"> </td><td><input type="submit" name="form_action" value="Next" ></td>
683 <div class="fontbigger">Memory:</div><p>
684 <code style="white-space: nowrap; font-size:11px;font:courier new;">
686 if {[string compare $form_address ""]!=0} {
687 append console [encode [capture_catch halt]]
688 append buffer [encode [capture_catch "$form_type $form_address [expr $form_length]"]]
700 <p>Browse and edit target memory.<br>
701 Length is in bytes, maximum 4096 bytes.</p>
702 <p>An error message is shown when trying to browse or edit memory which cases a CPU fault.</p>
703 <p>CPU will be halted if required.</p>
704 <p><b>Modify</b> - Will modify only one byte, half-word or word starting at Address.</p>
705 <p><b>Fill</b> - Will fill the specified region with the specified value.</p>
706 <p><b>Refresh</b> - Display the content of the specified memory area.</p>
717 <outfile>downloadmem.tcl</outfile>
718 <level2parent>browsemem.tcl</level2parent>
719 <pageheading>Download Memory Range</pageheading>
721 <markup_code><![CDATA[
723 set form_address [formfetch form_address]
724 set form_length [formfetch form_length]
725 set form_action [formfetch form_action]
727 <form action="downloadmem.tcl" method="post">
729 <tr><td class="formtext">Address</td><td><input type="text" name="form_address" value="<tcl>append buffer $form_address</tcl>"></td></tr>
730 <tr><td class="formtext">Length</td><td><input type="text" name="form_length" value="<tcl>append buffer $form_length</tcl>"></td></tr>
735 <tr><td style="height:15px;width:535px;"> </td></tr>
736 <tr><td style="height:1px;width:535px;background-color:#a2c5d1;"></td></tr>
737 <tr><td style="height:15px;width:535px;"> </td></tr>
740 <input type="submit" value="Download" name="form_action">
745 if {[string compare $form_action "Download"]==0} {
746 append console [encode [capture_catch "reset init"]]
747 append console [encode [capture_catch "dump_image /tmp/dump.bin $form_address $form_length"]]
749 <form action="../dump.bin" target="_blank">
750 <input type="submit" name="form_action" value="Save downloaded memory">
762 Download memory from target. <br>
763 <b>Note</b> that download memory can take
764 a long time(potentially minutes for megabytes at low JTAG clk speeds).
766 Once the memory is downloaded a link is available on the page to download
777 <outfile>openocd.tcl</outfile>
778 <menutext>OpenOCD</menutext>
779 <menulink>openocd.tcl</menulink>
780 <pageheading>Run Command</pageheading>
781 <level2parent>openocd.tcl</level2parent>
782 <level2menu href="openocd.tcl" title="Run Command" titlestyle="color:#4e6627;">
784 <level2menu href="guiupload.tcl" title="Upload File" titlestyle="color:#4e6627;">
791 <markup_code><![CDATA[
794 set form_command [formfetch form_command]
797 if {[string length $form_command]>0} {
798 set form_edittext [capture_catch {eval $form_command}]
801 append buffer {<form action="openocd.tcl" method="post">} "\n"
802 append buffer {Command<br>}
803 append buffer {<textarea style="overflow:auto;" rows="5" cols="65" name="form_command" wrap="off">}
804 append buffer [to_textarea $form_command]
805 append buffer {</textarea><br>}
806 append buffer {<input type="submit" value="Run" name="form_action" ><br>}
807 append buffer {<textarea style="overflow:auto;" rows="21" cols="65" name="form_edittext" readonly=1 wrap="off">}
808 append buffer [to_textarea $form_edittext]
809 append buffer {</textarea><br>}
811 append buffer {</form>} "\n"
819 <p>Run tcl statement(s). Add "ocd_" prefix to OpenOCD commands otherwise
820 there will be no output, e.g. "reset init" use "ocd_reset init".
822 <p><a href="/ram/log">Click here to download log</a>.</p>
823 <p>To download log you can also use commands like "wget http://<tcl>append buffer [ip]</tcl>/ram/log", or
824 point your web browser to said address.</p>
826 You can also execute tcl commands using curl from your developer PC:
829 curl --form form_command=ocd_version <tcl>append buffer [ip]</tcl>runtcl.tcl
840 <outfile>guiupload.tcl</outfile>
841 <level2parent>openocd.tcl</level2parent>
842 <pageheading>Upload File</pageheading>
844 <markup_code><![CDATA[
847 set form_filename [formfetch form_filename];
848 set form_action [formfetch form_action];
849 #set form_filecontent [formfetch form_filecontent];
851 append buffer {<form enctype="multipart/form-data" action="guiupload.tcl" method="post">}
853 if {[string compare $form_action "Upload"]==0} {
854 if {[catch {writeform form_filecontent $form_filename} result]==0} {
855 append buffer [encode $result]
857 append buffer Wrote $form_filename
861 append buffer {<table style="padding:0px;border-collapse:collapse;"><tr><td class="formtext">Filename on OpenOCD machine</td><td><input type="text" name="form_filename"></td></tr>}
862 append buffer {<td class="formtext">File to upload</td><td><input type="file" name="form_filecontent"></td></tr></table>}
863 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>}
864 append buffer {<input type="submit" name="form_action" value="Upload" ><br> }
865 append buffer {</form>}
877 <outfile>targets.tcl</outfile>
878 <level2parent>documentation.tcl</level2parent>
879 <pageheading>Target config quick start guide</pageheading>
881 <markup_code><![CDATA[
883 A target needs an openocd.cfg file. This config file sets up
884 the CPU, flash and reset init script. Either OpenOCD ships with an
885 openocd.cfg file for your target or you need to take an existing
886 config file and modify it for your needs.
888 The reset init script is crucial. It will set up e.g. MMU, chip
889 select registers, etc. after a reset. The init.cfg (reset init script)
890 is embedded into the openocd.cfg file in the sampls OpenOCD provides.
892 Writing an openocd.cfg from scratch is a non-trivial exercise, but
893 fortunally it only has to be done once for a target and afterwards it
894 rarely if ever needs to be changed.
900 Quick start guide on how to configure a target.
912 <menulink>index.tcl</menulink>
913 <level2parent>index.tcl</level2parent>
914 <outfile>terminal.tcl</outfile>
915 <pageheading>UART forwarding</pageheading>
917 <markup_code><![CDATA[
919 set form_baudrate [formfetch form_baudrate]
920 if {[string length $form_baudrate]==0} {
921 set form_baudrate [ocd_uart]
922 set form_baudrate [string range $form_baudrate 0 [expr [string length $form_baudrate]-2]]
924 set form_action [formfetch form_action]
926 <form action="terminal.tcl" method="post">
928 <select name="form_baudrate">
930 foreach i {9600 19200 38400 57600 115200} {
932 <option <tcl>if {[string compare $form_baudrate $i]==0} { append buffer {selected="selected"} } </tcl>
933 value ="<tcl>append buffer $i</tcl>"><tcl>append buffer $i</tcl></option>
940 <input type="submit" name="form_action" value="Set baudrate" >
943 if {[string compare $form_action "Set baudrate"]==0} {
944 append console [encode [ocd_uart $form_baudrate]]
949 This terminal window is purely for illustrative purposes. Use telnet or a terminal program
950 to talk to the target over TCP/IP for anything but trivial case of reading/writing a few
951 lines of texts in simple tests.
956 Serial port data to target is forwarded(both directions) in the simple terminal window
957 to the left. Alternatively you can <b>telnet <tcl>append buffer [ip]</tcl> 5555</b>
958 or connect via TCP/IP from e.g. HyperTerminal.
960 Type "help uart" in telnet for information on how to set uart speed for target. Normally
961 the uart speed is set from the target configuration script by adding an "uart N", where