atmel studio 6 and v-usb

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
asd123zxc
Posts: 5
Joined: Sun Jul 08, 2012 10:15 pm

atmel studio 6 and v-usb

Post by asd123zxc » Sun Jul 08, 2012 11:17 pm

hi
i want to use atmel studio 6 to compile v-usb project.

i created a new project > gcc c executable project
device > atmega8a

and here is my code

Code: Select all

#define F_CPU 12000000 

#include <avr/io.h>
#include "usbdrv.h"
#include <avr/interrupt.h>
#include <avr/wdt.h>


#include <util/delay.h>
#define USB_LED_OFF 0
#define USB_LED_ON  1

USB_PUBLIC uchar usbFunctionSetup(uchar data[8])
{
    return 0; // should not get here
}


int main() {
   DDRB = 0xff;
   PORTB = 0xff;
   uchar i;

   wdt_enable(WDTO_1S); // enable 1s watchdog timer

   usbInit();
   usbDeviceDisconnect(); // enforce re-enumeration
   for(i = 0; i<250; i++)
   { // wait 500 ms
      wdt_reset(); // keep the watchdog happy
      _delay_ms(2);
   }
usbDeviceConnect();

sei(); // Enable interrupts after re-enumeration

while(1)
{
   wdt_reset(); // keep the watchdog happy
   usbPoll();
}

return 0;
}



when i compile > error :
undefined reference `usbinit();'
undefined reference `usbpoll();'
undefined reference `usbInputBufOffset'
and ....


what is the problem?

asd123zxc
Posts: 5
Joined: Sun Jul 08, 2012 10:15 pm

Re: atmel studio 6 and v-usb

Post by asd123zxc » Tue Jul 10, 2012 9:43 pm

i included usbdrv.h usbdrv.c and added usbdrvasm.s to project and now :
error : invalid conversion from 'void*' to 'usbRequest_t* {aka usbRequest*}' [-fpermissive]
what is the problem?

asd123zxc
Posts: 5
Joined: Sun Jul 08, 2012 10:15 pm

Re: atmel studio 6 and v-usb

Post by asd123zxc » Tue Jul 10, 2012 11:29 pm

i created a new project and copied every thing to project folder and included only usbdrv.c not usbdrv.h and now build succeed ??
now my question is that what happen if i don't include usbdrv.h??
please help me

Post Reply