{SOLVED} Can't upload on new Arduino Micro

Hello,

Out of the box, I can't send any sketch to my Arduino Micro.

I tested on OSX, 2 Win XP and 1 Win8.

On all OS, the board apear in Tools>Port (and I select it).

OSX turn into Kernel Panic on upload. On Windows, without manual reset, i get the following message :

avrdude: ser_open(): can't set com-state for "\\.\COM6"
avrdude: ser_send(): write error: sorry no info avail
Problème de téléversement vers la carte. Voir http://www.arduino.cc/en/Guide/Troubleshooting#upload pour suggestions.

With manuel reset procedure (press and hold down reset, hit upload, when "Uploading..." shows up, release reset button), no error message. The progress bar simply disepear.

The power LED on the back is always on.

When Micro boots, the RX Led blink once or twice, never more.

The sketch I try to upload is the blink example.

I tried to install C:\ProgramFiles\Arduino\drivers\dpinst-x86.exe, no changes.

A first powering the board, the 13 PIN LED was blinking. Since my first upload attempt, nothing works.

Is my card is dead? Or is there solution to make it work?

Thanks for your help.

LeyryHynemonth: A first powering the board, the 13 PIN LED was blinking. Since my first upload attempt, nothing works.

Pin 13 no longer blinks?

It sounds like something changed the scrip on the micro, and/or broke it.

Do you have another arduino that will still upload script?

was there any electrical problems or other unusual things that happened during the upload? Lightening storm, etc. ?

Hy,

[quote author=James C4S link=msg=2461674 date=1446515970] Pin 13 no longer blinks? [/quote]

No. It was blinking before my first attemps to upload my project sketch (I suppose the shipped sketch is the blink example).

[quote author=jack wp link=msg=2461680 date=1446516569] It sounds like something changed the scrip on the micro, and/or broke it.

Do you have another arduino that will still upload script?

was there any electrical problems or other unusual things that happened during the upload? Lightening storm, etc. ?

[/quote]

My Arduino Uno still works with my project sketch or with the blink sketch example. But I prefer use the Micro for the final sketch that will run - I hope - 1 to 5 days.

At first upload, nothing special. No lightening storm, no Kernel Panic.

LeyryHynemonth: My Arduino Uno still works with my project sketch

You could try using the Uno as an ArduinoISP to reprogram the bootloader on the Micro.

Hy,

Do you mean this : https://www.arduino.cc/en/Tutorial/ArduinoISP ???

Isn’t it risky ? For the working Arduino Uno ?

What if I forget to put a 10 uF capacitor between reset and ground ?
(I have another Arduino Uno that seems to be dead)

LeyryHynemonth:
Isn’t it risky ? For the working Arduino Uno ?

Risky compared to what?

LeyryHynemonth:
What if I forget to put a 10 uF capacitor between reset and ground ?

It won’t work.

The capacitor holds the Uno (the board acting as the programmer) in RESET. Without it, the board will get auto-reset by the PC.

[quote author=James C4S link=msg=2462539 date=1446576904] Risky compared to what? [/quote]

I do not want to kill the last functional Arduino board that I have !

I test this as soon as a video conversion ends on my computer. (Kernel Panic... Kernel Panic... Don't Panic ...)

Attach the capacitor after loading the ArduinoISP sketch on the Uno. The striped or negative lead goes to ground. The wiring shown in the https://www.arduino.cc/en/Tutorial/ArduinoISP tutorial is only correct for ATmega328P-based target Arduinos and wrong for everything else. They should have shown using the ICSP header, which would be correct for most Arduinos.
uno2micro icsp_bb.jpg

dmjlambert:
Attach the capacitor after loading the ArduinoISP sketch on the Uno. The striped or negative lead goes to ground. The wiring shown in the https://www.arduino.cc/en/Tutorial/ArduinoISP tutorial is only correct for ATmega328P-based target Arduinos and wrong for everything else. They should have shown using the ICSP header, which would be correct for most Arduinos.
uno2micro icsp_bb.jpg

Thanks a lot, both of you.

Dmjlambert, no power to the Micro ?

The power is in the ICSP header, the top right and bottom right pins of the header are VCC and GND.

I did not found a capacitor.

And it is not so bad : i made some other attempts to write the blink sketch onto the Micro.

After a Kernel Panic and a others red lines, surprisingly, it is back to life !

Tomorrow, I will try to find a capacitor at work, because i'm sure it will not last...

Thanks for the help !

Hoho.

Actually, it is my project sketch that makes the Micro sick. It is dead. Again.

:(

Compile. Reset and just after upload. And it is alive.

My brain just cross some informations.

Micro has same processor for USB and running sketch.

My sketch put the board asleep as quick as possible.

Upload does no generate interruption that wake up de board.

So... if the board is sleeping (and it is most of the time), no upload !

(Yes, i suck)

That was an excellent thing to learn. The auto-reset functionality of the USB bootloader connection requires the processor to watch for the baud rate to be switched to 1200 briefly, and so the processor does need to be running. It is ok for you to have a sketch which puts the processor to sleep, now you will just have to be aware of this characteristic of Leonardo-type Arduinos when used with the typical Caterina bootloader. If your sketch did not put the processor to sleep, and it had a defect such as a memory leak, you would have the same problem with auto-reset.

In such a case, I believe that if you hit the reset button, it will process the upload. Am I correct on that assumption?

Yes, correct, it should. The Caterina bootloader runs for 8 seconds after releasing the reset button. I have managed to upload misbehaving sketches to my Pro Micro and Leonardo boards and in some cases it was very difficult to get the timing right for the manual reset button pressing. (edit - I don't know why it is sometimes difficult, and the OP of this thread said in the first post he tried it). I don't fool with it too much, usually I just use another Arduino as an ISP programmer and burn a fresh bootloader on it. I keep a programming cable around, similar to what Nick Gammon shows on his bootloader page. It is also possible to just upload sketches via ICSP, or to use the Optiboot bootloader with an external serial converter so I have a more Uno-like upload experience (here).

Thank you for your help.

Now, I can upload my project's sketch onto the Micro.

What make the difference is the way i try to upload the sketch : I hit compile, check the model and port are correct in tools menu.

Then, I press Upload button with one hand, and hit reset button juste after with the other hand.

And of course, I modified the loop function to avoid falling in sleep during 5 first seconds.