11.07.2015 Views

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

Imagecraft c compiler and development environment for the atmel avr

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.

ICCV8 <strong>for</strong> AVR – C Compiler <strong>for</strong> Atmel AVRLibrarianA library is a collection of object files in a special <strong>for</strong>m that <strong>the</strong> linker underst<strong>and</strong>s.When a library's component object file is referenced by your program directly orindirectly, <strong>the</strong> linker pulls out <strong>the</strong> library code <strong>and</strong> links it to your program. Thest<strong>and</strong>ard supplied library is libc<strong>avr</strong>.a, which contains <strong>the</strong> st<strong>and</strong>ard C <strong>and</strong> AtmelAVR specific functions.There are times where you need to modify or create libraries. A comm<strong>and</strong>-line toolcalled ilibw.exe is provided <strong>for</strong> this purpose. You can also create a library projectusing <strong>the</strong> IDE if you have <strong>the</strong> ADVANCED or PROFESSIONAL version of <strong>the</strong><strong>compiler</strong>. See Menu Reference: Build Options - Project.Note that a library file must have <strong>the</strong> .a extension. See Linker Operations.Compiling a File into a Library ModuleEach library module is simply an object file. There<strong>for</strong>e, to create a library module, youneed to compile a source file into an object file. The ADVANCED <strong>and</strong>PROFESSIONAL versions allow you to build library project using <strong>the</strong> IDE. O<strong>the</strong>rwise,you will need to use <strong>the</strong> comm<strong>and</strong> line tool to compile <strong>the</strong> files <strong>and</strong> buid <strong>the</strong> libraryusing comm<strong>and</strong> line tools.Listing <strong>the</strong> Contents of a LibraryOn a comm<strong>and</strong> prompt window, change <strong>the</strong> directory to where <strong>the</strong> library is, <strong>and</strong> give<strong>the</strong> comm<strong>and</strong> ilibw.exe -t . For example,ilibw.exe -t libc<strong>avr</strong>.aAdding or Replacing a ModuleTo add or replace a module:1. Compile <strong>the</strong> source file into an object module.2. Copy <strong>the</strong> library into <strong>the</strong> work directory.3. Use <strong>the</strong> comm<strong>and</strong> ilibw.exe -a to add or replace amodule.For example, <strong>the</strong> following replaces <strong>the</strong> putchar function in libc<strong>avr</strong>.a with yourversion.cd c:\iccv8<strong>avr</strong>\libsrc.<strong>avr</strong>200

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

Saved successfully!

Ooh no, something went wrong!