Go Down

Topic: New Leonardo dropping USB (Read 1 time) previous topic - next topic

PoolRoom

Hi,

I have a new Leonardo, my first foray with Arduino. After running some simple example programs the device is dropping its USB connection. I have it plugged into a Raspberry Pi box, but the symptoms are identical if I plug it into a Windows 7 laptop.

The reset button or a power cycle just starts the up/down USB cycle again. The device comes up, power light is on, the orange activity light flickers quickly (almost solid) for a few seconds, and then the activity light goes off.

Any ideas what is causing this and how I can recover the device from this cycle?

Here's what the Linux syslog shows:

Code: [Select]
Aug 15 23:12:50 pimon kernel: [  137.175228] usb 1-1.2: new full-speed USB device number 5 using dwc_otg
Aug 15 23:12:51 pimon kernel: [  137.287565] usb 1-1.2: New USB device found, idVendor=2341, idProduct=0036
Aug 15 23:12:51 pimon kernel: [  137.287608] usb 1-1.2: New USB device strings: Mfr=2, Product=1, SerialNumber=0
Aug 15 23:12:51 pimon kernel: [  137.287623] usb 1-1.2: Product: Arduino Leonardo
Aug 15 23:12:51 pimon kernel: [  137.287637] usb 1-1.2: Manufacturer: Arduino LLC
Aug 15 23:12:51 pimon kernel: [  137.366697] cdc_acm 1-1.2:1.0: ttyACM0: USB ACM device
Aug 15 23:12:51 pimon kernel: [  137.371199] usbcore: registered new interface driver cdc_acm
Aug 15 23:12:51 pimon kernel: [  137.371234] cdc_acm: USB Abstract Control Model
driver for USB modems and ISDN adapters
Aug 15 23:12:58 pimon kernel: [  144.879957] usb 1-1.2: USB disconnect, device number 5



Here's the last code I was running on the Leonardo:

Code: [Select]
void setup()
{
  Serial.begin(9600);
  Serial1.begin(9600);
}

void loop()
{
  // read and reply port 0
  if (Serial.available())
  {
    int inByte = Serial.read();
    Serial.println("I received: ");
    Serial.println(inByte);
  }

  // read and reply port 1
  if (Serial1.available())
  {
    int inByte = Serial1.read();
    Serial1.println("I received 1: ");
    Serial1.println(inByte);
  }
}


That code was working and I could echo some characters over the USB serial connection with minicom on the Linux box. All was good... and now this...  :(

I've tried to get avrdude to run an erase on the device but the window of the USB being up just isn't long enough...

Code: [Select]
# avrdude -p m32u4 -c arduino -b 9600 -P /dev/ttyACM0 -e
ioctl("TIOCMSET"): Broken pipe
ioctl("TIOCMSET"): Broken pipe
avrdude: stk500_getsync(): not in sync: resp=0x3f
ioctl("TIOCMSET"): Broken pipe

avrdude done.  Thank you.



What do you think?

tf68

That's normal behavior, it won't change if you erase the program. That is the bootloader running and then shutting down. It should still show up in the IDE (and in the file system as /dev/ttyACM?). Does it? The IDE should be able to upload new programs (may have to push reset). With Linux the port may sometimes switch between /dev/ttyACM0 and /dev/ttyACM1 when the IDE invokes the bootloader(or you push reset). Just try again as it will usually switch back.

I think this is the correct avrdude command for the Leo. Remember to push reset so the bootloader runs.

avrdude -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600

PoolRoom

#2
Aug 16, 2014, 01:39 am Last Edit: Aug 16, 2014, 01:45 am by PoolRoom Reason: 1

That's normal behavior, it won't change if you erase the program. That is the bootloader running and then shutting down. It should still show up in the IDE (and in the file system as /dev/ttyACM?). Does it?


Unfortunately not. The USB port appears in Linux and about 7 seconds later it disconnects:

Code: [Select]
Aug 15 23:12:58 pimon kernel: [  144.879957] usb 1-1.2: USB disconnect, device number 5

Code: [Select]
$ ls -l /dev/ttyA*
crw-rw---T 1 root dialout 204, 64 Jan  1  1970 /dev/ttyAMA0


That happens if the IDE is running or not. This happens if connected to Windows or Linux too.



I think this is the correct avrdude command for the Leo. Remember to push reset so the bootloader runs.

avrdude -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600


Excellent! Thanks for that. I'll just need a stable connection to the Leo before that command can complete.

PoolRoom


I think this is the correct avrdude command for the Leo. Remember to push reset so the bootloader runs.

avrdude -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600


Thanks again for the correct command - it's got my Leo erased and ready to go again. I just needed to be quick and run it during the 7 second window when the USB port was available... and to run it at 57600.

I suspect I was seeing the same problem that's been covered, and much referred to, here:

http://forum.arduino.cc/index.php/topic,38112.0.html

Go Up