Pages: [1]   Go Down
Author Topic: Problems with avrdude  (Read 1600 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I've followed the instructions here and  here. If I try to upload a simple program to the arduino board I get the following error

Code:
java.io.IOException: Cannot run program "hardware/tools/avrdude -F ": java.io.IOException: error=2, No such file or directory
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
      at java.lang.Runtime.exec(Runtime.java:593)
      at java.lang.Runtime.exec(Runtime.java:466)
      at processing.app.Uploader.executeUploadCommand(Uploader.java:123)
      at processing.app.AvrdudeUploader.avrdude(AvrdudeUploader.java:162)
      at processing.app.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:71)
      at processing.app.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:43)
      at processing.app.Sketch.upload(Sketch.java:1632)
      at processing.app.Sketch.exportApplet(Sketch.java:1701)
      at processing.app.Editor$41.run(Editor.java:2004)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
      at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
      at java.lang.ProcessImpl.start(ProcessImpl.java:65)
      at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)
      ... 17 more

The symlink is correct.

Code:
prefect tools # ls -ll
total 396
lrwxrwxrwx 1 root    root      16 May  5 12:42 avrdude -> /usr/bin/avrdude
-rw-r--r-- 1 michael users 399492 May  5 10:12 avrdude.conf

and

Code:
prefect arduino # ls -ll
total 28
-rwxr-xr-x 1 michael users  511 May  5 10:12 arduino
drwxr-xr-x 3 michael users 4096 May  5 10:12 classes
drwxr-xr-x 6 michael users 4096 May  5 10:12 examples
drwxr-xr-x 7 michael users 4096 May  5 10:12 hardware
lrwxrwxrwx 1 root    root    38 May  5 10:15 ldscripts -> /usr/lib64/binutils/avr/2.18/ldscripts
drwxr-xr-x 4 michael users 4096 May  5 10:12 lib
drwxr-xr-x 2 michael users 4096 Jan 22 23:07 reference
drwxr-xr-x 5 michael users 4096 May  5 10:12 sketchbook

Ideas?

Regards,
 Michael
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you post the source to function in AvrdudeUploader.java that you changed?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Can you post the source to function in AvrdudeUploader.java that you changed?

Here we go:

Code:
public boolean avrdude(Collection params) throws RunnerException {
    List commandDownloader = new ArrayList();
    commandDownloader.add("avrdude -F ");

    // Point avrdude at its config file since it's in a non-standard location.
    if(Base.isMacOS()) {
      commandDownloader.add("-C" + "hardware/tools/avr/etc/avrdude.conf");
    }
    else if(Base.isWindows()) {
      String userdir = System.getProperty("user.dir") + File.separator;
      commandDownloader.add("-C" + userdir + "hardware/tools/avr/etc/avrdude.conf");
    } else {
      // ???: is it better to have Linux users install avrdude themselves, in
      // a way that it can find its own configuration file?
      commandDownloader.add("-C" + "hardware/tools/avrdude.conf");
    }

    if (Preferences.getBoolean("upload.verbose")) {
      commandDownloader.add("-v");
      commandDownloader.add("-v");
      commandDownloader.add("-v");
      commandDownloader.add("-v");
    } else {
      commandDownloader.add("-q");
      commandDownloader.add("-q");
    }
    // XXX: quick hack to chop the "atmega" off of "atmega8" and "atmega168",
    // then shove an "m" at the beginning.  won't work for attiny's, etc.
    commandDownloader.add("-pm" +
      Preferences.get("boards." + Preferences.get("board") + ".build.mcu").substring(6));
    commandDownloader.add("-F");
    commandDownloader.addAll(params);

    return executeUploadCommand(commandDownloader);
  }
}

I've inserted only the line commandDownloader.add("-F");  like the entry in the forum recommends.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Change: commandDownloader.add("avrdude -F ");
to:  commandDownloader.add("avrdude");
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm a bit confused. I've changed the line from commandDownloader.add("avrdude -F ") to commandDownloader.add("avrdude") but I still get the same error. I've removed the work directory and created a new one by executing ./make.sh - Is there some kind of "make clean" available or a place where I can delete old *.class files? I don't have a explanation for this behavior of the code.
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't think there are compiled files outside of the work/ directory, but you might look around for .class files.  You don't have any spaces around avrdude inside the quotes, do you?  Are you sure you edited the right .java file?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I get a new error:

Code:
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.

I've followed the instructions again and just wrote add("-F') and now I get a

Code:
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA168 is 1E 94 06

Suggestions?

Regards, Michael
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I don't think there are compiled files outside of the work/ directory, but you might look around for .class files.  You don't have any spaces around avrdude inside the quotes, do you?  Are you sure you edited the right .java file?

It was the right java file, but the wrong line.  :-/
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you leave this line in?

commandDownloader.add("-F");

Try moving it earlier in the function.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've moved the line to the beginning of the function, but nothing changed.

Code:
public boolean avrdude(Collection params) throws RunnerException {
    List commandDownloader = new ArrayList();
    commandDownloader.add("avrdude");
   commandDownloader.add("-F");
    // Point avrdude at its config file since it's in a non-standard location.
    if(Base.isMacOS()) {
      commandDownloader.add("-C" + "hardware/tools/avr/etc/avrdude.conf");
    }
    else if(Base.isWindows()) {
      String userdir = System.getProperty("user.dir") + File.separator;
      commandDownloader.add("-C" + userdir + "hardware/tools/avr/etc/avrdude.conf");
    } else {
      // ???: is it better to have Linux users install avrdude themselves, in
Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Huh.  Can you set upload.verbose to true in your Arduino preferences file (http://www.arduino.cc/en/Hacking/Preferences) and then try again and post the messages you get?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 11
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Huh.  Can you set upload.verbose to true in your Arduino preferences file (http://www.arduino.cc/en/Hacking/Preferences) and then try again and post the messages you get?

Yepp. Now I get a "Wrong microcontroller found. Did you select the right board ..."

Code:
Binary sketch size: 1124 bytes (of a 14336 byte maximum)
hardware/tools/avrdude -F -Chardware/tools/avrdude.conf -v -v -v -v -pm168 -cstk500v1 -P/dev/ttyUSB0 -b19200 -D -Uflash:w:/home/michael/sketchbook/sketch_080505a/applet/sketch_080505a.hex:i


avrdude: Version 5.5, compiled on May  5 2008 at 09:42:10
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "hardware/tools/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port            : /dev/ttyUSB0
         Using Programmer      : stk500v1
         Overriding Baud Rate  : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
         AVR Part              : ATMEGA168
         Chip Erase delay      : 9000 us
         PAGEL                 : PD7
         BS2                   : PC2
         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     5     4    0 no        512    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     16384  128    128  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [02]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [81]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [01]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [98]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [03]
avrdude: Recv: . [10]
         Hardware Version: 2
         Firmware Version: 1.16
avrdude: Send: A [41] . [84]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [85]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send:
« Last Edit: May 11, 2008, 01:58:24 pm by rattentod » Logged

Forum Administrator
Cambridge, MA
Offline Offline
Faraday Member
*****
Karma: 11
Posts: 3538
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Dunno, the -F should override that.  Maybe trying moving it around?  You could try various commands on the command line before editing and recompiling the IDE.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Yepp. Now I get a "Wrong microcontroller found. Did you select the right board ..."
I got that same error after upgrading from Arduino-0009 to Arduino-0011. My workaround was to replace arduino-0011/hardware/tools/avrdude with a shell script:
Code:
#!/bin/sh
/usr/bin/avrdude -F $*
Not exactly safe&clean, but that did the trick.
Logged

Pages: [1]   Go Up
Jump to: