Bare Metal Micro

Eclipse for AVR Development

6. Flash the AVR

  1. Make sure that your Arduino is connected to your computer via USB.
  2. From the main menu, choose Run -> External Tools -> External Tools Configurations....
  3. Select Program.
  4. Press the New button to create a new configuration.
  5. Set the Name to Write Flash.
  6. Set the Location to the full path to AVRDUDE.
  7. Set the Working Directory to ${workspace_loc:/${project_name}/Debug}.
  8. Set the Arguments to:
    -c arduino -p atmega328p -U flash:w:${project_name}.hex:i -P /dev/ttyACM0
    You will need to make sure the serial port (-P) value matchs the the port of your Arduino.
  9. Press Apply.
  10. Press Run and AVRDUDE will write the HEX file to your Arduino.
  11. If all goes well you should see output simlar to this in the Console view:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    avrdude: AVR device initialized and ready to accept instructions
    
    Reading | ################################################## | 100% 0.00s
    
    avrdude: Device signature = 0x1e950f
    avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
    avrdude: erasing chip
    avrdude: reading input file "Blink.hex"
    avrdude: writing flash (176 bytes):
    
    Writing | ################################################## | 100% 0.04s
    
    avrdude: 176 bytes of flash written
    avrdude: verifying flash memory against Blink.hex:
    avrdude: load data flash data from input file Blink.hex:
    avrdude: input file Blink.hex contains 176 bytes
    avrdude: reading on-chip flash data:
    
    Reading | ################################################## | 100% 0.03s
    
    avrdude: verifying ...
    avrdude: 176 bytes of flash verified
    
    avrdude done.  Thank you.
    
  12. Your AVR should now be flashed and the LED should be blinking.