Introduction Purpose The course describes library configuration and usage in the High Performance Embedded Workshop (HEW), which speeds development of software for embedded systems. Objectives Learn the steps involved in creating a user library. Understand how libraries are used in applications. Content 4 pages Questions Learning Time 45 minutes
Library Module Collection of functions that provide useful services in an application Shared among different applications Can protect intellectual property (IP) Classified as user or system Created by the optimizing linkage editor Combines multiple object programs output by the compiler or assembler to produce a library file Generates and edits library files Deletes debugging information from library and load-module files
Re-entrancy Requirement Allows a single instance of a function to be called recursively multiple times without affecting the operation of the function Enables library to maintain portability and independence... Fn( ) Fn( ) { Fn( ) { Fn( ) { {.Fn( ).Fn( ) }.Fn( ) }.Fn( ) } } In user libraries, try to avoid using global variables or standard library functions that are not re-entrant.
Library Creation and Usage Stage Create a new library Stage Create an application that calls the library functions Stage Further modify and debug the application Clearly defined function interface pass argument Demo( ) Demo( ) Demo( ) Application Application Source Files return value Demo4( ) Demo5( ) 4 Library Files
Creating Library Space Stage Stage Stage Create a new project Settings must correspond to the intended application or device. Add the library filename Click Next 4 Click Finish 5
Adding Library Files Stage Stage Stage Select Add Files Select a source file Library source is added to directory 6
Configuring the Build Stage Stage Stage Access HEW Standard Toolchain Choose type of output Check CPU settings 7
Building the Library Stage Stage Stage Build the project Check for any build errors 8
Library Information Stage Click here Stage Stage View Library information via Librarian Interface Information about generated library can be viewed inside library listing file (*.lbp) under project directory Browse to library file View library module 9
PROPERTIES On passing, 'Finish' button: On failing, 'Finish' button: Allow user to leave quiz: User may view slides after quiz: User may attempt quiz: Goes to Next Slide Goes to Slide After user has completed quiz After passing quiz Unlimited times
Creating an Application Stage Stage Stage Create new project Option settings Device settings Library settings and device settings in your program must match. Stages and use different workspaces and their settings must be compatible when the workspaces are interfaced. Click Finish 4
Adding Source Code Stage Stage Stage Add other source file Or type in your code All library function prototypes must be defined and function names must correspond to the library contents.
Library Linkage Stage Stage Stage Click Add Browse to add user library Click OK
Building/Setting Debugger Stage Stage Stage Click Build All Set debug settings Correct errors, if any Application program needs only clearly defined function prototype interfaces to know what functions are available in the libraries. 4 4 Click OK
Application Debugging Stage Stage Stage Download module Add watch window Add breakpoint 5
Executing Application Stage Stage Stage Select Reset Go 4 Step Over one by one 5 Check results 6
PROPERTIES On passing, 'Finish' button: On failing, 'Finish' button: Allow user to leave quiz: User may view slides after quiz: User may attempt quiz: Goes to Next Slide Goes to Slide After user has completed quiz After passing quiz Unlimited times
Further Development Stage Stage Stage Insert a project Click OK 4 Check configuration Library project added 8
Modifying Code Stage Stage Stage New library function 9
Adding a New Call Stage Stage Stage Set current project New call added to library Remember to add library function s prototype into application source file. 0
Further Debugging Stage Stage Stage Check results
Project Dependency Stage Stage Stage Select Dependent Projects Select User Library Click OK 4 Dependent added 5 Dependents are built first
PROPERTIES On passing, 'Finish' button: On failing, 'Finish' button: Allow user to leave quiz: User may view slides after quiz: User may attempt quiz: Goes to Next Slide Goes to Slide After user has completed quiz After passing quiz Unlimited times
Course Summary Creating library module with different functions Adding library calls in an application Modifying and debugging library module within the application Download a free evaluation copy of HEW at: www.renesas.com/hew 4