bugAVR Downloader/UploaDEr - Bugs: bug #36713, config assumes obsolete libusb API

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #36713: config assumes obsolete libusb API

Submitted by:  None
Submitted on:  Sat 23 Jun 2012 10:02:55 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NonePrivacy: Public
Assigned to: NoneOriginator Name: Jeff Inman
Originator Email: -unavailable-Open/Closed: Open

Sat 23 Jun 2012 10:02:55 PM UTC, original submission:

If you build libusb 1.0.9, and then using that to build avrdude, you might have a config something like this (with tcsh):

(setenv CPPFLAGS -I.../libusb-1.0.9/installed/include/libusb-1.0; setenv LDFLAGS -L.../libusb-1.0.9/installed/lib; setenv LIBS -lusb-1.0; ./configure --prefix=`pwd`/installed )

The last line in the build process would look something like this:

gcc -Wall -Wno-pointer-sign -g -O2 -L.../libusb-1.0.9/installed/lib -o avrdude avrdude-main.o avrdude-term.o ./libavrdude.a -lusb-1.0 -lm -lreadline -lncurses -ltermcap -lusb-1.0

clearly, we're linking with libusb, but running avrdude with a usb programmer then spits out this message:

avrdude: error: no usb support. Please compile again with libusb installed.
avrdude: programmer operation not supported

avrdude done. Thank you.

Turns out the problem is this part of the configure file [line 4499]:

LIBS="-lusb $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char usb_get_string_simple ();
int
main ()
{
return usb_get_string_simple ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_usb_usb_get_string_simple=yes
else
ac_cv_lib_usb_usb_get_string_simple=no
fi

The problem is that get_string_simple() is obsolete libusb-1.0.(http://libusb.org/wiki/APIs says the 0.1 API is "deprecated and unmaintained since many years") There is apparently a libusb-compat-0.1 version that provides 0.1 API via the 1.0 substrate.

You probably have lots of other things to worry about, before updating your USB interaction. But I find lots of evidence on the web of folks running into this and being frustrated. I suppose a temporary improvement would be to produce a better warning, maybe something like this:

avrdude: error: no usb support via libusb-0.1. Please compile again with libusb-0.1 installed.
avrdude: programmer operation not supported

avrdude done. Thank you.

Thanks for the tool, though.

Jeff

Anonymous

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup