⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c-builder6.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 2 页
字号:
</div></dl></div></p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="99220">Configuration for Serial Connection</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="99221"> </a>To configure the target agent to use a raw serial communication path, add the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB serial connection</font></b> component. (See <a href="c-start4.html#90248"><i class="title">2.4.3&nbsp;Serial-Line Connections</i></a>). </p><dd><p class="Body"><a name="99228"> </a>By default, the agent uses serial channel 1 at 9600 bps.<sup><a href="#foot"><b class="FootnoteMarker">1</b></a></sup> For better performance, use the highest line speed available, which is often 38400 bps. Try a slower speed if you suspect data loss. To change the speed, display the component property sheet, select the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Params</font></b> tab, select <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB_TTY_BAUD</font></b> and change the value associated with it. <div class="frame"><h4 class="EntityTitle"><a name="99231"><font face="Helvetica, sans-serif" size="-1" class="sans">Figure 4-47:&nbsp;&nbsp;Serial Connection Macros</font></a></h4><dl class="margin"><div class="CellBody"><a name="99236"> </a><img class="figure" border="0" src="images/c-builder35.gif"></div></dl></div></p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="99238">Configuration for tyCoDrv Connection</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="99239"> </a>To configure a version 1.0 BSP target agent to a use a serial connection, add the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB tyCoDrv connection</font></b> component. Display the component property sheet and select the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">Params</font></b> tab to display and modify macro values.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="99241">Scaling the Target Agent</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="99243"> </a>In a memory-constrained system, you may wish to create a smaller agent. To reduce program text size, you can remove the following optional agent facilities:</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="99245"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB banner </font></b>(<b class="symbol_UC">INCLUDE_WDB_BANNER</b>)</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="106078"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">VIO driver</font></b> (<b class="symbol_UC">INCLUDE_WDB_VIO</b>)</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="106080"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB task creation</font></b> (<b class="symbol_UC">INCLUDE_WDB_START_NOTIFY</b>)</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="106082"> </a><b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB user event </font></b>(<b class="symbol_UC">INCLUDE_WDB_USER_EVENT</b>)</li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="99250"> </a>These components are in the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">development tool components</font></b>&gt;<b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB agent components</font></b>&gt;<b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB agent services</font></b> folder path. </p><dd><p class="Body"><a name="101755"> </a>You can also reduce the maximum number of WDB breakpoints with the <b class="symbol_UC">WDB_BP_MAX</b> parameter of the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB breakpoints </font></b>component. And if you are using a serial connection, you can set the <b class="symbol_UC">INCLUDE_WDB_TTY_TEST</b> parameter to <b class="symbol_UC">FALSE</b>.</p><dd><p class="Body"><a name="99251"> </a>If you are using a communication path which supports both system and task mode agents, then by default both agents are started. Since each agent consumes target memory (for example, each agent has a separate execution stack), you may wish to exclude one of the agents from the target system. You can configure the target to use only a task-mode agent or only a system-mode with the <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDP task debugging</font></b> or <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB system debugging</font></b> options (which are in the folder path <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">development tool components</font></b>&gt;<b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB agent components</font></b>&gt;<b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">select WDB mode</font></b>).</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="99265">Configuring the Target Agent for Exception Hooks</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="101769"> </a>If your application (or BSP) uses <b class="routine"><i class="routine">excHookAdd</i></b><b>(&nbsp;)</b> to handle exceptions, host tools will still be notified of <i class="emphasis">all</i> exceptions (including the ones handled by your exception hook). If you want to suppress host tool notifications, you must exclude the component <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB exception notification</font></b>. When this component is excluded, the target server is not notified about target exceptions, but the target will still report them in its console. In addition, if an exception occurs in the WDB task, the task will be suspended and the connection between the target server and the target agent will be broken.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="101589">Starting the Agent Before the Kernel</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="99273"> </a>By default, the target agent is initialized near the end of the VxWorks initialization sequence. This is because the default configuration calls for the agent to run in task mode and to use the network for communication; thus, <b class="routine"><i class="routine">wdbConfig</i></b><b>(&nbsp;)</b> must be called after <b class="routine"><i class="routine">kernelInit</i></b><b>(&nbsp;)</b> and <b class="routine"><i class="routine">usrNetInit</i></b><b>(&nbsp;)</b>. (See <i class="title">VxWorks Programmer's Guide: Configuration and Build</i> for an outline of the overall VxWorks initialization sequence.)</p><dd><p class="Body"><a name="99277"> </a>In some cases (for example, if you are doing a BSP port for the first time), you may want to start the agent before the kernel starts, and initialize the kernel under the control of the Tornado host tools. To make that change, perform the following steps when you configure VxWorks:</p></dl><dl class="margin"><p><ol class="List"><li value="1."><a name="99278"> </a>Choose a communication path that can support a system-mode agent (NetROM or raw serial). The END communication path cannot be used as it requires the system be started before it is initialized.</li></ol></p><p><ol class="List"><li value="2."><a name="99279"> </a>Change your configuration so that only <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB system debugging</font></b> is selected (in folder path <b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">development tool components</font></b>&gt;<b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">WDB agent components</font></b>&gt;<b class="guiLabel"><font face="Helvetica, sans-serif" size="-1" class="sans">select WDB mode</font></b>). By default, the task mode starts two agents: a system-mode agent and a task-mode agent. Both agents begin executing at the same time, but the task-mode agent requires the kernel to be running. </li></ol></p><p><ol class="List"><li value="3."><a name="101778"> </a>Create a configuration descriptor file called <i class="textVariable">fileName</i><b class="file">.cdf</b> (for example, <b class="file">wdb.cdf</b>) in your project directory that contains the following lines:</li></ol></p><dl class="margin"><dl class="margin"><dd><pre class="Code3"><b><a name="101852">InitGroup usrWdbInit { &nbsp;&nbsp;&nbsp;&nbsp;INIT_RTN    usrWdbInit (); wdbSystemSuspend (); &nbsp;&nbsp;&nbsp;&nbsp;_INIT_ORDER usrInit &nbsp;&nbsp;&nbsp;&nbsp;INIT_BEFORE INCLUDE_KERNEL }</a></b></pre></dl></dl><dl class="margin"><dd><div class="Indent"><a name="101780"> </a>This causes the project code generator to make the <b class="routine"><i class="routine">usrWdbInit</i></b><b>(&nbsp;)</b> call earlier in the initialization sequence. It will be called from <b class="routine"><i class="routine">usrInit</i></b><b>(&nbsp;)</b>, just before the component kernel is started.<sup><a href="#foot"><b class="FootnoteMarker">2</b></a></sup></div><br></dl></dl><dl class="margin"><dd><p class="Body"><a name="99282"> </a>After the target server connects to the system-mode target agent, you can resume the system to start the kernel under the agent's control. (See <a href="c-shell2.html#91110"><i class="title">6.2.6&nbsp;Using the Shell for System Mode Debugging</i></a> for information on using system mode from the shell, and <a href="c-debugger6.html#85341"><i class="title">8.6&nbsp;System-Mode Debugging</i></a> for information on using it from the debugger. </p><dd><p class="Body"><a name="99290"> </a>After connecting to the target agent, set a breakpoint in <b class="routine"><i class="routine">usrRoot</i></b><b>(&nbsp;)</b>, then continue the system. The routine <b class="routine"><i class="routine">kernelInit</i></b><b>(&nbsp;)</b> starts the multi-tasking kernel with <b class="routine"><i class="routine">usrRoot</i></b><b>(&nbsp;)</b> as the entry point for the first task. Before<b class="routine"><i class="routine"> kernelInit</i></b><b>(&nbsp;)</b> is called, interrupts are still locked. By the time <b class="routine"><i class="routine">usrRoot</i></b><b>(&nbsp;)</b> is called, interrupts are unlocked. </p><dd><p class="Body"><a name="99296"> </a>Errors before reaching the breakpoint in <b class="routine"><i class="routine">usrRoot</i></b><b>(&nbsp;)</b> are most often caused by a stray interrupt: check that you have initialized the hardware properly in the BSP's <b class="routine"><i class="routine">sysHwInit</i></b><b>(&nbsp;)</b> routine. Once <b class="routine"><i class="routine">sysHwInit</i></b><b>(&nbsp;)</b> is working properly, you no longer need to start the agent before the kernel.</p></dl></dl><dl class="margin"><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/caution.gif"></td><td><hr><div class="CalloutCell"><a name="102598"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">CAUTION:  </font></b></a>If you are using the NetROM connection, and the agent is started before the kernel, then the agent cannot spawn the NetROM polling task to check periodically for incoming packets from the host. As a result there is no way for the host to get the agent's attention until a breakpoint occurs. On the other hand, there is no good reason to do so: you can set breakpoints in <b class="routine"><i class="routine">usrRoot</i></b><b>(&nbsp;)</b> to verify that VxWorks can get through this routine. Once this routine is working, you can start the agent after the kernel (that is, within the <b class="routine"><i class="routine">usrRoot</i></b><b>(&nbsp;)</b> routine), after which the polling task is spawned normally.</div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout><dd><p class="table" callout><table border="0" cellpadding="0" cellspacing="0"><tr valign="top"><td valign="top" width="40"><br><img border="0" alt="*" src="icons/warning.gif"></td><td><hr><div class="CalloutCell"><a name="102618"><b class="symbol_UC"><font face="Helvetica, sans-serif" size="-1" class="sans">WARNING:  </font></b></a>If you are using the serial connection, take care that your serial driver does not cause a stray interrupt when the kernel is started, because the serial-driver interrupt handlers are not installed until after <b class="routine"><i class="routine">usrRoot</i></b><b>(&nbsp;)</b> begins executing: the calling sequence is <b class="routine"><i class="routine">usrRoot</i></b><b>(&nbsp;)</b> &#135; <b class="routine"><i class="routine">sysClkConnect</i></b><b>(&nbsp;)</b> &#135; <b class="routine"><i class="routine">sysHwInit2</i></b><b>(&nbsp;)</b>&#135; <b class="routine"><i class="routine">intConnect</i></b><b>(&nbsp;)</b>. You may want to modify the driver so that it does not set a channel to interrupt mode until the hardware is initialized. This can be done by setting a flag in the BSP after serial interrupts are connected. </div></td></tr><tr valign="top"><td></td><td><hr></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p callout></dl><a name="foot"><hr></a><p class="FootnoteNumberMarker">1:&nbsp;<span class="Footnote"><a name="99227"> </a>VxWorks serial channels are numbered starting at zero. Channel 1 corresponds to the port labeled COM2<i class="term"> </i>if the board's ports are labeled starting at 1. If your board has only one serial port, you must change <b class="symbol_UC">WDB_TTY_CHANNEL</b> to 0 (zero). </span><p class="FootnoteNumberMarker">2:&nbsp;<span class="Footnote"><a name="101783"> </a>The code generator for <b class="file">prjConfig.c</b> is based on a component descriptor language that specifies when components are initialized. The component descriptors are searched in a specific order, with the project directory last in the search path. This allows the <b class="file">.cdf</b> files in the project directory to override default definitions in the generic <b class="file">.cdf</b> files.</span><p class="navbar" align="right"><a href="index.html"><img border="0" alt="[Contents]" src="icons/contents.gif"></a><a href="GuideIX.html"><img border="0" alt="[Index]" src="icons/index.gif"></a><a href="c-builder.html"><img border="0" alt="[Top]" src="icons/top.gif"></a><a href="c-builder5.html"><img border="0" alt="[Prev]" src="icons/prev.gif"></a><a href="c-buildera7.html"><img border="0" alt="[Next]" src="icons/next.gif"></a></p></body></html><!---by WRS Documentation (), Wind River Systems, Inc.    conversion tool:  Quadralay WebWorks Publisher 4.0.11    template:         CSS Template, Jan 1998 - Jefro --->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -