• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src-rt-6.x.4708/toolchains/hndtools-armeabi-2013.11/share/doc/arm-arm-none-eabi/html/getting-started/
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>3.3.�Using Flash Memory</title><link rel="stylesheet" type="text/css" href="cs.css"><meta name="generator" content="DocBook XSL Stylesheets V1.78.0"><link rel="home" href="index.html" title="Sourcery CodeBench Lite"><link rel="up" href="chap-target.html" title="Chapter�3.�Sourcery CodeBench Lite for ARM EABI"><link rel="prev" href="sec-multilibs.html" title="3.2.�Library Configurations"><link rel="next" href="sec-armfloat.html" title="3.4.�Using VFP Floating Point"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">3.3.�Using Flash Memory</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sec-multilibs.html">Prev</a>�</td><th width="60%" align="center">Chapter�3.�Sourcery CodeBench Lite for ARM EABI</th><td width="20%" align="right">�<a accesskey="n" href="sec-armfloat.html">Next</a></td></tr></table><hr></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sec-using-flash"></a>3.3.�Using Flash Memory</h2></div></div></div><p>
2    Sourcery CodeBench Lite supports development and debugging of applications
3    loaded into flash memory on ARM EABI targets.  There are
4    three steps involved:
5  </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
6	You must use an appropriate linker script that identifies the
7	ROM memory region on your target board, and locates the program
8	text within that region.
9	<span class="phrase">
10	  Refer to <a class="xref" href="chap-cs3.html" title="Chapter�5.�CS3&#8482;: The CodeSourcery Common Startup Code Sequence">Chapter�5, &#8220;CS3&#8482;: The CodeSourcery Common Startup Code Sequence&#8221;</a> for information about the
11	  boards supported by Sourcery CodeBench.
12	</span>
13       </p></li><li class="listitem"><p>
14	Next, load your program into the flash memory on your target board.
15	
16	You must
17	  
18	use third-party tools to program the flash memory.
19      </p></li><li class="listitem"><p>
20	Finally, when debugging a program in flash memory, GDB must be
21	told about the ROM region so that it knows where it must use
22	hardware breakpoints to control program execution.
23	
24       </p><p>
25	When using GDB from the command line, you can mark the flash memory 
26	as read-only by using the command:
27	</p><pre class="screen">(gdb) mem <em class="replaceable"><code>start</code></em> <em class="replaceable"><code>end</code></em> ro</pre><p>
28	where <em class="replaceable"><code>start</code></em> and
29	<em class="replaceable"><code>end</code></em> define the address range of the
30	read-only memory region.
31      </p></li></ol></div><p>
32    In addition to GDB's automatic use of hardware breakpoints in the
33    ROM region, you can also set hardware breakpoints explicitly from
34    the debugger.
35    However, on many targets the number of available hardware breakpoints
36    is very small.  Furthermore,
37    GDB also uses hardware breakpoints internally to implement commands
38    such as <code class="command">step</code>, <code class="command">next</code>, and 
39    <code class="command">finish</code>.  Thus the number of breakpoints you can
40    explicitly set in ROM may be fewer than the number of hardware
41    breakpoints supported by the target system.
42  </p><p>
43    For example, ARM7TDMI cores support only one hardware breakpoint,
44    which must also be used internally by the debugger if you set any
45    software breakpoints in RAM.  On ARM9 cores, there are two hardware
46    breakpoints supported and one is consumed by the debugger if you
47    set any software breakpoints.  
48  </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sec-multilibs.html">Prev</a>�</td><td width="20%" align="center"><a accesskey="u" href="chap-target.html">Up</a></td><td width="40%" align="right">�<a accesskey="n" href="sec-armfloat.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">3.2.�Library Configurations�</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">�3.4.�Using VFP Floating Point</td></tr></table></div></body></html>
49