02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

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.

VxWorks 5.5<br />

<strong>BSP</strong> Developer’s <strong>Guide</strong><br />

information on configuring the agent and the agent’s initialization sequence, see<br />

the Tornado User’s <strong>Guide</strong>: Setup and Startup.<br />

If the INCLUDE_USR_APPL is defined, the code executes the USER_APPL_INIT<br />

macro. However, you must make sure the USER_APPL_INIT macro is a valid C<br />

statement.<br />

2.4 Mistakes To Be Avoided<br />

Most of the mistakes listed below could be summarized as doing the right thing in<br />

the wrong place or at the wrong time. Context matters.<br />

Forgetting About LOCAL_MEM_LOCAL_ADRS<br />

Many <strong>BSP</strong> writers assume that LOCAL_MEM_LOCAL_ADRS is zero and fail to<br />

include it in macros that need to be offset by the start of memory. Most users do not<br />

change the value of LOCAL_MEM_LOCAL_ADRS, but this problem tends to be<br />

copied and replicated throughout development projects.<br />

Doing Too Much in romInit.s<br />

Many <strong>BSP</strong> writers try to put too much device initialization code into romInit.s. Use<br />

the initialization in romInit.s as just a preliminary step. Handle the real device<br />

initialization in sysHwInit( ) in sysLib.c. See romInit.s: romInit( ), p.33.<br />

Doing Too Little in sysALib.s<br />

Many <strong>BSP</strong> writers believe that any initialization done in romInit.s only needs to be<br />

done once. The routine sysInit( ), in sysALib.s, should repeat all initialization<br />

done by romInit.s. It may skip memory controller setup in some situations. Failure<br />

to do this requires users to rebuild boot ROMs for simple configuration changes in<br />

their VxWorks images. See sysALib.s: sysInit( ), p.34.<br />

Modified Drivers Put in the Wrong Directory<br />

<strong>BSP</strong> writers frequently modify Wind River device drivers, as well as provide their<br />

own drivers. These <strong>BSP</strong>-specific drivers must be delivered in <strong>BSP</strong>-specific<br />

directories and not in the Wind River directories target/src/drv and target/h/drv.<br />

<strong>BSP</strong>-specific code belongs in the <strong>BSP</strong>-specific directory target/config/bspname. This<br />

38

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

Saved successfully!

Ooh no, something went wrong!