• 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-2011.09/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" href="cs.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.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" lang="en"><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 type="1"><li><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>
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><p>
14	Next, load your program into the flash memory on your target board.
15	<span></span>
16	You must
17	  <span></span>
18	use third-party tools to program the flash memory.
19      </p></li><li><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	<span>
24	  If you are using the Sourcery CodeBench Debug Sprite to debug your
25	  program, the Sprite does this automatically, using the memory
26	  map provided in the board configuration file.
27	  Otherwise, you must provide this information explicitly.
28	</span>
29       </p><p>
30	When using GDB from the command line, you can mark the flash memory 
31	as read-only by using the command:
32	</p><pre class="screen">(gdb) mem <em class="replaceable"><code>start</code></em> <em class="replaceable"><code>end</code></em> ro</pre><p>
33	where <em class="replaceable"><code>start</code></em> and
34	<em class="replaceable"><code>end</code></em> define the address range of the
35	read-only memory region.
36      </p></li></ol></div><p>
37    In addition to GDB's automatic use of hardware breakpoints in the
38    ROM region, you can also set hardware breakpoints explicitly from
39    the debugger.
40    However, on many targets the number of available hardware breakpoints
41    is very small.  Furthermore,
42    GDB also uses hardware breakpoints internally to implement commands
43    such as <code class="command">step</code>, <code class="command">next</code>, and 
44    <code class="command">finish</code>.  Thus the number of breakpoints you can
45    explicitly set in ROM may be fewer than the number of hardware
46    breakpoints supported by the target system.
47  </p><p>
48    For example, ARM7TDMI cores support only one hardware breakpoint,
49    which must also be used internally by the debugger if you set any
50    software breakpoints in RAM.  On ARM9 cores, there are two hardware
51    breakpoints supported and one is consumed by the debugger if you
52    set any software breakpoints.  
53  </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>
54