- If you're going to switch between
.USBSpecification = VERSION_BCD(01.10)
and.USBSpecification = VERSION_BCD(02.00)
and you're using a specific Windows driver (i.e. not HID, Mass Storage, etc.), then your device will only get installed properly until you reinstall that driver. Windows does not like having the USB specs of an existing device changed.
- The API changes quite a lot from release to release. Some would make a big deal out of it, but it really isn't. Just be careful that if you see an old LUFA guide, some of its calls might be obsolete. For instance some calls like
EVENT_USB_Device_UnhandledControlRequest
have been obsoleted.
- Stream serial debug output (printf) is easy once
- you use the following in your source:
#include <LUFA/Drivers/Peripheral/Serial.h> (...) Serial_Init(115200, true); Serial_CreateStream(NULL);
- you make sure that
$(LUFA_SRC_SERIAL)
is referenced in your makefile sources (SRC = ...
) along with$(LUFA_SRC_USB)
, as it is not included automatically.
- you use the following in your source:
- If you're getting undefined references to
Endpoint_Read_Stream_LE
and friends, you probably haveLUFA_OPTS += -D CONTROL_ONLY_DEVICE
defined in your makefile. Comment it out.
- On an AVR90USB162, there's only so much space that can be used for printf strings apparently, regardless of how much flash is being used. If you have too many serial debug statements, you may find that serial output is garbled until you eliminate some of them. Make sure you only use serial debug sparingly.
EVENT_USB_Device_ConfigurationChanged()
is NOT a good place to do serial debug output statement.
- If you are using multiple interfaces on Windows, you DO want to add a delay in
EVENT_USB_Device_ConfigurationChanged()
- Use NULL as last parameter in the EP R/W calls (eg.
Endpoint_Read_Stream_LE
), unless you want to open a big bag of hurt!
- If you're using the same endpoint number for IN and OUT (eg. 0x01 & 0x81), you need to use
Endpoint_SetEndpointDirection()
to toggle the direction after selecting the EP. Oh, and don't useENDPOINT_DESCRIPTOR_DIR_IN
orENDPOINT_DESCRIPTOR_DIR_OUT
, useENDPOINT_DIR_IN
andENDPOINT_DIR_OUT
instead.
2011-03-15
AVR development with LUFA - TILTHW
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment