Arduino Leonardo not working. Maybe bricked?

Hi. Some days ago, I borrowed a teacher's Leonardo to test a sketch for a project. The thing is that when I loaded my sketch, all PCs stopped detecting the Arduino. Sometimes, LED on pin 13 turns on but if not, just ON LED turns on.
I've got a Raspberry Pi so I thought I could use avrdude to flash Caterina to the Arduino through GPIO but it threw me an error like device is not responding. I spent a lot of hours with it but no success.
I hope you guys could help me because this Arduino is not mine, and here in Argentina it's quite expensive (yeah, love my country...) and Leonardos are not so famous. You can find UNOs or MEGAs easily, but not Leonardos.
Thanks in advance!

P.S.: I'm still learning English. Hope I've explained things correctly.

Does the L LED pulsate when you press and release the reset button on the Leonardo? If so, that means the bootloader is OK. Sometimes a sketch can cause the Leonardo to have difficulty uploading a new sketch, if the sketch uses mouse or keyboard functions or if it runs out of memory or has some other malfunction. Try these things:

  1. You can often recover from this by uploading a simple sketch such as blink, and press and release the reset button to make the bootloader run when the IDE changes from Compiling to Uploading.

  2. If #1 didn't help, open the blink sketch in the Arduino IDE so you have a simple sketch ready to upload.
    Press and release the reset button and when the L LED starts to pulsate, go to the Arduino IDE Tools, Port menu and select the Leonardo's port.
    Then upload the blink sketch.
    When the IDE changes from Compiling to Uploading, press and release the reset button.

  3. If #1 and #2 do not work, or if the L LED does not pulsate when you press and release the reset button, you should use another Arduino such as an Uno or Nano to program a fresh bootloader on the Leonardo. The ArduinoISP sketch running on the other Arduino will make it a programmer to do that job. Select in the Tools, Programmer menu "Arduino as ISP". Or you can also use a programmer device such as USBasp to burn the bootloader onto the Leonardo. If you don't know about using an ISP programmer or using another Arduino as a programmer, or burning a bootloader, I suggest get your teacher's help, because he or she is probably familiar. It is nothing to be overly worried about, because sometimes Leonardo's are sensitive and malfunction like this.

I forgot to mention, make sure first to try a different cable, and make sure you're not using a charge-only cable, which is common for some wireless phones and other devices.

dmjlambert:
I forgot to mention, make sure first to try a different cable, and make sure you're not using a charge-only cable, which is common for some wireless phones and other devices.

Have you installed a spy cam in my workshop? :blush:

Yes, I ran into this the other day; Windows did not want to recognise my board so I swapped the cable and all was well. I have since marked my 'charge-only' cables with a red cable tie around the micro/mini plug end so I know in future. SO annoying.

Hi dmjlambert. If I press reset button it does nothing, but if I reset it through reset pin (to ground) L LED starts pulsating. I haven't tried on Windows yet, but with Raspberry Pi I couldn't flash anything through ICSP. When I get home, I'll try with that and then I'll tell you.

The reset button connects the reset pin to ground, or it should....

It should, but it doesn't, hehehe... I got home and tried. Hopefully, everything worked just fine! So, thank you everyone, specially dmjlambert who gave me the actual solution (reset and flash empty or blink sketch through Windows). The problem was that I ran out of memory because of a really big array. Now, I've fixed it and everything is working as expected (except the reset button, but I really don't care).
Thanks again!

I was pulling my hair out with this problem all morning. eventually, some combination of double clicking the reset button and uploading a simple sketch got it to work. The symptoms i was seeing were exactly the same. No blinking L button, no board recognized, etc.

A few years late to the party, but I figured I'd just add this info here.