LUFA 090810 Released!

It’s been a long time coming, but I’ve finally released the next official LUFA package, for general download. This new release contains the largest number of LUFA changes to date, including new demos, new Device mode class drivers (for easy integration into user projects without having to learn all the low-level USB stuff), new features and, of course, many bug fixes. Thanks to everyone who have contributed towards this release, in donations, bug reports, feedback or anything else even tangentially related to getting this 65,000+ line lump of code out the door.

Major features of the new release include the new class drivers as indicated above (Host mode class drivers will be available in a future release), new automatic serial number descriptors on compatible hardware and new Printer Host, Benito Programmer and Missile Launcher demos/projects. There’s lots of other bits and pieces that make up this new release, which will be shown in the changelog at the end of this post. Still, while you’re reading that, download the code and documentation from the project page!

Now, this the the place where I’d normally put in my usual plea for donations, to support the project. After all, I am but a poor little lad struggling to finish a double University degree and all that, but this month I’ll be doing something different. If you enjoy the major LUFA changes in this release that I’ve been busy on for two months now, please donate to sponsor my girlfriend in the 40 Hour Famine event instead, with the money you would normally have sent me. The 40 Hour Famine is a yearly initiative of the World Vision charity, and helps raise money for the starving and underprivileged in Africa, and is a very worth cause.

If you wish to donate, please use the following link:

https://famine.worldvision.com.au/famine.cgi?a=SPONSOR_&pn=671043594

Or if you prefer PayPal, donations via the regular PayPal button on my site’s front page will also be sent to World Vision at the end of this month.
Sponsored money is tallied and at the completion of the event (I’ll be joining in on the famine, although not officially, to support my girlfriend as well) with all proceeds helping out people much worse off in the world than myself, so please give generously. I’ll post the total raised amount in a month’s time, once it’s all over. Show your appreciation of LUFA today, by doing something good!


LUFA Changelog, Version 090810

New:

  • Added new class drivers and matching demos to the library for rapid application development
  • Added new PrinterHost demo (thanks to John Andrews)
  • Added USB Missle Launcher project, submitted by Dave Fletcher
  • Added new Benito Arduino Programmer project
  • Added incomplete device and host mode demos for later enhancement
  • Updated MassStorage device block write routines to use ping-pong Dataflash buffering to increase throughput by around 30%
  • Error status LEDs shown when device endpoint configuration fails to complete in all demos and projects
  • Added new USB_Host_SetDeviceConfiguration() convenience function for easy configuration selection of devices while in USB host mode
  • Added new USB_Host_ClearPipeStall() convenience function to clear a stall condition on an attached device’s endpoint
  • Added new USB_Host_GetDeviceDescriptor() convenience function to retrieve the attached device’s Device descriptor
  • Added new Endpoint_ClearStatusStage() convenience function to assist with the status stages of control transfers
  • Added new USE_INTERNAL_SERIAL define for using the unique serial numbers in some AVR models as the USB device’s serial number, added NO_INTERNAL_SERIAL compile time option to turn off new serial number reading code
  • Added new DATAFLASH_CHIP_MASK() macro to the Dataflash driver, which returns the Dataflash select mask for the given chip index
  • Added new HOST_STATE_WaitForDeviceRemoval host state machine state for non-blocking disabling of device communications until the device has been removed (for use when an error occurs or communications with the device have completed)
  • Added new FAST_STREAM_TRANSFERS compile time option for faster stream transfers via multiple bytes copied per stream loop
  • Added stdio stream demo code to the CDC device demos, to show how to create standard streams out of the virtual serial ports
  • Added new EEPROM and FLASH buffer versions of the Endpoint and Pipe stream functions
  • Added new USE_FLASH_DESCRIPTORS and FIXED_NUM_CONFIGURATIONS compile time options
  • Added support for the new ATMEGA32U2, ATMEGA16U2 and ATMEGA8U2 AVR models
  • Added new USB_DeviceState variable to keep track of the current Device mode USB state
  • Added new LEDs_ToggleLEDs() function to the LEDs driver
  • Added new Pipe_BoundEndpointNumber() and Pipe_IsEndpointBound() functions
  • Added new DEVICE_STATE_AS_GPIOR and HOST_STATE_AS_GPIOR compile time options
  • Added 404 Not Found errors to the webserver in the RNDIS demos to indicate invalid URLs

Changed:

  • Deprecated psuedo-scheduler and removed dynamic memory allocator from the library (first no longer needed and second unused)
  • The device-mode CALLBACK_USB_GetDescriptor() function now has an extra parameter so that the memory space in which the requested descriptor is located can be specified. This means that descriptors can now be located in multiple memory spaces within a device.
  • Removed vague USB_IsConnected global – test USB_DeviceState or USB_HostState explicitly to gain previous functionality
  • Removed USB_IsSuspended global – test USB_DeviceState against DEVICE_STATE_Suspended instead
  • Extended USB_GetDeviceConfigDescriptor() routine to require the configuration number within the device to fetch
  • Dataflash_WaitWhileBusy() now always ensures that the dataflash is ready for the next command immediately after returning, no need to call Dataflash_ToggleSelectedChipCS() afterwards
  • Low level API MIDI device demo no longer blocks if a note change event is sent while the endpoint is not ready
  • Pipe_GetErrorFlags() now returns additional error flags for overflow and underflow errors
  • Pipe stream functions now automatically set the correct pipe token, so that bidirectional pipes can be used
  • Pipe_ConfigurePipe() now automatically defaults IN pipes to accepting infinite IN requests, this can still be changed by calling the existing Pipe_SetFiniteINRequests() function
  • Changed F_CLOCK entries in project makefiles to alias to F_CPU by default, as this is the most common case
  • Host mode demos now use sane terminal escape codes, so that text is always readable and events/program output is visually distinguished from oneanother using foreground colours
  • Internal per-device preprocessing conditions changed to per-device series rather than per-controller group for finer-grain internal control
  • Interrupts are no longer disabled during the processing of Control Requests on the default endpoint while in device mode
  • AudioOutput demos now always output to board LEDs, regardless of output mode (removed AUDIO_OUT_LEDS project option)
  • Removed SINGLE_DEVICE_CONFIGURATION compile time option in favour of the new FIXED_NUM_CONFIGURATIONS option so that the exact number of device configurations can be defined statically
  • Removed VBUS events, as they are already exposed to the user application via the regular device connection and disconnection events
  • Renamed and altered existing events to properly seperate out Host and Device mode events

Fixed:

  • Changed bootloaders to use FLASHEND rather than the existence of RAMPZ to determine if far FLASH pointers are needed to fix bootloaders on some of the USB AVR devices where avr-libc erronously defines RAMPZ
  • Fixes to MassStorageHost for better device compatibility (increase command timeout, change MassStore_WaitForDataReceived() to only unfreeze and check one data pipe at a time) to prevent incorrect device enumerations and freezes while trasferring data
  • Make Pipe_ConfigurePipe() mask the given endpoint number against PIPE_EPNUM_MASK to ensure the endpoint IN direction bit is cleared to prevent endpoint type corruption
  • Fixed issue opening CDC-ACM ports on hosts when the CDC device tries to send data before the host has set the line encoding
  • Fixed USB_OPT_MANUAL_PLL option being ignored during device disconnects on some models (thanks to Brian Dickman)
  • Fixed documentation mentioning Pipe_GetCurrentToken() function when correct function name is Pipe_GetPipeToken()
  • Fixed ADC driver for the ATMEGA32U4 and ATMEGA16U4 (thanks to Opendous Inc.)
  • Fixed CDCHost demo unfreezing the pipes at the point of configuration, rather than use
  • Fixed MassStorage demo not clearing the reset flag when a Mass Storage Reset is issued while not processing a command
  • Fixed USB_Host_SendControlRequest() not re-suspending the USB bus when initial device ready-wait fails
  • Fixed USB Pad regulator not being disabled on some AVR models when the USB_OPT_REG_DISABLED option is used
  • Fixed Host mode to Device mode UID change not causing a USB Disconnect event when a device was connected
  • Fixed Mouse/Keyboard demos not performing the correct arithmetic on the Idle period at the right times (thanks to Brian Dickman)
  • Fixed GenericHID failing HID class tests due to incorrect Logical Minimum and Logical Maximum values (thanks to Soren Greiner)
  • Fixed incorrect PIPE_EPNUM_MASK mask causing pipe failures on devices with endpoint addresses of 8 and above (thanks to John Andrews)
  • Fixed report data alignment issues in the MouseHostWithParser demo when X and Y movement data size is not a multiple of 8 bits
  • Fixed HID Report Descriptor Parser not correctly resetting internal states when a REPORT ID element is encountered
  • Fixed incorrect BUTTONS_BUTTON1 for the STK526 target
  • Fixed RNDIS demos freezing when more than one connection was attempted simultaneously, causing memory corruption
  • Fixed USBtoSerial demo receiving noise from the USART due to pullup not being enabled
 

Comments: 1

Leave a reply »

 
 
 

Hi Dean,

No comments yet? Don’t feel that we don’t care or appreciate the fantastic amount of work that has gone into this. On behalf of all LUFA users out there I’d like to thank you for your continued efforts in making this framework as great as it is. Looking forward to the updated host stuff now 🙂

Cheers,

Mike

 

Leave a Reply

 
(will not be published)
 
 
Comment
 
 

 

Vital Stats

  • 35 Years Old
  • Australian
  • Lover of embedded systems
  • Firmware engineer
  • Self-Proclaimed Geek

Latest Blog Posts

RSS