Go Down

Topic: Problem uploading to Arduino Micro (hangs on Uploading...) (Read 21402 times) previous topic - next topic

christophedm

Mar 08, 2014, 06:38 pm Last Edit: Mar 08, 2014, 06:47 pm by christophedm Reason: 1
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 :

Code: [Select]

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?

christophedm

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!

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

christophedm

Hi again...

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

Code: [Select]

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.

christophedm

#4
Mar 09, 2014, 08:49 pm Last Edit: Mar 09, 2014, 08:54 pm by christophedm Reason: 1
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.

okdi

#5
Mar 19, 2014, 02:08 pm Last Edit: Mar 19, 2014, 03:49 pm by okdi Reason: 1
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:
Quote
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:
Code: [Select]
/*
 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  :smiley-red:

christophedm

Hey man

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

Kind Regards

okdi

#7
Mar 19, 2014, 08:23 pm Last Edit: Mar 19, 2014, 08:31 pm by okdi Reason: 1
Yes,  so I did and waiting for an answer  ;)

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:
Code: [Select]
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 :smiley-red: )

Cheers  ;)

okdi

An update...

so, I went through all these pages and followed strictly the steps described there:
https://www.sparkfun.com/products/12640 (product page)
https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/hardware-overview-pro-micro (hookup guide)
https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/installing-windows (installing in Windows)
https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/troubleshooting-and-faq#ts-reset (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... :(
I am having a TeamViewer session this evening with the supplier of the boards, lets see...

Cheers

okdi

#9
Mar 20, 2014, 08:05 pm Last Edit: Mar 20, 2014, 08:53 pm by okdi Reason: 1
Yippiyahyeh! I've got it to work, thanks to the online-help of the supplier! Thanks to "simpledevelopment_mrp" on ebay!! What a support!!!  :smiley-mr-green:

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.  ;)

- 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??? :smiley-eek:
- 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!   :smiley-mr-green:

*)  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...  :smiley-roll:

I hope this helps others (even if my use of terms might be somewhat "unprofessional"  :smiley-red: 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
;)

ianandewan

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

ianandewan

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

VExplorer

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.

carriegooch

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

wudwork

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.

Go Up