problems, compile commandline tools under mac os x 10.6.8

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
pepperbilly
Posts: 3
Joined: Sun Oct 30, 2011 8:57 pm

problems, compile commandline tools under mac os x 10.6.8

Post by pepperbilly » Sun Oct 30, 2011 10:31 pm

Hi There.

im am new to v-usb. i have some expirience with avr programing using avr studio. after that i get some expirience with crossPack and the stk500 under mac os x wich works fine for me to flash the avr's on a mac.

now i tried to get some expirience with the v-usb but i failed in one case. i tried for example to make the "usb-led-fader" run (because of i own all the compnent wich are used to bild the hardware). i have compiled and flashed the firmware on my atmega8 wich works all fine after some small modifications in the makefile.

but i dont get the makefile running. the problem must be in the gcc or in the libusb or both. but i cant figure out what it is exactly.

first try (no changes at the Makefile):
makefile:

Code: Select all

CC              = gcc
LIBUSB_CONFIG   = libusb-config


gets me the followed error:

Code: Select all

gcc `libusb-config --cflags` -O -Wall -I../common -c usb-led-fader.c
/bin/sh: gcc: command not found
make: *** [usb-led-fader.o] Error 127


second try (modified makefile after locateing gcc and libusb-confic on my system):

Code: Select all

CC              = /usr/local/CrossPack-AVR-20100115/avr-3/bin/gcc
LIBUSB_CONFIG   = /usr/local/CrossPack-AVR-20100115/bin/libusb-config


gets me the followed error:

Code: Select all

/usr/local/CrossPack-AVR-20100115/avr-3/bin/gcc `/usr/local/CrossPack-AVR-20100115/bin/libusb-config --cflags` -O -Wall -I../common -c usb-led-fader.c
In file included from usb-led-fader.c:13:
/usr/local/CrossPack-AVR-20100115/include/usb.h:14:20: unistd.h: No such file or directory
/usr/local/CrossPack-AVR-20100115/include/usb.h:18:20: dirent.h: No such file or directory
In file included from usb-led-fader.c:13:
/usr/local/CrossPack-AVR-20100115/include/usb.h:67: error: syntax error before "u_int8_t"
/usr/local/CrossPack-AVR-20100115/include/usb.h:67: warning: no semicolon at end of struct or union
/usr/local/CrossPack-AVR-20100115/include/usb.h:68: warning: type defaults to `int' in declaration of `bDescriptorType'
/usr/local/CrossPack-AVR-20100115/include/usb.h:68: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:73: error: syntax error before "u_int8_t"
/usr/local/CrossPack-AVR-20100115/include/usb.h:73: warning: no semicolon at end of struct or union
/usr/local/CrossPack-AVR-20100115/include/usb.h:74: warning: type defaults to `int' in declaration of `bDescriptorType'
/usr/local/CrossPack-AVR-20100115/include/usb.h:74: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:75: error: syntax error before "wData"
/usr/local/CrossPack-AVR-20100115/include/usb.h:75: warning: type defaults to `int' in declaration of `wData'
/usr/local/CrossPack-AVR-20100115/include/usb.h:75: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:76: error: syntax error before '}' token
/usr/local/CrossPack-AVR-20100115/include/usb.h:80: error: syntax error before "u_int8_t"
/usr/local/CrossPack-AVR-20100115/include/usb.h:80: warning: no semicolon at end of struct or union
/usr/local/CrossPack-AVR-20100115/include/usb.h:81: warning: type defaults to `int' in declaration of `bDescriptorType'
/usr/local/CrossPack-AVR-20100115/include/usb.h:81: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:82: error: syntax error before "bcdHID"
/usr/local/CrossPack-AVR-20100115/include/usb.h:82: warning: type defaults to `int' in declaration of `bcdHID'
/usr/local/CrossPack-AVR-20100115/include/usb.h:82: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:83: error: syntax error before "bCountryCode"
/usr/local/CrossPack-AVR-20100115/include/usb.h:83: warning: type defaults to `int' in declaration of `bCountryCode'
/usr/local/CrossPack-AVR-20100115/include/usb.h:83: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:84: error: syntax error before "bNumDescriptors"
/usr/local/CrossPack-AVR-20100115/include/usb.h:84: warning: type defaults to `int' in declaration of `bNumDescriptors'
/usr/local/CrossPack-AVR-20100115/include/usb.h:84: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:93: error: syntax error before "u_int8_t"
/usr/local/CrossPack-AVR-20100115/include/usb.h:93: warning: no semicolon at end of struct or union
/usr/local/CrossPack-AVR-20100115/include/usb.h:94: warning: type defaults to `int' in declaration of `bDescriptorType'
/usr/local/CrossPack-AVR-20100115/include/usb.h:94: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:95: error: syntax error before "bEndpointAddress"
/usr/local/CrossPack-AVR-20100115/include/usb.h:95: warning: type defaults to `int' in declaration of `bEndpointAddress'
/usr/local/CrossPack-AVR-20100115/include/usb.h:95: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:96: error: syntax error before "bmAttributes"
/usr/local/CrossPack-AVR-20100115/include/usb.h:96: warning: type defaults to `int' in declaration of `bmAttributes'
/usr/local/CrossPack-AVR-20100115/include/usb.h:96: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:97: error: syntax error before "wMaxPacketSize"
/usr/local/CrossPack-AVR-20100115/include/usb.h:97: warning: type defaults to `int' in declaration of `wMaxPacketSize'
/usr/local/CrossPack-AVR-20100115/include/usb.h:97: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:98: error: syntax error before "bInterval"
/usr/local/CrossPack-AVR-20100115/include/usb.h:98: warning: type defaults to `int' in declaration of `bInterval'
/usr/local/CrossPack-AVR-20100115/include/usb.h:98: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:99: error: syntax error before "bRefresh"
/usr/local/CrossPack-AVR-20100115/include/usb.h:99: warning: type defaults to `int' in declaration of `bRefresh'
/usr/local/CrossPack-AVR-20100115/include/usb.h:99: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:100: error: syntax error before "bSynchAddress"
/usr/local/CrossPack-AVR-20100115/include/usb.h:100: warning: type defaults to `int' in declaration of `bSynchAddress'
/usr/local/CrossPack-AVR-20100115/include/usb.h:100: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:104: error: syntax error before '}' token
/usr/local/CrossPack-AVR-20100115/include/usb.h:118: error: syntax error before "u_int8_t"
/usr/local/CrossPack-AVR-20100115/include/usb.h:118: warning: no semicolon at end of struct or union
/usr/local/CrossPack-AVR-20100115/include/usb.h:119: warning: type defaults to `int' in declaration of `bDescriptorType'
/usr/local/CrossPack-AVR-20100115/include/usb.h:119: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:120: error: syntax error before "bInterfaceNumber"
/usr/local/CrossPack-AVR-20100115/include/usb.h:120: warning: type defaults to `int' in declaration of `bInterfaceNumber'
/usr/local/CrossPack-AVR-20100115/include/usb.h:120: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:121: error: syntax error before "bAlternateSetting"
/usr/local/CrossPack-AVR-20100115/include/usb.h:121: warning: type defaults to `int' in declaration of `bAlternateSetting'
/usr/local/CrossPack-AVR-20100115/include/usb.h:121: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:122: error: syntax error before "bNumEndpoints"
/usr/local/CrossPack-AVR-20100115/include/usb.h:122: warning: type defaults to `int' in declaration of `bNumEndpoints'
/usr/local/CrossPack-AVR-20100115/include/usb.h:122: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:123: error: syntax error before "bInterfaceClass"
/usr/local/CrossPack-AVR-20100115/include/usb.h:123: warning: type defaults to `int' in declaration of `bInterfaceClass'
/usr/local/CrossPack-AVR-20100115/include/usb.h:123: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:124: error: syntax error before "bInterfaceSubClass"
/usr/local/CrossPack-AVR-20100115/include/usb.h:124: warning: type defaults to `int' in declaration of `bInterfaceSubClass'
/usr/local/CrossPack-AVR-20100115/include/usb.h:124: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:125: error: syntax error before "bInterfaceProtocol"
/usr/local/CrossPack-AVR-20100115/include/usb.h:125: warning: type defaults to `int' in declaration of `bInterfaceProtocol'
/usr/local/CrossPack-AVR-20100115/include/usb.h:125: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:126: error: syntax error before "iInterface"
/usr/local/CrossPack-AVR-20100115/include/usb.h:126: warning: type defaults to `int' in declaration of `iInterface'
/usr/local/CrossPack-AVR-20100115/include/usb.h:126: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:132: error: syntax error before '}' token
/usr/local/CrossPack-AVR-20100115/include/usb.h:144: error: syntax error before "u_int8_t"
/usr/local/CrossPack-AVR-20100115/include/usb.h:144: warning: no semicolon at end of struct or union
/usr/local/CrossPack-AVR-20100115/include/usb.h:145: warning: type defaults to `int' in declaration of `bDescriptorType'
/usr/local/CrossPack-AVR-20100115/include/usb.h:145: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:146: error: syntax error before "wTotalLength"
/usr/local/CrossPack-AVR-20100115/include/usb.h:146: warning: type defaults to `int' in declaration of `wTotalLength'
/usr/local/CrossPack-AVR-20100115/include/usb.h:146: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:147: error: syntax error before "bNumInterfaces"
/usr/local/CrossPack-AVR-20100115/include/usb.h:147: warning: type defaults to `int' in declaration of `bNumInterfaces'
/usr/local/CrossPack-AVR-20100115/include/usb.h:147: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:148: error: syntax error before "bConfigurationValue"
/usr/local/CrossPack-AVR-20100115/include/usb.h:148: warning: type defaults to `int' in declaration of `bConfigurationValue'
/usr/local/CrossPack-AVR-20100115/include/usb.h:148: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:149: error: syntax error before "iConfiguration"
/usr/local/CrossPack-AVR-20100115/include/usb.h:149: warning: type defaults to `int' in declaration of `iConfiguration'
/usr/local/CrossPack-AVR-20100115/include/usb.h:149: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:150: error: syntax error before "bmAttributes"
/usr/local/CrossPack-AVR-20100115/include/usb.h:150: warning: type defaults to `int' in declaration of `bmAttributes'
/usr/local/CrossPack-AVR-20100115/include/usb.h:150: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:151: error: syntax error before "MaxPower"
/usr/local/CrossPack-AVR-20100115/include/usb.h:151: warning: type defaults to `int' in declaration of `MaxPower'
/usr/local/CrossPack-AVR-20100115/include/usb.h:151: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:157: error: syntax error before '}' token
/usr/local/CrossPack-AVR-20100115/include/usb.h:161: error: syntax error before "u_int8_t"
/usr/local/CrossPack-AVR-20100115/include/usb.h:161: warning: no semicolon at end of struct or union
/usr/local/CrossPack-AVR-20100115/include/usb.h:162: warning: type defaults to `int' in declaration of `bDescriptorType'
/usr/local/CrossPack-AVR-20100115/include/usb.h:162: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:163: error: syntax error before "bcdUSB"
/usr/local/CrossPack-AVR-20100115/include/usb.h:163: warning: type defaults to `int' in declaration of `bcdUSB'
/usr/local/CrossPack-AVR-20100115/include/usb.h:163: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:164: error: syntax error before "bDeviceClass"
/usr/local/CrossPack-AVR-20100115/include/usb.h:164: warning: type defaults to `int' in declaration of `bDeviceClass'
/usr/local/CrossPack-AVR-20100115/include/usb.h:164: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:165: error: syntax error before "bDeviceSubClass"
/usr/local/CrossPack-AVR-20100115/include/usb.h:165: warning: type defaults to `int' in declaration of `bDeviceSubClass'
/usr/local/CrossPack-AVR-20100115/include/usb.h:165: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:166: error: syntax error before "bDeviceProtocol"
/usr/local/CrossPack-AVR-20100115/include/usb.h:166: warning: type defaults to `int' in declaration of `bDeviceProtocol'
/usr/local/CrossPack-AVR-20100115/include/usb.h:166: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:167: error: syntax error before "bMaxPacketSize0"
/usr/local/CrossPack-AVR-20100115/include/usb.h:167: warning: type defaults to `int' in declaration of `bMaxPacketSize0'
/usr/local/CrossPack-AVR-20100115/include/usb.h:167: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:168: error: syntax error before "idVendor"
/usr/local/CrossPack-AVR-20100115/include/usb.h:168: warning: type defaults to `int' in declaration of `idVendor'
/usr/local/CrossPack-AVR-20100115/include/usb.h:168: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:169: error: syntax error before "idProduct"
/usr/local/CrossPack-AVR-20100115/include/usb.h:169: warning: type defaults to `int' in declaration of `idProduct'
/usr/local/CrossPack-AVR-20100115/include/usb.h:169: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:170: error: syntax error before "bcdDevice"
/usr/local/CrossPack-AVR-20100115/include/usb.h:170: warning: type defaults to `int' in declaration of `bcdDevice'
/usr/local/CrossPack-AVR-20100115/include/usb.h:170: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:171: error: syntax error before "iManufacturer"
/usr/local/CrossPack-AVR-20100115/include/usb.h:171: warning: type defaults to `int' in declaration of `iManufacturer'
/usr/local/CrossPack-AVR-20100115/include/usb.h:171: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:172: error: syntax error before "iProduct"
/usr/local/CrossPack-AVR-20100115/include/usb.h:172: warning: type defaults to `int' in declaration of `iProduct'
/usr/local/CrossPack-AVR-20100115/include/usb.h:172: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:173: error: syntax error before "iSerialNumber"
/usr/local/CrossPack-AVR-20100115/include/usb.h:173: warning: type defaults to `int' in declaration of `iSerialNumber'
/usr/local/CrossPack-AVR-20100115/include/usb.h:173: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:174: error: syntax error before "bNumConfigurations"
/usr/local/CrossPack-AVR-20100115/include/usb.h:174: warning: type defaults to `int' in declaration of `bNumConfigurations'
/usr/local/CrossPack-AVR-20100115/include/usb.h:174: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:178: error: syntax error before "u_int8_t"
/usr/local/CrossPack-AVR-20100115/include/usb.h:178: warning: no semicolon at end of struct or union
/usr/local/CrossPack-AVR-20100115/include/usb.h:179: warning: type defaults to `int' in declaration of `bRequest'
/usr/local/CrossPack-AVR-20100115/include/usb.h:179: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:180: error: syntax error before "wValue"
/usr/local/CrossPack-AVR-20100115/include/usb.h:180: warning: type defaults to `int' in declaration of `wValue'
/usr/local/CrossPack-AVR-20100115/include/usb.h:180: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:181: error: syntax error before "wIndex"
/usr/local/CrossPack-AVR-20100115/include/usb.h:181: warning: type defaults to `int' in declaration of `wIndex'
/usr/local/CrossPack-AVR-20100115/include/usb.h:181: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:182: error: syntax error before "wLength"
/usr/local/CrossPack-AVR-20100115/include/usb.h:182: warning: type defaults to `int' in declaration of `wLength'
/usr/local/CrossPack-AVR-20100115/include/usb.h:182: warning: data definition has no type or storage class
/usr/local/CrossPack-AVR-20100115/include/usb.h:244: error: `PATH_MAX' undeclared here (not in a function)
/usr/local/CrossPack-AVR-20100115/include/usb.h:248: error: field `descriptor' has incomplete type
/usr/local/CrossPack-AVR-20100115/include/usb.h:253: error: syntax error before "u_int8_t"
/usr/local/CrossPack-AVR-20100115/include/usb.h:253: warning: no semicolon at end of struct or union
/usr/local/CrossPack-AVR-20100115/include/usb.h:257: error: syntax error before '}' token
/usr/local/CrossPack-AVR-20100115/include/usb.h:265: error: syntax error before "u_int32_t"
/usr/local/CrossPack-AVR-20100115/include/usb.h:265: warning: no semicolon at end of struct or union
/usr/local/CrossPack-AVR-20100115/include/usb.h:268: error: syntax error before '}' token
usb-led-fader.c: In function `usbOpenDevice':
usb-led-fader.c:112: error: dereferencing pointer to incomplete type
usb-led-fader.c:113: error: dereferencing pointer to incomplete type
usb-led-fader.c:113: error: dereferencing pointer to incomplete type
usb-led-fader.c:114: error: dereferencing pointer to incomplete type
usb-led-fader.c:114: error: dereferencing pointer to incomplete type
usb-led-fader.c:127: error: dereferencing pointer to incomplete type
usb-led-fader.c:135: error: dereferencing pointer to incomplete type
usb-led-fader.c: In function `dev_status':
usb-led-fader.c:310: warning: int format, different type arg (arg 6)
usb-led-fader.c:319: warning: int format, different type arg (arg 7)
make: *** [usb-led-fader.o] Error 1


is somebody out there who have expirience with mac os x and the commandline tools from v-usb?
wich are the correct path to gcc and libusb config?
and from where should i (re)install libusb and gcc?

libusb is from: http://www.ellert.se/twain-sane/
0.1.13 beta 2009-09-10 package type: binary

and the gcc i tried to use was from the crosspack. but there must be one came with xcode.

thanks for help.

tcb

sascha

Daid
Rank 2
Rank 2
Posts: 55
Joined: Mon Apr 18, 2011 12:19 pm

Re: problems, compile commandline tools under mac os x 10.6.8

Post by Daid » Mon Oct 31, 2011 10:18 am

Somehow building a commandline tool for the mac with an AVR compiler doesn't strike me as a good idea. I don't own a mac, but you'll need to install & use gcc for the mac for the commandline tools.

pepperbilly
Posts: 3
Joined: Sun Oct 30, 2011 8:57 pm

Re: problems, compile commandline tools under mac os x 10.6.8

Post by pepperbilly » Mon Oct 31, 2011 1:37 pm

ok, thx.
i taught it was some like this. but i also taught that gcc is a standard in mac witch came's with the developer environment. how ever right now i try to install/update to the latest xcode and hope its done with that.

i will report what happens as soon the installation is done.

tcb

sascha

pepperbilly
Posts: 3
Joined: Sun Oct 30, 2011 8:57 pm

Re: problems, compile commandline tools under mac os x 10.6.8

Post by pepperbilly » Mon Oct 31, 2011 11:45 pm

ok. after a new installation of xcode, everything works fine. i be able to compile the commandline tool. but somehow the tool don't find the device.

Code: Select all

Could not find USB device "USB-LED-Fader" with vid=0x16c0 pid=0x5dc

the fuse-bits are set as follow:

Code: Select all

-U hfuse:w:0xC9:m -U lfuse:w:0x9 F:m


i hope i will find out more tomorrow.

Daid
Rank 2
Rank 2
Posts: 55
Joined: Mon Apr 18, 2011 12:19 pm

Re: problems, compile commandline tools under mac os x 10.6.8

Post by Daid » Tue Nov 01, 2011 3:49 pm

Those fuse settings select a low frequency crystal, you want a high frequency crystal selection. It's also better to turn on the brownout detector.
I've used low: 0x3F high: 0xC9 with succes on the ATMega8A.

You can check the fuse settings here: http://www.engbedded.com/fusecalc/


I'm not sure if MacOS has the command "lsusb", but that command should show your USB device once it's plugged in. If it's not then your V-USB is not working correctly yet. If it shows there and the commandline tool cannot find it, then there is a problem with the commandline tool.

Post Reply