User`s guide
VxWorks
BSP Developer’s Guide, 6.0
66
mistake in BSP development is the failure to ensure that all interrupt sources are
quiescent prior to enabling interrupts. If this is not done before the call to
kernelInit( ), the system typically hangs or fails, causing confusion for the BSP
developer because the source of the problem is not obvious.
If kernelInit( ) is called but execution fails to reach the start of usrRoot( ), or if the
system behaves erratically in other ways after the call to kernelInit( ), usually it is
one of two problems. Either sysMemTop( ) is returning a bad address or, more
likely, some device has not been reset and is generating an interrupt. In the latter
case, you must modify sysHwInit( ) to reset the interrupting device.
To find the source of the interrupt, start by figuring out the interrupt vector being
generated, applying any of the following techniques:
■
Use a logic analyzer to look for instruction accesses to the interrupt vector
table.
■
Use an OCD device to set breakpoints in the interrupt vector table.
■
Modify sysHwInit( ) to mask suspected interrupt vectors through an interrupt
controller.
■
Modify sysHwInit( ) to connect debugging routines to the suspected interrupt
vectors using intVecSet( ) (you cannot use intConnect( ) because it calls
malloc( ) and the VxWorks memory allocator is not yet initialized).
usrConfig.c: usrRoot( )
The remainder of the VxWorks initialization is done after the kernel is started in
usrRoot( ). The details of the initialization process are covered in subsequent
sections. In this phase, it is enough for usrRoot( ) to verify that sysHwInit( ) is
properly written.
At this point, you have a working kernel but no device drivers. The only drivers
required by VxWorks are a timer and possibly an interrupt controller. Most BSPs
also have serial drivers.
3.2.5 Starting the WDB Agent Before the Kernel
This step is optional when creating a new BSP and is rarely performed. However,
if you have a slow download environment, you may want to put everything in
NOTE: This procedure applies only to images built from the command line.