Leonardo on OSX - not in sync when uploading

I actually posted it at the end of the last page :slight_smile:

FalconFour:

void setup() {

Keyboard.begin();
}

void loop() {
 Keyboard.press(KEY_LEFT_GUI);
 Keyboard.write('r');
 Keyboard.release(KEY_LEFT_GUI);
 delay(500);
 Keyboard.println("notepad");
 delay(500);
 Keyboard.println("I am a banana!");
 delay(random(1000,3000));
 Keyboard.press(KEY_LEFT_ALT);
 Keyboard.write(KEY_F4);
 Keyboard.release(KEY_LEFT_ALT);
 Keyboard.write('n');
 delay(random(1000,10000));
}

"Keyboard.write()" was just "Keyboard.print" before. I think mellis nailed it: since definitions are "translated" into their raw definition name (that is, "#define KEY_F4 123" will turn the characters "KEY_F4" into the characters "123" in the code, not necessarily "the value which is 123")... still strange that it would try to punch the characters "123" as a string via the definition without being quoted in the definition. If that makes any sense. checks include files...

edit: Hmm... nothing unusual there. Quoth USBAPI.h:

#define KEY_F4				0xC5

... which is about as well-defined as it gets.

Oh, I know what it was doing. It was taking it as an integer value to be keyed out as a character string. Derp. I think I ran into that problem long ago, but hey... like I said, a bit rusty. Mystery solved. :*

FalconFour:
still strange that it would try to punch the characters "123" as a string via the definition without being quoted in the definition. If that makes any sense.

Not really. If you wrote this:

Serial.print (123);

Wouldn't you expect to see "123" printed? Not some character equivalent.

This is my first post! Bought the Leonardo at the Maker's Faire. Saw forum problems with 1.0 IDE after I had a series of failures on two different Windows machine; I will not try 1.01.

Thanks - Rick

With IDE 1.01 I was able to connect to the USB port and load "Blink." I'm new to Arduino, so I'm not sure if this is the right program for testing...

Here is the error message I received:

Binary sketch size: 4,858 bytes (of a 28,672 byte maximum)
Found programmer: Id = "SpŸ"; type = p

  • Software Version = V.O; Hardware Version =v.0*
    avrdude: error: buffered memory access not supported. Maybe it
    isn't a butterfly/AVR109 but a AVR910 device?

I am running Windows XP home, Service Pack 3, USB 1.0

Any suggestions on what to do next?

Thanks - Rick
By the way, the Leonardo R3 board says it is made in Italy.

Yeah, there seem to be a lot of glitches in the upload process with the current firmware (bootloader)/IDE. I've had it literally crash my computer twice by rapidly inserting/holding/removing devices during the reboot cycles. I've learned one important lesson: don't hold "Reset" - ever. Common to halt a runaway program until I can reprogram it (without device-cycling the USB connection with a plug/unplug), but it's a reliable way to totally hang the USB bus on the Leo.

I found that the most reliable way to upload is to make sure the program IS RUNNING when it goes to upload. It has no fall-backs or intelligent detection, it seems, for checking if the board is already waiting at the bootloader, so when the LED is "pulsing" and it tries to upload, it just goes "herrr, dohh... timeout", starts running the program while avrdude is still trying to contact the board (or Arduino is trying to find the port), and it wonders why it can't find the board.

Beta blues, I guess. No hard feelings. I'm having tons of luls with the best $20 I'd ever spent :slight_smile:

open_market: the Leonardo isn't supported under 1.0; you don't have to try 1.0.1 if you don't want, but that's the only version that supports the board.

FalconFour: thanks for all the information. It's a good point about not starting an upload when the bootloader is already running; I'll add that to the getting started page for the Leonardo. On the other hand, holding down the reset button should be okay (at least, it's always worked for me). If I'm having problems uploading normally, I'll hold down the reset button, wait for the IDE to say "Uploading..." and then release the button. Can you provide some more details about the problems you're having with holding the button down (e.g. when are you doing it, what exactly happens, which operating system you're using, etc)?

I understand 1.0 is not supported. Once I tried 1.01, the usb driver started working. The error I reported when trying to upload the Blink application was using 1.01.

I just tried it again holding down the reset button until compile was complete and upload started - I got the same identical error message:

Found programmer: Id = "SpY"; type = p
Software Version = V.O; Hardware Version = v.)
avrdude: error: buffered memory access not supported. Maybe it
isn't
a butterfly/AVR100 but a AVR910 device?

Where do I go from here?

Thanks - Rick

open_market: Thanks for writing. It looks like you might have the wrong serial port selected in the Arduino IDE. Your "Found programmer: Id = "SpY"; type = p Software Version = V.O; Hardware Version = v.)" message indicates that the upload software is getting a response from some device on the port, just not a Leonardo (or any other Arduino).

Can you double-check the port that you have selected under "Serial Port" in the menu? To find the correct port, start by disconnecting the Leonardo and looking at the list of available ports. Then connect the Leonardo, wait for the LED to stop "breathing", and see what new port you have available - that will be your Leonardo.

If that doesn't work for you, can you please enable verbose output during upload in the IDE preferences and paste the eror message you receive?

mellis:
FalconFour: thanks for all the information. It's a good point about not starting an upload when the bootloader is already running; I'll add that to the getting started page for the Leonardo. On the other hand, holding down the reset button should be okay (at least, it's always worked for me). If I'm having problems uploading normally, I'll hold down the reset button, wait for the IDE to say "Uploading..." and then release the button. Can you provide some more details about the problems you're having with holding the button down (e.g. when are you doing it, what exactly happens, which operating system you're using, etc)?

Basically what happens is that it hangs the whole PnP interface of the PC, to where no devices can no longer be detected added or removed (USB, ExpressCard, etc), and devices can't be disabled/enabled anymore either - doing so just hangs the process making the attempt. In fact the computer won't even shut down anymore, it just hangs at "Logging off" or "Shutting down" (depending on how long I wait - over 10 minutes at "Shutting down"). I can plug/unplug anything, and Windows no longer detects anything is being plugged/unplugged. Of course, when I reboot (holding the power button, ugh!), everything goes back to normal again.

It's Windows 7 32-bit on a Dell XPS m1710 (Intel-based chipset). I do have VMware Workstation installed which uses a "USB Arbitration service" to manage virtual USB connections, so I'm not sure if that's to blame.

Usually it happens after I've failed to upload a few times, sitting at the bootloader attempting to upload. Maybe I hit and held Reset while it was attaching the device, and it hung during the "initialization" which crashed the USB driver. Not sure, but it always seems to revolve around having held "Reset" down.

Zeveland,

My Leonardo is on COM4 - which I set in the IDE 1.0.1, with verbose mode here is the result:

Binary sketch size: 4,858 bytes (of a 28,672 byte maximum)
Forcing reset using 1200bps open/close on port COM4
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, COM4, } => {}
PORTS {COM1, COM3, COM4, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, } => {}
PORTS {COM1, COM3, } / {COM1, COM3, COM4, } => {COM4, }
Found Leonardo upload port: COM4
C:\Downloads\arduino\arduino-1.0.1\arduino-1.0.1-windows\arduino-1.0.1\hardware/tools/avr/bin/avrdude -CC:\Downloads\arduino\arduino-1.0.1\arduino-1.0.1-windows\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega32u4 -cavr109 -P\.\COM4 -b57600 -D -Uflash:w:C:\DOCUME~1\Rick\LOCALS~1\Temp\build6743039881646635356.tmp\Blink.cpp.hex:i

avrdude: Version 5.11, compiled on Sep 2 2011 at 19:38:36
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Downloads\arduino\arduino-1.0.1\arduino-1.0.1-windows\arduino-1.0.1\hardware/tools/avr/etc/avrdude.conf"

Using Port : \.\COM4
Using Programmer : avr109
Overriding Baud Rate : 57600
AVR Part : ATmega32U4
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :

Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 10 8 0 no 1024 8 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


flash 65 6 128 0 yes 32768 128 256 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : butterfly
Description : Atmel AppNote AVR109 Boot Loader

Connecting to programmer: .avrdude: Send: . [1b]
avrdude: Send: S [53]
avrdude: Recv:

avrdude: Recv:
avrdude: Send: V [56]
avrdude: Recv:
avrdude: Send: v [76]
avrdude: Recv:
avrdude: Recv:
avrdude: Send: p [70]
avrdude: Recv:
Found programmer: Id = "¨ÿ""; type = m
Software Version = E.

Tanks - Rick

Just replied to open_market in the new thread....

FalconFour: it sounds like you've got your original issue solved, but this new thing with manual reset causing problems is a little troubling. I'd be inclined to blame the virtualization service - I've seen some funny behavior with VMWare Fusion running (though only on the virtualized machine, not the host). Can you shut down the service, boot natively into the other OS, or do anything else to isolate virtualization as contributing to the problem?