AVARICE with libusb

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

I'm having problems while trying to communicate to Atmel-ICE over Avarice and for some reason I'm constantly getting "avarice has not been compiled with libusb support" error message.

Since I couldn't get Avarice to work I have tried to first enable the avrdude. After small playing around with libusb drivers I have managed to use the avrdude with Atmel-ICE. After that I have switched to Avarice again and no matter what I do or where I paste the libusb files the Avarice won't compile with libusb support (Avarice compiles but constantly prints the error for missing libusb on "avarice --mkII -j usb" cmd). 

Things that I have done before compiling the Avarice:

  • copied the libusb-1.0 header file to /usr/include/libusb-1.0/ under cygwin
  • copied the libusb-1.0.a and libusb-1.0.dll.a files to lib /gcc/x86_64-pc-cygwin/6.4.0/ under cygwin
  • untared avarice-2.13 in home folder and created a specific "obj-avr" directory within
  • set flags for libusb:
    • export CPPFLAGS=-I/usr/include/libusb-1.0/
    • export CFLAGS=-I/usr/include/libusb-1.0/
    • export LDFLAGS="-static -L/lib/gcc "
  • "../configure --prefix=$PREFIX" cmd
  • then I have appended "-lusb-1.0" in LIBS variable under Makefile
  • after that I have applied the patches mention by TT_ZX from here
  • then I needed to modify the jtagrw.cc file under line 134 to "NULL". For some reason it was returning boolean value.
  • now I was able to execute make and make install cmds

After doing all steps above I was able to get the avarice.exe file but it was still saying that Avarice wasn't compiled with libusb support. Does anyone have any idea what am I missing here?

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I do not have any experience with Atmel ICE but had a similar problem with the Atmel Dragon.  Avrdude would work with libusb but not the Dragon. 

 

What solved my problem was to install libusb_win32 https://sourceforge.net/projects/libusb-win32/  Both Avarice 2.12 and Avrdude 6.1 do not object to the Dragon with that driver.   However, I do see you are using the 64 bit version of Windows so I'm not sure that fix would work for you. 

 

Alan

Last Edited: Sat. Sep 30, 2017 - 08:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Would Zadig catch all?

[Zadig icon]

Zadig

USB driver installation made easy

http://zadig.akeo.ie/

(the Windows XP version is via Download, Other versions)

 

Edit : expand Zadig

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Sat. Sep 30, 2017 - 08:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi alllano and gchapman,

thank's for the advice. I have installed the libusb-win32-1.2.6.0 driver with zadig but it didn't help. At least Now I know how to easily install the driver.

 

After some time of digging for solution online I have finally managed to compile the Avarice with libusb support. Turns out that I don't need to specify CPPFLAGS, CFLAGS and LDFLAGS to point to libusb files but rather to bfd.h and libbfd.a files.

 

But now I was getting the  "did not find any USB device "usb"" error. Well I found out that jtag2usb.cc files specifies the PID of the device "#define SB_DEVICE_JTAGICEMKII 0x2103" while my Atmel-ICE pid is 2141. So that's the reason of the aforementioned error message. And I have recompiled the Avarice with corrected PID value but then happened another error. 

 

"USB bulk write error: libusb0-dll:err [submit_async] submitting request failed, win error: The parameter is incorrect."

 

This Avarice just won't cooperate. I'll keep trying to get it work. If anyone has any more ideas please share.

 

//geronimo

Last Edited: Sun. Oct 1, 2017 - 04:54 PM