Building the Project

Once we have created a project and populated it with a sample C file, it can now be build.

  1. Check that the automatic build option is turned off. Otherwise the complete project is rebuild everytime a source file is saved which might take some time (depending on project size and processor speed).




  2. Right click on the AVRtest Project in the Project Explorer and select Build Project.

    The project is build with Debug configuration (which is the default configuration). The log of the build process is shown in the Console View and should look something like this:
    **** Build of configuration Debug for project AVRtest ****
    make all
    Building file: ../main.c
    Invoking: AVR GCC Compiler
    avr-gcc -Wall -g -O0 -c -mmcu=atmega16 -DF_CPU=1000000 -o"main.o" "../main.c"
    Finished building: ../main.c
      
    Building target: AVRtest.elf
    Invoking: AVR Linker
    avr-gcc -Wl,-Map,.map -mmcu=atmega16 -o"AVRtest.elf"  ./main.o
    Finished building target: AVRtest.elf
        
    Invoking: AVR Create Extended Listing
    avr-objdump -h -S AVRtest.elf  >"AVRtest.lss"
    Finished building: AVRtest.lss
        
    Invoking: AVR Print Size
    avr-size --format=avr --mcu=atmega16 AVRtest.elf
    AVR Memory Usage
    ----------------
    Device: atmega16
    Program:     160 bytes (1.0% Full)
    (.text + .data + .bootloader)
    Data:          0 bytes (0.0% Full)
    (.data + .bss + .noinit)
      
    Finished building: sizedummy
    Note: The format option --format=avr for the AVR Print Size tool is not available on all platforms (winAVR does support it). On these platforms an error message about an unknown format option might be displayed.

  3. Within your project folder two new folders have appeared, Binaries and Debug.

    The Debug folder contains all generated files:

    • makefile: a makefile automatically generated by the build process.
    • *.mk: Automatically generated files required for the build process.
    • main.o: Object file containing the compiled code from main.c-
    • AVRtest.lss: A text file with a mixture of the original C source with the assembler output from the compiler.
    • AVRtest.elf: ELF format file containing the compiled application. This file can be used for most available AVR Simulators (like simulavr).

    The (virtual) folder Binaries contains a link to the generated elf file in the Debug folder.


Next: Changing the Build Configuration

Back: Creating a sample AVR C file