OSK5912 Board Support Library
The Board Support Library (BSL) provides a C-language interface for configuring and controlling all on-board devices. The library consists of discrete modules that are built and archived into a library file. Each module represents an individual Application Program Interface (API) and is referred to simply as an API module. The module granularity is structured so each device is implemented in an individual API module. The goal of the BSL is to provide a level of hardware abstraction and software standardization that improves development time and portability.
The BSL contains the following modules:
Using the BSL
To use the BSL:
Link the BSL in with your code.
Reference the appropriate include files for each module (see the API descriptions for each function’s requirements).
Call the functions themselves, starting with OSK5912_init().
The libraries and include files reside in the include and lib directories of the OSK5912 example directory.
Libraries and include files
The version of Code Composer that comes with the OSK5912 automatically includes the lib and include paths above so you don’t need to manually include them in the search paths. To include the OSK5912bsl.lib file for example, select Project -> Build Options on the Linker tab type OSK5912bsl.lib in the "Include Libraries" field.
If you choose to specify your search paths, the library search path is specified on the same tab as the library file and the include search path is specified by selecting Project -> Build Options, and setting the "Include Search Path" field in the preprocessor section of the compiler tab.
Customizing the BSL
The BSL source code is available in the lib directory along with the library itself. You may extend or modify the source code and build your own version of the library. You can also include the BSL source files directly into your application for greater control. One useful technique while debugging is to use Code Composer’s ability to open multiple projects simultaneously to open both your application and the BSL at the same time. The debugger will treat the BSL almost as if the source code for both projects were actually part of the same project.
Project checklist
The following are things to check when creating your own project:
GEL File - Make sure the gel (osk5912.gel) file is included in your project.
Linker Command File Included - Make sure the linker command ( *.cmd) file is included in your project.
Endian Mode is Consistent - The endian mode settings must be consistent in each place it is set. It is set in the project options by selecting Project -> Build Options and viewing the Compiler tab under the Advanced Section. Typically, little endian mode should be used on the OSK5912.
BSL Library Included - Make sure the correct BSL library is included. The BSL library should be specified by selecting Project -> Add Files to Project for the file path you can type or search for
c:\ti\boards\osk5912\lib\osk5912bsl.lib
Include Paths are Set - If you can’t see header (.h) files that your program uses, make sure you have the paths set correctly in Project -> Build Options on the Compiler tab under the Preprocessor Section “Include Search Path” field. If you can’t see header files in the same directory as your project, add a . to your search path. To include multiple paths, place a semicolon between paths, for example:
.;c:\ti\boards\osk5912\include
includes both the project directory and the BSL include directory.
C Runtime Library Included - The TI C Runtime Library allows the use of printf( ) statements and other common C functions. The C Runtime library should be specified by selecting Project -> Add Files to Project for the file path you can type or search for
c:\ti\TMS470\cgtools\lib\rts32e.lib
Note: This is optional if you require the uses of printf( ) statements, or other common C functions.
|