Changing the Configuration

In the previous step we have build the project in the default Debug configuration. While the generated elf file can be run on a simulation (which is what you normally want for debugging your application), by default no files which can be downloaded onto an actual AVR device have been generated.

So in this step of the tutorial we will build the project with the Release configuration, which by default will create the necessary files for the real hardware.

  1. Right Click on the AVRtest Project and select the Release Build Configuration




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

    The project is now build with the Release configuration. The log of the build process is shown in the Console View and should look something like this:

    **** Build of configuration Release for project AVRtest ****
    
    make all 
    Building file: ../main.c
    Invoking: AVR Compiler
    avr-gcc -Wall -Os -fpack-struct -fshort-enums -funsigned-char -funsigned-bitfields -mmcu=atmega16 
     -DF_CPU=1000000UL -MMD -MP -MF"main.d" -MT"main.d" -c -o"main.o" "../main.c"
    Finished building: ../main.c
     
    Building target: AVRtest.elf
    Invoking: AVR C Linker
    avr-gcc -Wl,-Map,AVRtest.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
     
    Create Flash image (ihex format)
    avr-objcopy -R .eeprom -O ihex AVRtest.elf  "AVRtest.hex"
    Finished building: AVRtest.hex
     
    Create eeprom image (ihex format)
    avr-objcopy -j .eeprom --no-change-warnings --change-section-lma .eeprom=0 -O ihex AVRtest.elf  "AVRtest.eep"
    Finished building: AVRtest.eep
     
    Invoking: Print Size
    avr-size --format=avr --mcu=atmega16 AVRtest.elf
    AVR Memory Usage
    ----------------
    Device: atmega16
    
    Program:     152 bytes (0.9% 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.

  3. Again, a new folder Release has appeared in your project.

    The Release folder has all the same generated files as the Debug folder, with one additional file:

    • AVRtest.hex: A hex dump file suitable for downloading to the flash memory of an AVR device.

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

     

    If the programm had contained data for the eeprom memory of the AVR device, one more file would have been created:


    • AVRtest.eep: A hex dump file suitable for downloading to the eeprom memory of an AVR device.

    But as the our very simple main.c file did not have eeprom data, no .eep file was generated, instead a error message was generated during the make process. See the next step of this tutorial on how to get rid of the error message.



Next: Customizing a Configuration

Back: Building the Project

Related Concepts

Build Configurations