LUFA Open Source USB Stack Now For NXP ARM Processors

Looks like the Lightweight USB Framework for AVRs (LUFA) has just been ported for ARM microcontrollers. NXP recently released a package for their LPC Cortex M3 family of ARM controllers. You won’t find a reference to LUFA on their nxpUSBlib description page (which we think is kind of sad), but if you grab a copy of the beta code the Version.h header file shows that it is indeed a port of the project. This is further backed up by the LUFA creator, [Dean Camera], who consulted with the NXP team doing the work.

The package provides an open-source USB stack that you can use in your projects as a USB host or USB device. We’re advocates of open source packages like this one as it makes it much easier for hobbyists to get help using the tools, and it allows the community to give back through bug fixes and feature additions.

We’ve highlighted a few LUFA projects, like this keyboard remapper and this AVR programmer. We’re looking to seeing the first set of NXP LUFA projects roll through!

[Thanks Johnny]

13 thoughts on “LUFA Open Source USB Stack Now For NXP ARM Processors

  1. Another option is the NXP LPC 1342 which has on-chip USB HID.

    If you want to use USB for something low-bandwidth, this is a great option since it saves a few precious KB for program memory. The best part is that there are already HID drivers written for Windows, Linux and some phones so you don’t have to write your own custom driver for each device.

    1. The LPC134x parts, like the other micros supported by LUFA, implement the hardware and low-level functions of a complete USB device, which is not restricted to the HID profile. HID is a limited class of USB device intended for low-speed input devices (hence the name.) Lots hobbyists mistakenly think that HID is the way to connect a micro to your Mac/PC/Phone but in general this is not true.

      Other microcontrollers support being both a USB device or their own USB host (so other USB devices can connect to them.) USB On-The-Go (where it can auto-negotiate a host or device role) is another available implementation.

      1. True. USB HID is only good for low-bandwidth applications.

        It was the perfect choice for us since it was fast enough for our application and we didn’t have to develop drivers for a bunch of operating systems.

        I wasn’t familiar with LUFA before, but it looks like a pretty robust library. Definitely something to keep in mind for future reference.

    2. Note that you don’t need to “develop drivers for a bunch of operating systems” either way, since that’s what libusb is for. A simple libusb_open_device_with_vid_pid(), libusb_claim_interface() and voila, you can do libusb_bulk_transfer() to your heart’s content. I’d almost say that this might even be easier than doing whatever you need to do to (ab)use the HID protocol on your target platform. Unless, of course, you actually want to deliver keystrokes, mouse movements, or similar things that are directly supported by the OS already.

  2. LUFA is an amazingly clean and easy to use library that out-strips any of the closed source/semi-free (as in not free speech) libraries I have used. The more targets it’s ported to the merrier in my opinion. Also Dean provides personal support to developers which is second-to-none. Nice to see it moving to other platforms!

    1. It takes care of the basic, common functionality of a USB device and allows you to focus on implementing the part that is unique to your product. USB devices operate by sending or receiving chunks of data to/from the host, providing ‘methods’ to be invoked on the device (not unlike a software library or web API) and, in some cases, signalling the host when events happen. This is the stuff you implement that makes your device what it is.

  3. If it’s the same stack that NXP presented at ARM TechCon earlier this month, it’s a library that lets you use the NXP ARM chips that have USB hardware as various USB devices, with little more than “I want to be a Mass Storage device, here are the functions that source and sink data.” Looked cool; almost too easy. Apparently this will be in ROM on the newer USB-capable chips.

  4. Someone has a strange definition of “opensource”, it’s for NXP processors ONLY.
    The license reads:
    “Permission to use, copy, modify, and distribute this software and its documentation for any purpose is hereby granted without fee, provided that it is used in conjunction with NXP Semiconductors microcontrollers.”

    1. there is nothing strange about that.

      the source is open. that’s what “open source” implies. you are making the (common) mistake of confusing openly available source code with an unconditional and/or completely free licensing model.

      1. It’s not a “common mistake” to say that open source implies free licensing. It’s actually a widely accepted meaning, and the meaning intended by the people who originally coined the phrase, even though it’s not what the words literally say.

Leave a Reply to Simon InnsCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.