You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

974 lines
31 KiB

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