I downloaded the extension for LUFA in AS7 and built it for the AT90USBKEY2, which I think is what its written for. It builds fine but when I uploaded it and plugged it in the device enumerates as Unknown and windows gives me an error that it thinks the device has malfunctioned. The example I built was Virtual Serial CDC Device Demo (Class Driver APIs). I'm just wondering if I'm missing something.

I built a project example also (USB to serial converter) and windows recognized that when I plugged it in but it was missing the driver, is that the problem for the first example?

I don't understand, are they fully functional or do they need modification to work?

Using LUFA should I just be able to include LUFA functions from that documentation and make the appropriate calls from my main to set up and communicate, or is there more framework modifications that need to be done deeper in the LUFA configs for everything to function properly?

I was reading one LUFA tutorial about USB control transfers, he talks about how LUFA does everything for you unless you tell it otherwise. Is that the case for everything?

I don't understand, are they fully functional or do they need modification to work?

They are fully functional, but as with any library there may be a need to do some tweaking to have it work with your application. In your OP you mention the USBKEY. Are you using that, or are you using something else? If the demo is set up for the USBKEY, then for all practical purposes it should work out of the box. YOu may need to load the driver that I mentioned in a prior post.

If the target is a board of your design, then you need to make sure that the Target CPU in LUFA matches, the F_CPU matches your target, etc. Basic configuration stuff.

I used the LUFA Virtual Serial application in a project and yes there is an input, and output to LUFA, but I still needed to add code to my project to work with it properly.

That being said, how about you write up a post of what you are looking to do Exactly, and what hardware, and which LUFA demo you are using so we have something to go by.

Jim

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

They are fully functional, but as with any library there may be a need to do some tweaking to have it work with your application. In your OP you mention the USBKEY. Are you using that, or are you using something else? If the demo is set up for the USBKEY, then for all practical purposes it should work out of the box. YOu may need to load the driver that I mentioned in a prior post.

this was kind of my problem, I'm trying to load that demo on the USBKEY and it doesn't seem to work, it wont take the driver because windows doesn't know what I plugged in. The full project examples enumerate as the project name and then I can point it to the driver and it works, but the demo example just comes in as Unknown.

This whole thing with the USBKEY was just a first step to get the USB working period and sending data I could see back and forth to the AVR. My actual application would be the Demo I'm trying to use on a different processor for different data. But essentially enumerating as a com port so I could send data back and forth to a terminal.

If you think my best bet would be to create a new post explaining what I'd like to be doing on the correct AVR I will do that. I was just trying to get enough info to hopefully understand enough and be able to use a USB template to create the base of my project for my actual application if that makes sense.

I was hoping to use this demo and get data to show up from the joystick on the terminal and try and dig down and figure out why.

If you think my best bet would be to create a new post explaining what I'd like to be doing on the correct AVR I will do that. I

Do Not create a new thread. Simply outline here, in this thread what you are trying to achieve. Both with the USBKEY and your final target.

I have a USBKEY here on my shelf. If you point out the DEMO you are tying to get going, I can try it here. I am in and out of the lab today so I may not respond right away, but I will give it a go. I see you mention in your OP the CDC virtual Serial. I think I might have used that one in my project. Will look later.

Just confirm the demo you want to use with the USBKEY and I will try it later.

Best I can do for you

JIm

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

I took a quick look at my project and I also used the CDC demo and as I mentioned earlier I had to add an application that spoke to the LUFA demo and it indeed worked for a PC to speak to the controller.

I'll look later tonight when I have a few minutes. In the meantime, someone else might chime in with other pearls of wisdom.

JIm

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

I am getting the same error on my Win7pro/64 machine that the OP is getting and trying to force the driver I received from Dean down Windows throat is kicking back a fuss that it does not have information pertaining to x64 bit systems:

Very Odd.

Hopefully Dean is looking around. I'll send him a note through the LUFA forum and see if there is anything there.

I pulled out the old project I had with this and it too no longer enumerates., Wonder if a windows update messed things up

Jim

EDIT:

Left a note on teh LUFA support group. it's pretty quiet over there so not sure whats gonna came back.

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

I always tell to anybody who use LUFA to use AS4 to do the job since it work flawlessly that way.
But don't rely to my answer, it's IME.
I don't think Dean still manage it till now. And I believe it wasn't him who make the plugin for AS7. Anybody can make sure?
.
MG

I'm not sure what the difference is but if you run a complete project, like the LED notifier, it will enumerate just fine. That was why I started trying to find the joystick linking in the project I could get to work.

The problem is somewhere in the code while handling the enumeration. So I don't think it's windows driver's fault. That's what I can think right now.

pathare wrote:

various examples that some run and some don't

It didn't happen in AS4

pathare wrote:

If I start from the main.c and then that calls main.h which calls descriptors.h but how does something like board.h or joystick.h get called?

You better use the makefile Dean provided and alter your board and mcu also clock freq there.
If you don't use the makefile then you'll had a hard time to trace it one by one.
I haven't deal with LUFA for long time so I can't give you exact direction, just from my memory.
And I don't have any board the LUFA listed, just trace every file to get it to work for my board. I had been there, it's PITA. But you can use the same setting for other examples.
.
One more thing, if you add new files to your project, make sure to add them in the makefile manually. I did it years ago so maybe AS7 make it more simple I don't know.
.
MG

I found the call to the Joystick.h it was actually in the main.h I was just blind at first. With that I was able to build and get the joystick to terminal working as I wanted on the USBKEY. So now I'd like to work on moving over to the 32U4 and get something working there so I can get on with my actual project.

I'm not sure what exactly separates the various processors in terms of the code. I found a drop down in the ASF wizard that I assume defines the "Board" parameter that all the .h files in sub folders reference. Do I change that to user and create the necessary .h files that its going to try and call for a generic board. I could just follow along with whats already there to know what it wants.

I still don't understand why some versions will enumerate and others wont. my assumption is that most of the USB enumeration is in the descriptor.c and .h files and they seem identical to me.

now, when you go to use LUFA for your own project, where would you start? I opened a template and was surprised that most of the USB code was missing. Would you normally start with one of the demo projects and delete the code from the main.c and .h and start adding what you need it to do?

Oh, is there a make file Dean assumes you're going to be using? I am just using what as7 generates which I assume is from my selections in the ASF wizard. I'll go looking through the files I downloaded from four wall website and see if a make file is there.

Would you normally start with one of the demo projects and delete the code from the main.c and .h and start adding what you need it to do?

That is one way of attacking it, yes.

And the advantage is that you (more or less) can have something that works from "square zero". With a good testing strategy and design you can then test for every change you make.

When starting out from scratch there's usually one (or several) point where you must make a big leap, and coding substantially, and when that does not function as you wish you have your work cut out for you. One such leap is going from "no USB" to "USB". It's nice to have it there from the start, and continually verifying that it has not been borken.

I believe LUFA ha sa reasonable set of demos, so that you'll find something that will be a good start.

The drawback is, of-course, that you need to throw things out. And if you don't like the coding style in the demo then you got some refactoring/editing to do.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here.

No guarantees, but if we don't report problems they won't get much of a chance to be fixed! Details/discussions at link given just above.

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

In a fun turn of events, I tried both examples on a leonardo board and my own board with a 32U4 and the serial "Demo" example works but the "LED Notifier" "Project" example does not work. All I did was change the board parameter in the ASF wizard to the leonardo board for both examples.

This actually works well as a base for me. the Serial demo is the closest to what I actually need without extra stuff so I'll just use this and build my project from it.

I still don't know why some of the examples work and some don't but I think I can move forward with my application now.

If you still have time to do the research then please attach your 32U4 schematics (so I can set the ports of your needs) and the LUFA example you want to tweak (also which LUFA version).
I'll see what I can do but you need to be patient for it. We do had time differences here.
.
MG