usb icon indicating copy to clipboard operation
usb copied to clipboard

Xmega undeclared variable

Open ab11042015 opened this issue 6 years ago • 4 comments

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

ab11042015 avatar Dec 09 '17 13:12 ab11042015

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" [email protected] 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 .

wbasser avatar Dec 09 '17 13:12 wbasser

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

ab11042015 avatar Dec 09 '17 13:12 ab11042015

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.

wbasser avatar Dec 09 '17 14:12 wbasser

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

ab11042015 avatar Dec 10 '17 01:12 ab11042015