avrdude Apple

Hello,

I need to send to of my client using a Macintosh a HEX file generated by my PDE project under IDE 22 (I don't want to give him the PDE's source files) but I can't fully figure out how to directly download a HEX file to my arduino mega from my Mac Terminal shell.

If one of you be kind correct me what script command is incorrect below...

Thank you in advance, Albert

Please find a copy of the shell launch and errors.

new-host-5:~ selfonlypath$ /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega1280 -carduino -P/dev/tty.usbserial -b57600 -D -Uflash:w:/Desktop/TransVerter1.cpp.hex:i

avrdude: Version 5.4-arduino, compiled on Oct  9 2007 at 11:20:31
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/selfonlypath/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping


avrdude: Can't find programmer id "arduino"

Valid programmers are:
  dasa3    = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:582]
  dasa     = serial port banging, reset=rts sck=dtr mosi=txd miso=cts [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:569]
  siprog   = Lancos SI-Prog <http://www.lancos.com/siprogsch.html> [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:556]
  ponyser  = design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:543]
  pavr     = Jason Kyle's pAVR Serial Programmer [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:514]
  dragon_dw = Atmel AVR Dragon in debugWire mode [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:507]
  dragon_hvsp = Atmel AVR Dragon in HVSP mode  [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:499]
  dragon_pp = Atmel AVR Dragon in PP mode    [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:491]
  dragon_isp = Atmel AVR Dragon in ISP mode   [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:483]
  dragon_jtag = Atmel AVR Dragon in JTAG mode  [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:475]
  jtag2dw  = Atmel JTAG ICE mkII in debugWire mode [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:467]
  jtag2isp = Atmel JTAG ICE mkII in ISP mode [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:459]
  jtag2    = Atmel JTAG ICE mkII            [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:451]
  jtag2fast = Atmel JTAG ICE mkII            [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:443]
  jtag2slow = Atmel JTAG ICE mkII            [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:435]
  jtagmkII = Atmel JTAG ICE mkII            [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:427]
  jtag1slow = Atmel JTAG ICE (mkI)           [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:420]
  jtag1    = Atmel JTAG ICE (mkI)           [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:412]
  jtagmkI  = Atmel JTAG ICE (mkI)           [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:404]
  avr911   = Atmel AppNote AVR911 AVROSP    [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:398]
  avr109   = Atmel AppNote AVR109 Boot Loader [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:392]
  butterfly = Atmel Butterfly Development Board [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:386]
  usbtiny  = USBtiny simple USB programmer  [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:380]
  usbasp   = USBasp, http://www.fischl.de/usbasp/ [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:374]
  avr910   = Atmel Low Cost Serial Programmer [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:368]
  stk500hvsp = Atmel STK500 V2 in high-voltage serial programming mode [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:362]
  stk500pp = Atmel STK500 V2 in parallel programming mode [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:356]
  stk500v2 = Atmel STK500 Version 2.x firmware [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:350]
  stk500v1 = Atmel STK500 Version 1.x firmware [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:344]
  stk500   = Atmel STK500                   [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:338]
  avrisp2  = Atmel AVR ISP mkII             [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:328]
  avrispmkII = Atmel AVR ISP mkII             [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:322]
  avrispv2 = Atmel AVR ISP V2               [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:316]
  avrisp   = Atmel AVR ISP                  [/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf:310]

new-host-5:~ selfonlypath$
  1. Do yourself a favor and get CrossPack. It contains everything you'll need for AVR dev in a single package. In addition, you will be able to invoke avrdude just by typing "avrdude." No long paths.

  2. Your actual problem: try doing -c avrisp

baum

Many thanks Baum,

Your code -c avrisp solved the problem but if you look below, it says to not be able to open my HEX file eventhough it is really there ?

Here is the extract

avrdude: Send: V [56] . [a0] . [0f] . [ff] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: reading input file "/Documents/TV/TransVerter1/applet/TransVerter1.cpp.hex"
avrdude: can't open input file /Documents/TV/TransVerter1/applet/TransVerter1.cpp.hex: No such file or directory
avrdude: write to file '/Documents/TV/TransVerter1/applet/TransVerter1.cpp.hex' failed

avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]

then later at the end, it says

avrdude: safemode read 1, efuse value: 0
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: safemode read 2, efuse value: 0
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [00] 
avrdude: Recv: . [10] 
avrdude: safemode read 3, efuse value: 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK
avrdude: Send: Q [51]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 

avrdude done.  Thank you.

new-host-5:~ selfonlypath$

Albert

Try putting your hex file somewhere else, like the desktop.

Also, try doing stk500v1 instead of avrisp.

I've tried with sdk500v1 and avrisp, each case the HEX file in desktop... unfortunately it still can't find the file & fails the complete download

Try installing avrdude fresh w/ crosspack.

Ok i'll install & practice but later crosspack for mac but right now, i need to provide my client an easy avrude method to download on his arduino mega my HEX file having in mind he has never done any arduino !

I'm new to all this avrdude, avr,... but wonder if it might not be linked to this isssue http://arduino.cc/forum/index.php/topic,24824.0.html

I'd try that, seeing as you are using a bootloader. If that doesn't work, you may need to wipe the chip clean and just do a regular upload... the bloader may be causing problems.

baum

It is getting harder for me to follow you.

OK, I've just downloaded Crosspack per your suggestion, please be kind tell me how I can via Crosspack directly download my HEX file (generated by IDE 17) towards my arduino mega ?

Thank you in advance, Albert

Sorry about that...

It looks like you can't use plain old avrdude if you have the bootloader (according to that forum thread you posted). So try the binary given on that thread. If you need a client to do it, then it is probably best NOT to use crosspack... it is a big download.

baum

Please note that I'm using IDE 17 because it easier to locate the HEX file (applet folder) whereas starting from IDE18, it is really more difficult to locate the HEX file in particular with Snow Leopard OS !

My objective is to send my HEX file to my client who wants a demo of my technology but I don't want give him my source PDE. He has Mac but just bought an arduino mega so I need find an easy process so he does download my HEX file prior I come visit him !

Is this any help?
http://www.arduino.cc/playground/Learning/CommandLine

well unless there is so specific to avrdude provided by arduino, I think the problem is maybe related to my MacBook Air running with Snow Leopard... After all, it says it can't open the HEX file which does exists and the other steps of avdrude do work fine. Again hoping someone can help, here is the shell extract

new-host-5:~ selfonlypath$ /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -F -v -patmega1280 -cstk500 -P/dev/tty.usbserial-A6008igj -b57600 -D -Uflash:w:/Documents/TV/TransVerter1/applet/TransVerter1.hex:i

avrdude: Version 5.4-arduino, compiled on Oct 9 2007 at 11:20:31
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
User configuration file is "/Users/selfonlypath/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/tty.usbserial-A6008igj
Using Programmer : stk500
Overriding Baud Rate : 57600
avrdude: successfully opened stk500v1 device -- please use -c stk500v1
AVR Part : ATMEGA1280
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 10 8 0 no 4096 8 0 9000 9000 0x00 0x00
flash 65 10 256 0 yes 131072 256 512 4500 4500 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : STK500
Description : Atmel STK500
Hardware Version: 2
Firmware Version: 1.16
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9703
avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: reading input file "/Documents/TV/TransVerter1/applet/TransVerter1.hex"
avrdude: can't open input file /Documents/TV/TransVerter1/applet/TransVerter1.hex: No such file or directory
avrdude: write to file '/Documents/TV/TransVerter1/applet/TransVerter1.hex' failed

avrdude: safemode: lfuse reads as 0
avrdude: safemode: hfuse reads as 0
avrdude: safemode: efuse reads as 0
avrdude: safemode: Fuses OK

avrdude done. Thank you.

new-host-5:~ selfonlypath$

Try:

Users/selfonlypath/Documents/TV/TransVerter1/applet/TransVerter1.hex:i

That's the actual path to your file, I believe.

Hi Emily... This path you suggest does not work either =(

selfonlypath:
Hi Emily... This path you suggest does not work either =(

You know you can just drag the file from the Finder into your Terminal window and it will automatically write the correct path? Try that.

oups Emily... YES it works... your suggested path works.... MANY THX XD

selfonlypath:
oups Emily... YES it works... your suggested path works.... MANY THX XD

Yay! You're welcome! You don't normally have to include the path to avrdude or the path to avrdude.conf if you want to save yourself some typing.

I've tried to simplify below line as per suggestion but it says a few things: cannot find conf file then it invokes another avrdude that times out so I guess better I keep this longer typing line

new-host-5:~ selfonlypath$ /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -F -v -patmega1280 -cstk500 -P/dev/tty.usbserial-A6008igj -b57600 -D -Uflash:w:/Users/selfonlypath/Documents/TV/TransVerter1/applet/TransVerter1.cpp.hex:i

selfonlypath:
I've tried to simplify below line as per suggestion but it says a few things: cannot find conf file then it invokes another avrdude that times out so I guess better I keep this longer typing line

new-host-5:~ selfonlypath$ /Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -F -v -patmega1280 -cstk500 -P/dev/tty.usbserial-A6008igj -b57600 -D -Uflash:w:/Users/selfonlypath/Documents/TV/TransVerter1/applet/TransVerter1.cpp.hex:i

Yep, best keep doing what works! :slight_smile: