Go Down

Topic: Suggestion: A Better Leonardo Bootloader. (Read 11588 times) previous topic - next topic

pentius

The Leonardo with that 32u4 chip can only be programmed via the native USB connection because that's how the bootloader was written. The Micro and Lilypad USB are the same way. What would be nice would be a bootloader that would allow the option of programming it with an FTDI card to bypass the funny device driver that some Linux boxes lack. (I'm convinced that Ubuntu 10.04 was just a complete fluke of a distro)

I can do a Pro Mini with an FTDI card on my Linux box, as well as an UNO normally. But those 32u4 chips in Leonardos refuse to work or even be seen on my Linux boxes. That's why we need an option besides that USB connection. People have to seek out and install yet another device driver, configure it, and hope it doesn't conflict with all the other ones. These chips are simply exotic and Windows and Mac users always need the driver and a huge number of Linux users can't make it work.

Peter_n

Someone has probably already adapted the Optiboot bootloader for the ATmega32u4.
What about uploading via Bluetooth ? That needs also a serial port.

pentius

To load it onto the Leonardo, of course, you'd need an ISP device of some kind. Of course you can use an Arduino to burn that bootloader. That is, if THAT doesn't become a problem! But if you can use a Duemilanove as an ISP, you bypass the bootloader altogether, solving the 32u4's USB problem.

I so far havn't succeeded at using an Arduino as an ISP to program another one. Someone did by modifying the Makefile succeed at making a Leonardo an "UNO".

westfw

What about someone fixes the problems you're having with the current bootloader, instead?

They're likely to be timing-related; when you hit the "upload" button, the chip resets itself, which causes the USB device (from the core libraries) to go 'offline'; then it VERY QUICKLY shows up again as a slightly different device (the bootloader) in approximately the same "place."  It wouldn't surprise me if that confused some systems.  (there was a slightly-related bug that showed up using the optiboot makefiles to program chips using the "dragon" programmer.)

Can you be more specific about the exact configuration of the linux system you're having trouble with?  I didn't see lots of "me too" responses to your complaints, which implies that it's not that common (or perhaps using trying to use leonardo with linux isn't that common to start with.)  Do you have any other systems that you can use for comparison (it would be great, for example, to have a windows box that could talk to the leonardo running linux in a VM that COULDN'T.)

pentius

There are not a lot of Linux users compared to Windows or even Mac users. That might explain comparatively few "meeeetoooo" complaints. I'm using Ubuntu and previously I discussed the problem in the forum about Arduino itself, and the thread is there. I tried each of the suggestions until I plain gave up on trying to use the original USB method. The other participant suggested at the end that my Linux box is probably hosed. That was when I gave up.

I started a thread in the Microcontrollers forum about a failed attempt to use a Duemilanove as an ISP. I was testing it with an UNO as the target but it failed. I have to make it work on something first before I try the (dreaded) Leonardo. Since the Leonardo has no option except the hosed USB or using an ISP, that's why I suggested that an FTDI option be added to the bootloaders on those things.

PeterVH

I have used my Leonardo on kubuntu 10.04, on 12.04 LTS and on debian Wheezy. It proved very reliable on all of them.

I just noticed your thread "Re: 1.5.6r2 SEE  Leonardo, but still can't program it." I think you should investigate the original problem more systematically. I'll post some suggestions over there.

pentius

Thanks. Next stop: My original thread...

bperrybap

I use leonardo on Linux Mint 13.
(Not the Official one but the Itead Loenardo).
I'm assuming it uses the same bootloader.
The only issue that I have is that because of the way the bootloader works, the virtual comport
device sometimes shifts around.
This can create some issues when trying to connect to the serial monitor after unplugging and
plugging it back in after uploading since the tty device name will shift/change
but other than that it seems to work just fine.

--- bill

pentius

I bought a Linux magazine with a Mint 17 album. I fired it up to a live boot from the album and immediately checked the /dev dir. Maybe your Mint 13 works, but not THAT Mint 17 album!

bperrybap

What do you see in the message log?
I see this when I plug in the Leonardo:
Code: [Select]
[11351.468111] usb 3-1: new full-speed USB device number 5 using ohci_hcd
[11351.643453] cdc_acm 3-1:1.0: This device cannot do calls on its own. It is not a modem.
[11351.643500] cdc_acm 3-1:1.0: ttyACM0: USB ACM device
[11351.654473] input: Arduino LLC Arduino Leonardo as /devices/pci0000:00/0000:00:12.0/usb3/3-1/3-1:1.2/input/input14
[11351.654955] generic-usb 0003:2341:8036.0005: input,hidraw3: USB HID v1.01 Mouse [Arduino LLC Arduino Leonardo] on usb-0000:00:12.0-1/input2


I'm running 32 bit Mint 13 mate.

The Teensy boards also use the CDC class driver as well and I've been using Teensy boards
for years back to 2009 on nearly every version of Ubuntu up until they created Unity which is
when I bailed on Ubuntu and switched to Mint.

--- bill

pentius

I tried a sudo modprobe cdc_acm then rebooted, and no ttyACM0. I tried a dmesg, and no ACM clues at all. I guess Ubuntu stopped supporting Leonardo-type chips after 10.04. Hold on to your Mint 14!

A similar but easier problem occured to me with a Wifi dongle. An old Ubuntu version worked out of the box but a later version needed a modprobe to get it to work. Other times, I've seen "supported" devices that NEVER worked no matter what I did. So, we know that the 32u4 chips work with:

Ubuntu 10.04 (from this site itself)
Mint 14

Any others with distros that worked?

You may list your distro but also describe the hack needed. (apparently in most cases)

bperrybap

#11
Oct 02, 2014, 03:31 am Last Edit: Oct 02, 2014, 03:33 am by bperrybap Reason: 1
I'm not having any issues on my Mint13 32 bit mate.
I just downloaded Mint17 32 bit mate and "out of the box" when live booted off of flash drive
it sees the Itead Leonardo and creates the ACM tty device just like Mint 13.
I booted an old Ubuntu 11.10 and it works with the same system log messages as well.
A few years back, I used Ubuntu 10.04 for quite a while with Teensy which
also used the USB CDC class driver and it also worked.

If you ever used ISP on your Leonardo the bootloader is gone and
boot loading from USB will never work again, until you re-install the bootloader
since the bootloader  contains the USB interface code.
Without the bootloader, the Leonardo will not enumerate so it will never be seen
by the host.

Do you see the Leonard show up with lsusb?
If not, then I think your bootloader or the AVR itself is toast.

--- bill

pentius

I have 2 Leonardos, one of which has no headers. The header-free one cannot be programmed by ICSP because I can't solder anything that small, so its bootloader HAS to still be good. (I don't have a Lilliputian welder as a friend) The other, a copycat, I did try it as it has a full compliment of headers. Neither works, and both are unseen by lsusb, dmesg, etc.

I even tried to use ICSP to do an UNO but the UNO and its bootloader survived the attempt, so the attempt was in fact a fail.

bperrybap

Interesting thing just happened to me.
I plugged in the Leonardo and nothing. It didn't even enumerate.
I plugged in my Teensy and nothing. Not even power.
The USB to mini usb cable I had been using for about a year just failed.
Swapped it out for a different cable and everything is working again.
Have you verified that the USB cable you are using is good?


--- bill

pentius

I just tried swapping the cord and no dice. The thing gets power with either cord and the 3.8.x kernel is blind to it. Which kernel is your 10.04 using? Did you have to do anything to get the Leonardo to work? (besides replacing the cord last night) I won't even try a Teensy or other weird-duino. The RFDuino is not supported at all by Linux as I found out the hard way. ONE person did make it work - by using WINE! Talk about a headache! Maybe I should ask that guy about the Leonardo problem. He could probably do it blindfolded.

Go Up