Peter,
Whoops-a-daisy, just noticed this old thread wasn't answered. Are you
still having trouble with this, or has my inexcusable tardiness
allowed you to find a solution?
What version of LUFA are you using? I have had success with LUFA
(recentish versions) on the XMEGA devices using the CDC class in the
past, although past history makes me wary of releasing non-polished
demos to show this on this list. A copy of your project zipped up
either here or directly to myself would allow me to look over this for
you in greater depth, but I suspect a badly set or missing LUFA
compile time configuration option. The breakage of PORTF's USART is a
little mystifying me at first glance - LUFA should not be modifying it
unless you use the XMEGA USART driver in LUFA.
Cheers!
- Dean
On Oct 1, 1:47 pm, Peter <
peter.lonnebr...@gmail.com> wrote:
> Hello Dean & all group members,
>
> I'm wrestling with a problem on an ATxmega64a3u. I have lot's of code
> already working on it, so far using USARTS for serial communication.
> No pins left to use JTAG, I'm basically printf-debugging using my trusted
> serial ports.
> Since the usb-port will be used in the future (will at least add a
> boot-loader later), I thought now was the time to try adding a USB stack.
>
> I've added LUFA and code from the CDC (VirtualSerial) demo and it compiles
> just fine. Descriptors left unchanged, except for the vendor/model strings.
> I copied the small pieces of code from VirtualSerial.c needed for
> initialization and added the polling/processing to my main-loop.
> Connecting the device to my computer, all I get is
>
> The IOUSBFamily is having trouble enumerating a USB device that has been
> plugged in. It will keep retrying.
> The IOUSBFamily was not able to enumerate a device.
> The IOUSBFamily gave up enumerating a USB device after 10 retries.
> The IOUSBFamily was not able to enumerate a device.
>
> Fair enough; I start my printf-debugging routine—but now my debug serial
> port (USARTF0) is broken, no TX, but RX still works (I'm updating a
> 7-segment display based on data from the serial port).
> Since RX works, I guess the baudrate is correct, which means the system
> clock is still correct.
> Commenting out the "USB_Init()" call restores everything back to normal
> (and no IOUSBFamily-printouts in the log).
>
> The questions to all analytical minds out there is: a) why does the
> enumeration fail and b) why is USARTF0 affected by a call to USB_Init?
>
> Out of frustration, I tried ripping parts of the "monolith/XMEGA-USB" boot
> loader (which seem to have ripped parts of LUFA) and got the enumeration
> working with that, no problems whatsoever.
> Since I'd like to have the CDC code, I switched back to the full LUFA stack.
>
> Dean: I'm impressed by the amount of work you have put into this project as
> well as by the quality of the code. Great, great work.
> Once I get this up and running, I'll have no problems convincing my
> colleagues to purchase a commercial license.
>
> Kind regards,
> Peter
>
> (Btw; the board is of custom design, the xmega64a3u runs at 16Mhz using an
> external oscillator.)