OpenOCD

From Attie's Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "==Download== From git: git://openocd.git.sourceforge.net/gitroot/openocd/openocd Source: http://sourceforge.net/projects/openocd/files/openocd/ ==Build== ===Git=== <source la...")
 
m (Usage)
 
(12 intermediate revisions by one user not shown)
Line 1: Line 1:
 
==Download==
 
==Download==
From git: git://openocd.git.sourceforge.net/gitroot/openocd/openocd
+
From git: git://openocd.git.sourceforge.net/gitroot/openocd/openocd<br>
 
Source: http://sourceforge.net/projects/openocd/files/openocd/
 
Source: http://sourceforge.net/projects/openocd/files/openocd/
  
Line 26: Line 26:
 
make
 
make
 
</source>
 
</source>
 +
 +
==Install==
 +
<source lang="bash">
 +
sudo make install
 +
</source>
 +
 +
==Usage==
 +
Once OpenOCD is running, you must connect to it using <code>telnet</code> on port 4444.
 +
This will give you a command prompt, where you can issue the following commands.
 +
 +
{{note|When flashing an image, use the 5v power supply, as USB cannot provide enough current}}
 +
 +
{|
 +
| <code>halt</code> || halt...
 +
|-
 +
| <code>reset</code> || reset...
 +
|-
 +
| <code>reset halt</code> || reset, and immediately... halt?
 +
|-
 +
| <code>resume [''address'']</code> || resume... (from ''address'')
 +
|-
 +
| <code>flash write_image erase &lt;''image''&gt; &lt;''address''&gt;</code> || put &lt;''image''&gt; into flash at &lt;''address''&gt;
 +
|-
 +
| <code>load_image &lt;''image''&gt; &lt;''address''&gt; [''bin''&#124;''ihex''&#124;''elf''&#124;''s19'']</code> || put &lt;''image''&gt; into SRAM at &lt;''address''&gt;
 +
|-
 +
| <code>exit</code> || exit...
 +
|}
 +
 +
===Loading===
 +
<source lang="text">
 +
reset halt
 +
load_image <image> <address> bin
 +
resume <address>
 +
</source>
 +
 +
===Flashing===
 +
You must <code>halt</code>, <code>flash</code> and <code>reset</code>
 +
 +
==Errors==
 +
===flash failed===
 +
<source lang="text">
 +
auto erase enabled
 +
lm3s.cpu -- clearing lockup after double fault
 +
error -302 executing stellaris flash write algorithm
 +
flash writing failed with CRIS: 0x0
 +
error writing to flash at address 0x00000000 at offset 0x00000000
 +
in procedure 'flash'
 +
</source>
 +
 +
This can occur due to under-current (powered by USB). Either try again, or power using a 5v supply.

Latest revision as of 18:01, 27 July 2012

Contents

[edit] Download

From git: git://openocd.git.sourceforge.net/gitroot/openocd/openocd
Source: http://sourceforge.net/projects/openocd/files/openocd/

[edit] Build

[edit] Git

# checkout the latest release tag (it may have changed!)
git co v0.5.0
 
# bootstrap
./bootstrap
 
# configure
./configure --enable-maintainer-mode

[edit] Source Package

# configure
./configure

[edit] Build

make

[edit] Install

sudo make install

[edit] Usage

Once OpenOCD is running, you must connect to it using telnet on port 4444. This will give you a command prompt, where you can issue the following commands.

Note: When flashing an image, use the 5v power supply, as USB cannot provide enough current
halt halt...
reset reset...
reset halt reset, and immediately... halt?
resume [address] resume... (from address)
flash write_image erase <image> <address> put <image> into flash at <address>
load_image <image> <address> [bin|ihex|elf|s19] put <image> into SRAM at <address>
exit exit...

[edit] Loading

reset halt
load_image <image> <address> bin
resume <address>

[edit] Flashing

You must halt, flash and reset

[edit] Errors

[edit] flash failed

auto erase enabled
lm3s.cpu -- clearing lockup after double fault
error -302 executing stellaris flash write algorithm
flash writing failed with CRIS: 0x0
error writing to flash at address 0x00000000 at offset 0x00000000
in procedure 'flash'

This can occur due to under-current (powered by USB). Either try again, or power using a 5v supply.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox