Arduino Leonardo

668 views
Skip to first unread message

Michael Lewis

unread,
Sep 19, 2011, 1:03:09 PM9/19/11
to lufa-s...@googlegroups.com
I've seen announcements about this new ATmega32U4 Arduino board that state "The software on the board includes a USB driver that can simulate a mouse, keyboard and serial port".  This sounds like LUFA.  Is it?  I expected that if the Arduino group was including even a modified version of LUFA, they would be talking to you Dean.
Also, if this is the wrong place for a discussion like this, please point me to a more general LUFA forum.

Thanks,
Michael

Donald Delmar Davis

unread,
Sep 19, 2011, 8:22:20 PM9/19/11
to lufa-s...@googlegroups.com
I don't know why you would expect them to credit anyone.

They didn't credit either dean nor the original author of the code dean rewrote in the uno except in the code and then only the letter of the licensing requirements.

The arduino team was downright belligerent when the community complained about the ftdi versus a native usb base avr processors and they have consistently snubbed Paul Stoffregon's contributions to the code base.

On the other hand, the u4 is a good decision. (which Paul and several of us in the community made years ago).

Mebby we need a lufa blabber :)

Don.

> --
> You received this message because you are subscribed to the Google Groups "LUFA Library Support List" group.
> To post to this group, send email to lufa-s...@googlegroups.com.
> To unsubscribe from this group, send email to lufa-support...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/lufa-support?hl=en.

Zach Eveland

unread,
Sep 19, 2011, 10:03:15 PM9/19/11
to lufa-s...@googlegroups.com, ddelma...@gmail.com
Hi Donald,

I was involved in the development and testing of the Leonardo USB core
and it is new and not based on LUFA. The Arduino 1.0 RC1 (found here:
http://code.google.com/p/arduino/wiki/Arduino1 ) includes the core and
a single example so you can get a feel for it. There are a few
remaining issues to be fixed and a lot more examples to write and I'd
love to hear your feedback.

The 8U2 on the Uno does use LUFA but I'm not sure what your comment
means. Dean Camera was credited here:
http://arduino.cc/blog/2010/09/27/arduino-0020-released-for-windows-and-mac-supports-uno-and-mega-2560/
and, as required, in all code based on LUFA.

It's not fair or accurate to say that the Arduino team has withheld
credit from anyone or been anything less than aboveboard.

Best,
Zach Eveland

Paul Stoffregen

unread,
Sep 20, 2011, 11:20:00 AM9/20/11
to lufa-s...@googlegroups.com, Zach Eveland, Donald Delmar Davis
The Arduino developers have actually accepted some of my patches, though
many remain unused, even ones they specifically requested. Early on I
tried to submit every Teensy-related change (originally only a dozen
lines of code), but it quickly became clear they would not accept any
code related to 3rd party boards. Now I generally only submit patches
for things they request.

I don't really expect any special mention or credit, but they've usually
been pretty good about mentioning my name in the change logs and
sometimes even the release notes. But I usually assume very few people
really read that stuff anyway, especially (old) change logs in source
control systems. Likewise, old blog entries tend to never get any new
viewing. Then again, googling "Dean Camera site:arduino.cc" turns up
many pages.

Sometimes I've wondered how Arduino's commercial use of LUFA (they do
sell many boards at considerable profit) works with LUFA's commercial
attribution requirement? LUFA and Optiboot are the code that ships with
all current Arduino boards. Maybe merely having Dean Camera mentioned
in the source code is ok? As a quick experiment, I ran grep on all
1.0-rc1 files and found "Dean Camera" mentioned in comments within 11
source files and 2 makefiles buried inside the
hardware/arduino/firmwares directories, but nowhere else. I'm sure
there are mentions on the website, but the only ones I've seen are old
release notes and blogs. Then again, LUFA licensing is entirely between
Dean and the Arduino team, so they're happy then everything must be fine.

I downloaded 1.0-rc1, but couldn't find any mention of Leonardo. Maybe
you could take a look at 1.0-rc1 and point to the specific files? For
example, inside the hardware folder, there's only one boards.txt file,
and it doesn't mention Leonardo or 32u4. Likewise I couldn't find
anything in the examples hierarchy. Maybe I just looked in the wrong
places?

I am of course curious to see the Leonardo stuff, partly because it's
the first serious attempt to compete with Teensy, but mostly because I'm
curious about technical stuff. I'll be very interesting to see if
another entirely new USB AVR code base has been written?! My main
concern with Leonardo, using the same chip as Teensy, is possibilities
for terrible end-user-visible compatibility headaches. But only
learning of its existence at this very late stage, I fear there's little
I can do.


-Paul

Zach Eveland

unread,
Sep 20, 2011, 12:03:42 PM9/20/11
to Paul Stoffregen, lufa-s...@googlegroups.com
Hi Paul,

I'd be very happy to hear your thoughts on all of this.

> I downloaded 1.0-rc1, but couldn't find any mention of Leonardo.  Maybe you
> could take a look at 1.0-rc1 and point to the specific files?  For example,
> inside the hardware folder, there's only one boards.txt file, and it doesn't
> mention Leonardo or 32u4.  Likewise I couldn't find anything in the examples
> hierarchy.  Maybe I just looked in the wrong places?

The core files are in hardware/arduino/cores/arduino. The relevant bits are:
* USBAPI.h
* USBCore.cpp and .h
* USBDesc.h
* CDC.cpp
* HID.cpp
* plus a few changes in HardwareSerial, main.cpp, Arduino.h, and
pins_arduino.h (now located under the new variants/leonardo structure)

This is all subject to change, of course, but this should be pretty
close to complete.

The example is in libraries/Mouse. You are absolutely right about the
omission of a Leonardo entry in boards.txt. Sorry about that - I just
assumed it was in the RC. Nothing special added.

What sort of "end-user-visible compatibility headaches" do you
anticipate? Any way to mitigate them?

Zach Eveland

Paul Stoffregen

unread,
Sep 20, 2011, 1:36:57 PM9/20/11
to lufa-s...@googlegroups.com, Zach Eveland

> The core files are in hardware/arduino/cores/arduino. The relevant bits are:
> * USBAPI.h
> * USBCore.cpp and .h
> * USBDesc.h
> * CDC.cpp
> * HID.cpp
> * plus a few changes in HardwareSerial, main.cpp, Arduino.h, and
> pins_arduino.h (now located under the new variants/leonardo structure)

Thanks. I'm look at it now. I was looking at code pulled with git, and
this stuff isn't in git yet.

This definitely isn't LUFA!

The code has a very similar structure to my code for Teensy, but in a
nice C++ style. I particularly like your LockEP class
constructor/destructor. So much cleaner looking than my C-only code!

> This is all subject to change, of course, but this should be pretty
> close to complete.
>
> The example is in libraries/Mouse. You are absolutely right about the
> omission of a Leonardo entry in boards.txt. Sorry about that - I just
> assumed it was in the RC. Nothing special added.
>
> What sort of "end-user-visible compatibility headaches" do you
> anticipate?

Incompatible APIs for Keyboard, Mouse and other pre-defined C++ classes
is probably the biggest issue.

A secondary problem is 3rd party libraries which are ported to Teensy
using #ifdef checks on the CPU type. That's more difficult, since
Arduino doesn't provide any well defined way compile-time way for 3rd
party libraries and sketches to determine which board they are targeting.

Many libraries are already ported to Teensy. Most will probably "just
work" on Leonardo, but with their functions appear specific AVR pins.
Leonardo and Teensy assign the Arduino-defined pins very differently.


> Any way to mitigate them?

Yes. At the very least, I'd like to work together to sync our C++
"Keyboard" and "Mouse" APIs, probably by adding inline compatibility
functions. There is already a large base of code written for Teensy out
there, so you'll gain instant compatibility with that code. Long term,
I believe everyone benefits if code written for either board's API "just
works" on either.

This is getting pretty far off-topic for LUFA, since neither of us are
using LUFA's code. I'll contact you off-list about details.

Zach Eveland

unread,
Sep 20, 2011, 2:15:04 PM9/20/11
to Paul Stoffregen, lufa-s...@googlegroups.com
Thanks, Paul! It would be great to continue this offlist. One thing
to respond to publicly first:

> The code has a very similar structure to my code for Teensy, but in a nice
> C++ style.  I particularly like your LockEP class constructor/destructor.
>  So much cleaner looking than my C-only code!

I wish I could take credit but this code didn't originate with me.
I've been helping get the core ready for distribution but it was
created by a very smart guy named Peter Barrett.

Best,
Zach Eveland

Dean Camera

unread,
Sep 20, 2011, 10:08:11 PM9/20/11
to LUFA Library Support List
> The core files are in hardware/arduino/cores/arduino. The relevant bits are:
> * USBAPI.h
> * USBCore.cpp and .h
> * USBDesc.h
> * CDC.cpp
> * HID.cpp
> * plus a few changes in HardwareSerial, main.cpp, Arduino.h, and
> pins_arduino.h (now located under the new variants/leonardo structure)

Aha! I was looking for the new code, and couldn't find it in the GIT
tree - now I know why. I'll track down the code later and take a look,
and see if there's any significant innovations that might be useful to
me (as a reimplementation, of cource). It's disappointing to see
Arduino move away from LUFA in only one generation of hardware
revisions, but I understand that they need to more tightly integrate
the USB code with their custom platform to make it more useful to the
masses, and portable to the new expanded range of Arduino
architectures.

For the record, I am more than happy with the level of credit and
support given to me by the Arduino team; they paid for a LUFA
commercial license and have mentioned me several times, in press
releases, source code and technical talks. Regardless of my own
feelings of the actual platform, I think the Arduino team is nothing
less than a great credit to the open source community and I wish them
no will ill at all.

- Dean
Reply all
Reply to author
Forward
0 new messages