Pages: [1] 2   Go Down
Author Topic: mega 2560 R3 - no device present. make: *** [dfu] Error 1  (Read 3946 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hello folks.

first post here and first time holding something called "arduino" in my hands.

so. just finished soldering my project. i´m about to build my own chronome

http://flipmu.com/work/chronome/

and can´t figure out what i´m missing here.

here is what i´m have done so far:

http://flipmu.com/work/chronome/changing-the-serial-number/

had no problems thru steps 1-12

now, when putting (or actually trying to put) my mega 2560 R3 into DFU Mode, i get following results.
there is a little yellow LED which blinks just another couple of times after released the green pads (see pic in link) and then turns off.

open up arduino, tools/serial ports -> my arduino is no longer is the device list, which is a good sign that my 2560 is in dfu mode.

now, when typing in termial:

sudo make dfu

i get this result:
dfu-programmer at90usb82 erase
dfu-programmer: no device present.
make: *** [dfu] Error 1

what am i doing wrong?

any help highly appreciated.

greetings to all.




* pic arduino.tiff (862.61 KB, 1280x800 - viewed 146 times.)
* terminal message.rtf (46.02 KB - downloaded 17 times.)
Logged

Austin, TX
Offline Offline
God Member
*****
Karma: 12
Posts: 524
carpe diem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Mega 2560 R3 uses the Atmega16u2 for serial conversion.

You will need to update the dfu programmer to recognize the Atmega16u2 part.

The following post discusses the steps to patch the dfu programmer:
http://arduino.cc/forum/index.php/topic,92148.msg692355.html#msg692355
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi louis,

thanks for the quick help.

just downloaded libusb-1.0.8 from here

http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.8/libusb-1.0.8.tar.bz2/download.

after typing in terminal

./configure

i get this error:



Claudio-Battistas-MacBook-Pro:libusb-1.0.8 claudiobattista$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/claudiobattista/chronome/libusb-1.0.8':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
Claudio-Battistas-MacBook-Pro:libusb-1.0.8 claudiobattista$

?

« Last Edit: April 04, 2012, 03:22:58 pm by monoaural » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi louis,

o.k lets go on step back.

i think @dhunt has the solution

"...


Ah yes, dfu-programmer 0.5.4 does not know about the atmega16u2 and the developers don't seem to have updated it yet.

Download the dfu-programmer source from http://sourceforge.net/projects/dfu-programmer/files, apply the attached patch and build your own:
Code:
tar xzf ~/Downloads/dfu-programmer-0.5.4.tar.gz
cd dfu-programmer-0.5.4
patch -p0 < ~/Downloads/atmega16u2.diff

# Make sure you have the tools needed to build it
sudo apt-get install build-essential libusb-1.0-0-dev

# configure and build it
./bootstrap.sh
./configure
make

# install it
sudo make install

"""

this is the error i get when trying to install libusb:

Claudio-MacBook-Pro:dfu-programmer-0.5.4 claudiobattista$ sudo apt-get install build-essential libusb-1.0-0-dev
Password:
sudo: apt-get: command not found


seems like i dont have the tool i need?!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi louis,

when trying to follow @dhunts suggestion i get this error

Claudio-MacBook-Pro:dfu-programmer-0.5.4 claudiobattista$ patch -p0 < ~/Downloads/atmega16u2.diff
patching file src/arguments.c
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file src/arguments.c.rej
patching file src/arguments.h
Reversed (or previously applied) patch detected!  Assume -R? [n] n
Apply anyway? [n] n
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file src/arguments.h.rej


Claudio-MacBook-Pro:dfu-programmer-0.5.4 claudiobattista$ sudo apt-get install build-essential libusb-1.0-0-dev
Password:
sudo: apt-get: command not found


???
« Last Edit: April 05, 2012, 11:36:13 am by monoaural » Logged

Austin, TX
Offline Offline
God Member
*****
Karma: 12
Posts: 524
carpe diem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I suggest you follow the steps that @dhunt suggests further down in the thread.
@dhunt used macports as the package manager to get the necessary packages.


Quote
I got the dfu-programmer to build on OSX Lion 10.7.3 with the following steps:

Install Xcode 4.3 from the Appstore
Install Xcode command line tools from Xcode preferences (see https://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/WhatsNewXcode/Articles/xcode_4_3.html).
Tell Xcode where Xcode is installed: sudo xcode-select -switch /Applications/Xcode.app
Set up a link for the missing clang executable: cd /Applications/Xcode.app/Contents/Developer/usr/bin; sudo ln -s clang llvm-gcc; cd -
Install macports from http://www.macports.org/
Install autoconf tools via macports: sudo port install pkgconfig automake
Install libusb via macports: sudo port install libusb-devel

Configure and build dfu-programmer: cd dfu-programmer-0.5.4; ./bootstrap.sh; ./configure; ./make; ./sudo make install
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

just tried.

after ./configure i get this error


Claudio-Battistas-MacBook-Pro:arduino-usbserial claudiobattista$ sudo port install libusb-devel
--->  Computing dependencies for libusb-devel
Error: Unable to execute port: Can't install libusb-devel because conflicting ports are installed: libusb
To report a bug, see <http://guide.macports.org/#project.tickets>
Claudio-Battistas-MacBook-Pro:arduino-usbserial claudiobattista$ cd dfu-programmer-0.5.4;
Claudio-Battistas-MacBook-Pro:dfu-programmer-0.5.4 claudiobattista$ /bootstrap.sh;
-bash: /bootstrap.sh: No such file or directory
Claudio-Battistas-MacBook-Pro:dfu-programmer-0.5.4 claudiobattista$ ./bootstrap.sh
Claudio-Battistas-MacBook-Pro:dfu-programmer-0.5.4 claudiobattista$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... m4/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... configure: error: in `/Users/claudiobattista/chronome/LUFA 100807/Projects/arduino-usbserial/dfu-programmer-0.5.4':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Claudio-Battistas-MacBook-Pro:dfu-programmer-0.5.4 claudiobattista$

i have x11 & xcode installed .....!!!

???


mbp i7 osx 10.6.8, arduino mega 2560 R3
« Last Edit: April 05, 2012, 02:48:30 pm by monoaural » Logged

Austin, TX
Offline Offline
God Member
*****
Karma: 12
Posts: 524
carpe diem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Attached is the patched version of dfu-programmer that I built on my system...

* dfu-programmer (59.58 KB - downloaded 31 times.)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi louis.

sorry for the dump question, but i have no idea where to put your attached file and which command to type in terminal...

thanks.
Logged

Austin, TX
Offline Offline
God Member
*****
Karma: 12
Posts: 524
carpe diem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can use the instructions at the following link as a guide:

http://arduino.cc/en/Hacking/DFUProgramming8U2

Put the dfu-programmer file that you downloaded in any folder of your choosing.

Download the following file and put it in the same folder:
https://github.com/arduino/Arduino/blob/master/hardware/arduino/firmwares/arduino-usbserial/Arduino-usbserial-atmega16u2-Mega2560-Rev3.hex

Then open the terminal and cd to the folder you just put the files in and execute the following commands:

sudo ./dfu-programmer atmega16u2 erase

When this command is done and you get a command prompt again, type

sudo ./dfu-programmer atmega16u2 flash Arduino-usbserial-atmega16u2-Mega2560-Rev3.hex

Finally, type

sudo ./dfu-programmer atmega16u2 reset
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

did so.

get this error

Last login: Sat Apr  7 16:35:57 on ttys005
Claudio-Battistas-MacBook-Pro:~ claudiobattista$ cd chronome_v2
Claudio-Battistas-MacBook-Pro:chronome_v2 claudiobattista$ sudo ./dfu-programmer atmega16u2 erase
sudo: ./dfu-programmer: command not found
Claudio-Battistas-MacBook-Pro:chronome_v2 claudiobattista$

attached a picture of the folder where i put the files....

when typing

sudo dfu-programmer atmega16u2 erase (without ./   -- i have no clou what meany by the way) i get this

seems like 16u2 is not in the targe list?!?!?


Claudio-Battistas-MacBook-Pro:chronome_v2 claudiobattista$ sudo dfu-programmer atmega16u2 erase
dfu-programmer 0.5.4
Usage: dfu-programmer target command [command-options] [global-options] [file|data]
targets:
        at89c51snd1c
        at89c51snd2c
        at89c5130
        at89c5131
        at89c5132
        at90usb1287
        at90usb1286
        at90usb1287-4k
        at90usb1286-4k
        at90usb647
        at90usb646
        at90usb162
        at90usb82
        atmega32u6
        atmega32u4
        atmega32u2
        atmega16u4
        atmega8u2
        at32uc3a0128
        at32uc3a1128
        at32uc3a0256
        at32uc3a1256
        at32uc3a0512
        at32uc3a1512
        at32uc3a0512es
        at32uc3a1512es
        at32uc3a364
        at32uc3a364s
        at32uc3a3128
        at32uc3a3128s
        at32uc3a3256
        at32uc3a3256s
        at32uc3b064
        at32uc3b164
        at32uc3b0128
        at32uc3b1128
        at32uc3b0256
        at32uc3b1256
        at32uc3b0256es
        at32uc3b1256es
        at32uc3b0512
        at32uc3b1512
        at32uc3c064
        at32uc3c0128
        at32uc3c0256
        at32uc3c0512
        at32uc3c164
        at32uc3c1128
        at32uc3c1256
        at32uc3c1512
        at32uc3c264
        at32uc3c2128
        at32uc3c2256
        at32uc3c2512
global-options: --quiet, --debug level
commands:
        configure {BSB|SBV|SSB|EB|HSB} [--suppress-validation] [global-options] data
        dump [global-options]
        dump-eeprom [global-options]
        dump-user [global-options]
        erase [--suppress-validation] [global-options]
        flash [--suppress-validation] [--suppress-bootloader-mem] [global-options] {file|STDIN}
        flash-eeprom [--suppress-validation] [global-options] {file|STDIN}
        flash-user [--suppress-validation] [global-options] {file|STDIN}
        get {bootloader-version|ID1|ID2|BSB|SBV|SSB|EB|
            manufacturer|family|product-name|
            product-revision|HSB} [global-options]
        getfuse {LOCK|EPFL|BOOTPROT|BODLEVEL|BODHYST|
                BODEN|ISP_BOD_EN|ISP_IO_COND_EN|
                ISP_FORCE} [global-options]
        setfuse {LOCK|EPFL|BOOTPROT|BODLEVEL|BODHYST|
                BODEN|ISP_BOD_EN|ISP_IO_COND_EN|
                ISP_FORCE} [global-options] data
        reset [global-options]
        start [global-options]
        version [global-options]
Claudio-Battistas-MacBook-Pro:chronome_v2 claudiobattista$






* chronome_v2.tiff (24.9 KB, 416x145 - viewed 118 times.)
« Last Edit: April 07, 2012, 10:25:03 am by monoaural » Logged

Austin, TX
Offline Offline
God Member
*****
Karma: 12
Posts: 524
carpe diem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The ./ is used to make sure you execute the dfu-programmer app that is in the local directory.

When you removed the ./ , you are executing the old dfu-programmer app that does not have the patch.

If you look at the dfu-programmer file in Finder does it have an icon that shows "exec" and has a Kind of Unix Executable File?

If not, you will need to execute the command: chmod +x dfu-programmer

This will let you execute the file.  Make sure your terminal's local directory is the one with the downloaded dfu-programmer and hex file.
Make sure you use the ./ when you execute the commands.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the dfu-programmer file didn´t had any exec icon until i did

chmod +x dfu-programmer

now my dfu-programmer file has an exec icon (see picture attached)

now, when i´m typing sudo ./dfu-programmer atmega16u2 erase

i get this:

Claudio-Battistas-MacBook-Pro:chronome_v2 claudiobattista$ sudo ./dfu-programmer atmega16u2 erase
dyld: Library not loaded: /usr/local/lib/libusb-1.0.0.dylib
  Referenced from: /Users/claudiobattista/chronome_v2/./dfu-programmer
  Reason: image not found
Trace/BPT trap
Claudio-Battistas-MacBook-Pro:chronome_v2 claudiobattista$


what am i doing wrong?


* dfu exec.tiff (35.15 KB, 502x152 - viewed 114 times.)
Logged

Austin, TX
Offline Offline
God Member
*****
Karma: 12
Posts: 524
carpe diem
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Now it is telling you that libusb library is not installed or it can't find it.

Since you have macports installed from a previous step, you need to run:

sudo port install libusb

Hopefully that will fix up your libusb library install.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

desperate  smiley-cry

Claudio-Battistas-MacBook-Pro:chronome_v2 claudiobattista$ sudo port install libusb
--->  Cleaning libusb
Claudio-Battistas-MacBook-Pro:chronome_v2 claudiobattista$ sudo ./dfu-programmer atmega16u2 erase
dyld: Library not loaded: /usr/local/lib/libusb-1.0.0.dylib
  Referenced from: /Users/claudiobattista/chronome_v2/./dfu-programmer
  Reason: image not found
Trace/BPT trap
Claudio-Battistas-MacBook-Pro:chronome_v2 claudiobattista$





Logged

Pages: [1] 2   Go Up
Jump to: