📄 rcu12.htm
字号:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta name="GENERATOR" content="Quadralay WebWorks Publisher Professional Edition 6.0.5">
<meta name="TEMPLATEBASE" content="book_html">
<meta name="LASTUPDATED" content="12/04/03 16:05:57">
<title>10.2.6 Preparing an RCU for debugging </title>
<STYLE TYPE="text/css">
<!--
span.Signal { text-transform: uppercase; font-family: Verdana }
-->
</STYLE>
</head>
<body link="#3366CC" vlink="#9999CC" text="#000000" alink="#0000CC" bgcolor="#FFFFFF"
background="images/backgrnd.gif">
<p><img src="images/stlogo.gif" width="106" height="83" align="left"
alt="logo here!"> </p>
<table width="331" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td><a href="a_refman.htm"><img src="images/navtoc.gif" width="84" height="23"
border="0" alt="TOC"> </a></td>
<td><a href="rcu11.htm"><img src="images/navprev.gif" width="80" height="23"
border="0" alt="PREV"> </a></td>
<td><a href="rcu13.htm"><img src="images/navnext.gif" width="83" height="23"
border="0" alt="NEXT"> </a></td>
<td><a href="a_refmaa.htm"><img src="images/navidx.gif" width="84" height="23"
border="0" alt="INDEX"> </a></td>
</tr>
</table>
<p><br clear="all">
</p>
<hr align="left">
<blockquote>
<h3>
<a name="1204715"> </a><font color="#003366" face="Verdana, Arial, Helvetica, sans-serif">10.2.6 Preparing an RCU for debugging</font>
</h3>
<p>
<a name="1204716"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">The use of the debugger and the debugger graphical interface are described in the <em>ST20 Embedded Toolset User Manual</em> in the <em>st20run tool</em> and <em>ST Visual Develop</em> chapters respectively. However, for completeness, this section is included here. </font>
</p>
<p>
<a name="1204720"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">RCU files may be debugged symbolically. In order to do this, the debugger must be told where the RCU has been loaded. If the debugger is connected and <font size=2 face=Courier><strong>rcu_init</strong></font> is used, the debugger gets this information by calling <font size=2 face=Courier><strong>rcu_init</strong></font>. If either of these conditions is not met the following command should be used:</font>
</p>
<a name="1204721"> </a><font size=2 face=Courier><strong>program -new <font size=2 face=Courier><strong><em>dbg_filename</em></strong></font> -code <font size=2 face=Courier><strong><em>address</em></strong></font> -data <font size=2 face=Courier><strong><em>address</em></strong></font> -bss address<br></strong></font>
<p>
<a name="1204722"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">where:</font>
</p>
<p>
<a name="1208834"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif"><font size=2 face=Courier><strong><em>dbg_filename</em></strong></font> specifies the name of the debug information file created by <strong>st20cc</strong> when it created the RCU file.</font>
</p>
<p>
<a name="1204723"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif"><font size=2 face=Courier><strong>-code </strong></font><font size=2 face=Courier><strong><em>address</em></strong></font><font size=2 face=Courier><strong> -data </strong></font><font size=2 face=Courier><strong><em>address</em></strong></font><font size=2 face=Courier><strong> -bss </strong></font><font size=2 face=Courier><strong><em>address</em></strong></font> specify the addresses at which the code, data and BSS sections have been loaded.</font>
</p>
<p>
<a name="1204724"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">For example:</font>
</p>
<a name="1204725"> </a><font size=2 face=Courier><strong>program -new app.dbg -code 0x40001000 -data 0x80000140 -bss 0x80000400<br></strong></font>
<p>
<a name="1204726"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">or:</font>
</p>
<a name="1204727"> </a><font size=2 face=Courier><strong>program -new simp.dbg -code 0x40001000<br></strong></font>
<p>
<a name="1204728"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">for an RCU that has no data section.</font>
</p>
<p>
<a name="1204729"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">This command can be submitted to the debugger via the command console or alternatively the application can do this by using the <font size=2 face=Courier><strong>debugcommand</strong></font> function:</font>
</p>
<a name="1204730"> </a><font size=2 face=Courier><strong>debugcommand("program -new simp.dbg -code 0x40001000", &pid);<br></strong></font>
<p>
<a name="1204731"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">Debug operations (for example, breakpoint, variable examination) can now be performed on the RCU.</font>
</p>
<p>
<a name="1205553"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif"><em>Note: The correct program context must be used so that the debugger knows which program is being referred to. This can be done using the <font size=2 face=Courier><strong>context</strong></font> command or the program chooser in the source display of the GUI. When the program hits a breakpoint the context is automatically updated to the correct program.</em></font>
</p>
<p>
<a name="1204732"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">When the RCU is ready to be unloaded the debugger must be informed. The recommended way of doing this is by using <font size=2 face=Courier><strong>rcu_deinit</strong></font>. The command: <font size=2 face=Courier><strong>program delete</strong></font> can also be used. This command can be issued by the (un)loader code:</font>
</p>
<a name="1204733"> </a><font size=2 face=Courier><strong>sprintf(buf,"program -delete %d", pid);<br>debugcommad(buf);<br></strong></font>
<p>
<a name="1204735"> </a><font size=2 face="Verdana, Arial, Helvetica, sans-serif">where <font size=2 face=Courier><strong>pid</strong></font> is assigned by a previous <font size=2 face=Courier><strong>program -new</strong></font> command.</font>
</p>
</blockquote>
<hr>
<table width="331" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td><a href="a_refman.htm"><img src="images/navtoc.gif" width="84" height="23"
border="0" alt="TOC"> </a></td>
<td><a href="rcu11.htm"><img src="images/navprev.gif" width="80" height="23"
border="0" alt="PREV"> </a></td>
<td><a href="rcu13.htm"><img src="images/navnext.gif" width="83" height="23"
border="0" alt="NEXT"> </a></td>
<td><a href="a_refmaa.htm"><img src="images/navidx.gif" width="84" height="23"
border="0" alt="INDEX"> </a></td>
</tr>
</table>
<font size=1 face="Verdana, Arial, Helvetica, sans-serif"> © 2001, 2002, 2003 STMicroelectronics. All Rights Reserved.<br>
ADCS 7250966F</font>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -