2

I thought of using fully qualified absolute path name in avrdude command. But I am getting error "Invalid File Format"

I tried with following two options. But both of them does not work. Even I tried / instead of \ in path name.

  1. avrdude –C"C:\Atmega\programmers\avrdude.conf" -cusbasp -p m16u2 -v -U flash:w:"C:\Atmega\Arduino\UNO Rev3\Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex" -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0x05:m -U lock:w:0xCF:m

  2. avrdude –CC:\Atmega\programmers\avrdude.conf -cusbasp -p m16u2 -v -U flash:w:C:\Atmega\Arduino\UNO Rev3\Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0x05:m -U lock:w:0xCF:m

Mahesha Padyana
  • 431
  • 6
  • 22

1 Answers1

4

I have a similar issue. The solution is adding :i after flash address like the following:
avrdude.exe -p m32 -c usbasp -U flash:w:"C:\path to project\ouput.hex":i

It's ensure that it's 'IntelHex' format.

SAMPro
  • 1,068
  • 1
  • 15
  • 39
  • Instead of using the `i` format which forces "IntelHex", use `a` for "automatic" and `avrdude` will use the file extension to detect the correct format. This is the default behavior. Note `avrdude`'s documentation says that a format must be specified if the path contains a colon (`:`). – Cameron Tacklind Aug 14 '18 at 23:38