Problem uploading to Arduino Micro (hangs on Uploading...)

Hi

I am unable to upload to my Arduino Micro anymore, it compiles the sketch and then just hangs on "Uploading..."
Then after few minutes i get an error (Please check attachment for error).

It worked until i uploaded this sketch :

void setup()
{
   // initialize serial communication with computer:
   Serial.begin(9600);                   
   // initialize all the readings to 0: 
 
}

void loop() {
  SmoothSensorReading(0,10);
  SmoothSensorReading(1,10);
  
Serial.println("Restarting while...");   
// delay(500);        // delay in between reads for stability            
  
}

void SmoothSensorReading(int pinNr, int Samples) {
  float readings[Samples];      // the readings from the analog input
  int index = 0;                  // the index of the current reading
  float total = 0;                  // the running total
  float average = 0;                // the average
  
  for (int thisReading = 0; thisReading < Samples; thisReading++)
     readings[thisReading] = 0;          
     
  do 
  {
   // subtract the last reading:
   total= total - readings[index];         
   // read from the sensor:  
   readings[index] = (5.0 * analogRead(pinNr) * 100.0) / 1024;
   // add the reading to the total:
   total= total + readings[index];       
   // advance to the next position in the array:  
   index = index + 1;                    

   // if we're at the end of the array...
   if (index >= Samples) {             
   average = total / Samples;         
   // send it to the computer as ASCII digits
   Serial.print("Average for pin : ");
   Serial.print(pinNr);
   Serial.print(" = ");
   Serial.println(average);   
  }
     
} while (index  < Samples);

}

I have attempted the following :

  • Reset the device with the button
  • Opened up baudrate 1200 and closed it which cause the device also to reset.
  • Removed the device from device manager and reinstalled it.

When i reset the device the correct behavior is seen.
First the bootloaded shows up port 14, then it dissapears and the micro shows up port 13.

When i open up the dev environment and go to Serial Monitor i can see the last program i uploaded (code above ^^) running.
I have attempted to load the Blink sample under the basics menu.

I have also read the troubleshooting page but this didnt help me.

I have attached the error from the IDE.

I had Arduino IDE version 1.5.5 now i installed 1.5.6-r2 this did not fix my problem.
The error persists.

When i press upload the RX led blinks approx 5-6 times then nothing
The TX does not blink.

I have just attached another board i have Mega 2560 and i could upload without problems the blink sample.
So i think a communication error on the PC end is excluded from being the source of the problem?

Please someone help me i have been browsing the web all days trying avrdude, which i cant get to work properly.
the error

avrdude: error: buffered memory access not supported. Maybe it isn't

is spread arround the web but there is no solution.

I have been using this Micro for 2 weeks without problems the problems started after uploading this sketch.
i am still able to upload to my Mega 2560
I have tried different cable, usb 2.0/3.0 slot, another PC

NOTHING WORKS

please help me!

1 Like

Well here we go !

I found a solution, after spending a day googeling.
And I am going to share this with you because it has driven me crazy!

Press the upload button on the ide, wait for program to compile, when it start uploading instantly press the reset button.
Upload will be succesfull, program will be cleared, then upload blink it works, tadaaaaa

I really hope this helps somebody in the future!
If it does, click the karma button or smthn

Grtz

3 Likes

Hi again...

It's official now, i can re-produce the behavior i have with uploading this code on the Arduino Micro :

void setup()
{
   // initialize serial communication with computer:
   Serial.begin(9600);                   
   // initialize all the readings to 0: 
 
}

void loop() {
  Serial.println(SmoothSensorReading(0,500));
  Serial.println(SmoothSensorReading(1,500));
  
Serial.println("Restarting while...");   
// delay(500);        // delay in between reads for stability            
  
}

float SmoothSensorReading(int pinNr, int Samples)  {
  float readings[Samples];      // the readings from the analog input
  int index = 0;                  // the index of the current reading
  float total = 0;                  // the running total
  float average = 0;                // the average
  
  for (int thisReading = 0; thisReading < Samples; thisReading++)
     readings[thisReading] = 0;          
     
  do 
  {
   // subtract the last reading:
   total= total - readings[index];         
   // read from the sensor:  
   readings[index] = (5.0 * analogRead(pinNr) * 100.0) / 1024;
   // add the reading to the total:
   total= total + readings[index];       
   // advance to the next position in the array:  
   index = index + 1;                    

   // if we're at the end of the array...
   if (index >= Samples) {             
   average = total / Samples;         
   // send it to the computer as ASCII digits
 
  
  }
     
} while (index  < Samples);
return average;
}

After doing this, the code executes perfectly in serial monitor.
But you are now unable to upload new code, it will hang on the "Uploadin..."

The fix i described above this post works, i did it again and again it fixed my uploading issue.
Can we please report this to the Arduino Dev Team, any admin?

Thanks.

Another note.

In the sketch above.

If you use :
Serial.println(SmoothSensorReading(0,175));
You will be unable to upload to the board after this upload.

If you use
Serial.println(SmoothSensorReading(0,174));
You will be ABLE to upload to the board after this upload.

Hi there,

unfortunately I am having the same problem.
But, I am not using the original Arduino Micro, I want to use the "ProMicro" from sparkfun.com (claims to be fully compatible. I hope this is no blasphemy in this forum) because it is physically smaller, which is important for my application.

Just for fun and personal warm-up with that board I wanted to upload the very popular basic sketch "Blink" which we all know.
I modified it a bit to deliver two short blink-pulses and then wait for a second.
Furthermore the ProMicro (ATmage32u4) has something else on port 13, at least not the LED. The ProMicro has the LEDs on Pin8 and another one (...). And, in addition to this, the LEDs on that board are connected to VCC instead to GND (yes, using a resistor of course) which means that it will switch-on the LED with a LOW while switching it off with a HIGH. That's the only difference.

I am using:

  • an i7-PC with Win7Ulti 64bit
  • a standard USB2.0 port
  • a standard USB cable to connect the ProMicro to the PC
  • Arduino 1.0.5-r2
  • COM: COM9 (which is shown in Windows device manager, shows up as "Arduino Micro")
  • the drivers delivered with Arduino 1.0.5-r2
  • Board: Arduino Micro (but I also tried Leonardo, which doesnt work either)
  • Programmer: Arduino as ISP (also tried USBasp, no success)

...and yes, the board is proven to be ok.

This is the Error message:

Found programmer: Id = "B«l"; type =
Software Version = . ; Hardware Version = .
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?

Code is:

/*
  Blink
  Turns on an LED on for one second, then off for one second, repeatedly.
 
  This example code is in the public domain.
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 8;                //changed to meet Arduino MICRO (ATmega32u4) Pinout

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(led, LOW);   // turn the LED on (LOW is the GND level, LED is wired to VCC)
  delay(20);               // wait for  20 milliseconds
  digitalWrite(led, HIGH);    // turn the LED off by making the voltage HIGH
  delay(200);               // wait for 200 milliseconds
  digitalWrite(led, LOW);   // turn the LED on (LOW is the GND level, LED is wired to VCC)
  delay(20);               // wait for  20 milliseconds
  digitalWrite(led, HIGH);    // turn the LED off by making the voltage HIGH
  delay(1000);               // wait for one second
}

Unfortunately, your trick does not help as my board does not have a reset button...

Help would be greately appreciated!
Thanks,
okdi

***edit: maybe I should mention that I succeeded in programming an Arduino Pro Mini (ATmega328) over and over and over again. It would work for my application aswell but I fell in love with the promising "ease of use" with an USB interface... until now this promise was not fullfilled, but this may be my fault and I am too unexperienced to this matter to understand why :blush:

Hey man

Sorry to hear about this, if i were you i would contact SparkFun, i hear they have good support.

Kind Regards

Yes, so I did and waiting for an answer :wink:

Nevertheless, I downloaded the newer beta of Arduino 1.5.6-r2 and tried it.
The result was the same but the error message is more detailed and it points me to a possible issue I never thought of: JAVA!
Dont know if this could be an issue but I'm very restrictive on Java on my PC... maybe an explanation?

However, here is the error protocol from 1.5.6-r2 beta:

Der Sketch verwendet 5.194 Bytes (18%) des Programmspeicherplatzes. Das Maximum sind 28.672 Bytes.
Globale Variablen verwenden 153 Bytes (5%) des dynamischen Speichers, 2.407 Bytes für lokale Variablen verbleiben. Das Maximum sind 2.560 Bytes.

Found programmer: Id = "BJL"; type = 
Software Version  =   .  ;  Hardware Version =   . 
avrdude: error: buffered memory access not supported. Maybe it isn't
a butterfly/AVR109 but a AVR910 device?
processing.app.debug.RunnerException
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:125)
	at processing.app.Sketch.upload(Sketch.java:1719)
	at processing.app.Sketch.exportApplet(Sketch.java:1625)
	at processing.app.Sketch.exportApplet(Sketch.java:1597)
	at processing.app.Editor$DefaultExportHandler.run(Editor.java:2397)
	at java.lang.Thread.run(Unknown Source)
Caused by: processing.app.debug.RunnerException: Probleme beim Hochladen auf das Board. Hilfestellung dazu unter http://www.arduino.cc/en/Guide/Troubleshooting#upload .
	at cc.arduino.packages.Uploader.executeUploadCommand(Uploader.java:111)
	at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:123)
	... 5 more

I am afraid I am doing something fundamentally wrong... guess have to wait for reply from sparkfun, probably tomorrow. Meanwhile I'll browse through their support pages XD

Maybe someone sees a hint in the error message that is hiding the solution (hiding for me :blush: )

Cheers :wink:

An update...

so, I went through all these pages and followed strictly the steps described there:
https://www.sparkfun.com/products/12640 (product page)
Pro Micro & Fio V3 Hookup Guide - SparkFun Learn (hookup guide)
Pro Micro & Fio V3 Hookup Guide - SparkFun Learn (installing in Windows)
Pro Micro & Fio V3 Hookup Guide - SparkFun Learn (trouble shooting)

and even tried this here (which is also mentioned under trouble shooting):
https://dlnmh9ip6v2uc.cloudfront.net/datasheets/Dev/Arduino/Boards/32U4Note.pdf (reset button hassle)

But, after all, it didnt help... it is looking better though but thats all, nothing more. Another wasted evening... :frowning:
I am having a TeamViewer session this evening with the supplier of the boards, lets see...

Cheers

Yippiyahyeh! I've got it to work, thanks to the online-help of the supplier! Thanks to "simpledevelopment_mrp" on ebay!! What a support!!! :grin:

So, here is the solution:

After having all installed following the advices from the links of SparkFun in my previous post you may continue here below.
So, accomplish that first. :wink:

  • plug your Arduino ProMicro and open up the Windows device manager
  • it will show the Ardu-ProMicro under COM&LPT and show its COM# in brackets behind, e.g. (COM9)

So far, so good. But, this is only the USB-device itself using a virtual COM port to present itself to Windows!
What we need instead, is the COM port ID of the Bootloader which is "hiding behind" that "USB-ID-virtual-COM-address" and therefore we and Windows cannot see the Bootloader's COM-ID for the moment!
To get it, double-press*) the RESET button (as it is not present on the board I added one via the connection pads of the board, Pin RST and Pin GND) and observe what happens in the device manager:

  • An unknown device pops up under "Other Devices". This is the bootloader. Now be quick, you have 8 seconds)!

  • Rightclick it, click "Install driver", select from a list, choose Leonardo, OK. (Leonardo is the type of bootloader that is used for that board)

  • the unknown device turns into "Arduino Leonardo" and shows in brackets the number of the COM port, which is usually one higher than the one we've seen before, so COM10

  • now relax a bit while your ProMicro goes back into normal operation (which is whatever previously had been programmed to it)

  • go to your IDE, open Tools --> serial port and wonder why you cant see the COM port 10 in the list... what??? :astonished:

  • double-press the RESET button again, wait for the Windows USB-out sound and open Tools --> serial port again and select COM10 which is showing up now

  • do this within 8 seconds because after these have elapsed, the COM10 will no longer be visible for Windows (and us). If you only press RESET once, there will be only 750ms of time which is not enough

  • after these 8secs elapsed, there will be the USB-out sound again (I think I heard it) and the entry in the device manager "Arduino Leonardo (COM10)" re-appears now under "COM&LPT"

  • there is no need to choose a Programmer from the IDE's Tools-->Programmer as the upload happens via the bootloader

  • Upload your code! :grin:

*) If you only press RESET once, there will be only 750ms of time which is not enough. The quick double-pressing of RESET will open the time-window to 8secs, which is not much either, but with some practice it will be enough... :roll_eyes:

I hope this helps others (even if my use of terms might be somewhat "unprofessional" :blush: may the pro's forgive me XD )

Ehm, to be honest, I cannot believe that this is a regular procedure. I think this is worth to be improved by the developers, isnt it?

Cheers,
okdi
:wink:

Okdi - thanks for your great tip. I tried it and it worked for me.

But- I have to do it every time now - is that right? Does that mean I am always writing into the space reserved for the bootloader?

Ian

Update - It SEEMS OK now; I don't have to double-press the reset button each time now but I'm not sure why???

Maybe one of the Arduino team (or anyone else) could explain exactly what was happening

Ian

Hello,

I have faced similar issue with all my Micro Pro's:

When reset with "double click", "Device Manager" is able to recognize the board as "SparkFun Micro Pro", but after 8 sec Windows 8 is switching the board to "USB IO Board" in "Other Devices".

I tried to reinstall the driver - issue not resolved.

I can add couple of things:

(1) brand new board do not have this bad behavior. But after I uploaded any (even simplest "blink" sketch) to the board - the board is "catching" the issue.

(2) looks like board itself is working fine. I'm able to upload simple sketch to the board if "reset" after push of "upload" button in Arduino IDE (not each time, but if timing is good). When new sketch uploaded it is working fine (tested with different variations of "blink" example).

Please, help/advise.

I have exactly the same problem, working on Windows 7 64 bit with my first attempts at uploading to a new pro micro.. so glad you guys have been here before me. Thanks

Not specific to Micro, This was my offending line, and sole cause of upload hang. Serial.println("RTC is not running !!!!"); Yup, this character string "!!!" offends the compiler. Once removed, upload now finishes!
Note: On Windows computer, you can stop the "AVRDUDE" process and it will stop the wait and return you to IDE.

I had the same problem with my micro, and here is my solution.

Open the ide. Go to tools > programmer > then USBtinyISP. Then upload to your micro.

This worked for me, and stopped the hang and freezes from happening. Hope it helps!

I have read reviews that say don't buy thr robot until this problem is fixed. Is this really 'the fix'?
Also is same problem and fix true re Linux interface?

I made an account to say thank you, the reset method does work

Saving me precious time and headache.

christophedm:
Well here we go !

I found a solution, after spending a day googeling.
And I am going to share this with you because it has driven me crazy!

Press the upload button on the ide, wait for program to compile, when it start uploading instantly press the reset button.
Upload will be succesfull, program will be cleared, then upload blink it works, tadaaaaa

I really hope this helps somebody in the future!
If it does, click the karma button or smthn

Grtz

The documentation says that if you just RESET your Arduino pro micro it will only reset the USER-LAND code, not the BOOTLOADER-LAND code part of it. To this you have to "double click" the reset button but it will only stay in that mode for 8 seconds.

Since the pro micro doesnt have a dedicated button you can set LOW the RST pin. Personally I recommend wiring a temporary push button to that pin.

Then what they say is you press the reset button twice and then within the 8 seconds another COM port should show up and you use that to upload a simple blink sketch. Since it takes time, you probably want to double click the reset button, select the correct port, let it expire, then press Upload on the IDE (so it starts compiling) and then double click the button so that the upload window fits inside the 8 second time out.

PS: I havent tested this. I have a bricket pro micro at home and I will see if I can test it when I get home.