kevinmehall / usb

Minimalist portable USB device stack for SAMD21, LPC1800, LPC4300, Xmega
MIT License
100 stars 20 forks source link

Xmega undeclared variable #11

Open ab11042015 opened 6 years ago

ab11042015 commented 6 years ago

Hello Kevin,

Let me first thank you for the code, I tried run the however I have this message:

Error 2 'F_USB' undeclared (first use in this function)

Can you please show me the way

Thank you

wbasser commented 6 years ago

That is a macro that needs to be defined in the project options section. Not sure what tool you are using, but usually it is in tool chain/symbols.

There should also be one indicating F_CPU.

It would normally set to the frequency of the main clock

F_CPU=16000000

i hope this helps.

On Dec 9, 2017 8:07 AM, "ab11042015" notifications@github.com wrote:

Hello Kevin,

Let me first thank you for the code, I tried run the however I have this message:

Error 2 'F_USB' undeclared (first use in this function)

Can you please show me the way

Thank you

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kevinmehall/usb/issues/11, or mute the thread https://github.com/notifications/unsubscribe-auth/ADeAYmmsQffk9VVuSAYKXRqIHU-ktjTrks5s-oYfgaJpZM4Q8FTw .

ab11042015 commented 6 years ago

Thank you wbasser

I am using AtmelStudio 6 and I am quite newbee, couldn't really figure it out I will try to find a way to make it Do you have any good way to learn decently Xmega programming Anyway thank you for your kind support

wbasser commented 6 years ago

The really good way is look at example projects that are provided by the tool itself, you can create sample programs or go on-line for examples.

So in Atmel studio, goto Project/Properties Select Toolchain in the left window Select AVR/GNU C Compiler Select Symbols

The symbols should be something like this F_CPU=16000000 F_USB=16000000 ARCH=XMEGA USE_LUFA_CONGIG_HEADER BOARD=[ add your board type here or NONE]

This should at least remove the compile error

Bill

Sent from Mail for Windows 10

From: ab11042015 Sent: Saturday, December 9, 2017 8:50 AM To: kevinmehall/usb Cc: wbasser; Comment Subject: Re: [kevinmehall/usb] Xmega undeclared variable (#11)

Thank you wbasser I am using AtmelStudio 6 and I am quite newbee, couldn't really figure it out I will try to find a way to make it Do you have any good way to learn decently Xmega programming Anyway thank you for your kind support — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

ab11042015 commented 6 years ago

Hey Bill,

Thank you, the program compiled without any error, however the usb has not been recognized by the PC.

I went through the whole night but couldn't figure it out, is there any port selection that should be performed?

Again thank you a lot for your kind support