02.03.2014 Views

Tornado

Tornado

Tornado

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4<br />

Projects<br />

In some cases (for example, if you are doing a BSP port for the first time), you may<br />

want to start the agent before the kernel starts, and initialize the kernel under the<br />

control of the <strong>Tornado</strong> host tools. To make that change, perform the following steps<br />

when you configure VxWorks:<br />

1. Choose a communication path that can support a system-mode agent<br />

(NetROM or raw serial). The END communication path cannot be used as it<br />

requires the system be started before it is initialized.<br />

2. Change your configuration so that only WDB system debugging is selected (in<br />

folder path development tool components>WDB agent components>select WDB<br />

mode). By default, the task mode starts two agents: a system-mode agent and<br />

a task-mode agent. Both agents begin executing at the same time, but the taskmode<br />

agent requires the kernel to be running.<br />

3. Create a configuration descriptor file called fileName.cdf (for example,<br />

wdb.cdf) in your project directory that contains the following lines:<br />

4<br />

InitGroup usrWdbInit {<br />

INIT_RTN usrWdbInit (); wdbSystemSuspend ();<br />

_INIT_ORDER usrInit<br />

INIT_BEFORE INCLUDE_KERNEL<br />

}<br />

This causes the project code generator to make the usrWdbInit( )call earlier in<br />

the initialization sequence. It will be called from usrInit( ), just before the<br />

component kernel is started. 8<br />

After the target server connects to the system-mode target agent, you can resume<br />

the system to start the kernel under the agent’s control. (See 5.2.6 Using the Shell for<br />

System Mode Debugging, p.170 for information on using system mode from the<br />

shell, and 7.5 System-Mode Debugging, p.261 for information on using it from the<br />

debugger.<br />

After connecting to the target agent, set a breakpoint in usrRoot( ), then continue<br />

the system. The routine kernelInit( )starts the multi-tasking kernel with usrRoot( )<br />

as the entry point for the first task. Before kernelInit( )is called, interrupts are still<br />

locked. By the time usrRoot( ) is called, interrupts are unlocked.<br />

Errors before reaching the breakpoint in usrRoot( ) are most often caused by a<br />

stray interrupt: check that you have initialized the hardware properly in the BSP’s<br />

8. The code generator for prjConfig.c is based on a component descriptor language that specifies<br />

when components are initialized. The component descriptors are searched in a specific<br />

order, with the project directory last in the search path. This allows the .cdf files in the<br />

project directory to override default definitions in the generic .cdf files.<br />

143

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!