02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3<br />

Creating a New <strong>BSP</strong><br />

To find the source of the interrupt, start by figuring out the interrupt vector being<br />

generated, applying any of the following techniques:<br />

■<br />

■<br />

■<br />

Use a logic analyzer to look for instruction accesses to the interrupt vector<br />

table.<br />

Use an ICE to set breakpoints in the interrupt vector table.<br />

Modify sysHwInit( ) to mask suspected interrupt vectors via an interrupt<br />

controller.<br />

■<br />

Modify sysHwInit( ) to connect debug routines to the suspected interrupt<br />

vectors using intVecSet( ) (you cannot use intConnect( ) because it calls<br />

malloc( ) and the VxWorks memory allocator has not yet been initialized).<br />

At this point you have a working kernel, but no device drivers. The only drivers<br />

required by VxWorks is a timer and possibly an interrupt controller. Most <strong>BSP</strong>s<br />

also have serial drivers. Adding basic driver support to VxWorks is described in<br />

3.4 Using a Minimal Kernel, p.55.<br />

3<br />

3.3.4 Starting the WDB Agent Before the Kernel<br />

NOTE: This procedure applies only to images built from the command line.<br />

This step is optional and is rarely done at Wind River when creating a new <strong>BSP</strong>. The<br />

disadvantages to starting the agent before the kernel are:<br />

■<br />

■<br />

Once the hardware initialization code is written, bringing up the kernel takes<br />

less time than bringing up the agent. Because most developers consider a<br />

working kernel to be the bigger milestone, start with the kernel.<br />

Starting the agent before the kernel does not really help get the basic kernel<br />

working. This is because the basic kernel adds little to what you have written<br />

already; just a timer driver and possibly an interrupt controller, which are<br />

simple devices.<br />

■<br />

Starting the agent before the kernel limits you to system mode debugging.<br />

The only reason to start the agent early is if you have a very slow download<br />

environment. In that case, you may want to put everything in ROM as early as<br />

possible to save download cycles.<br />

Starting the agent before the kernel is described in Tornado User’s <strong>Guide</strong>: Setup and<br />

Startup. The following two sections provide important additional information.<br />

53

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

Saved successfully!

Ooh no, something went wrong!