I can upload the arduino unos just fine but I can only upload to the mega just once. the com port fails afterwards and says its in use. I have the correct board selected when uploading. Are there any tricks to reset the com port. I have also disabled it in the device manager and reenabled it. It then just hangs on upload.
I too am having a similar problem. I just purchased a Arduino Mega2560 R3 to see if it may be something my son could use for his robotics project since it has lots of program and SRAM space. I checked all the old and new troubleshooting forum info regarding hangs on UPLOADING. The DTR reset coupling cap is present and is indeed generating a reset. This issue exists with all example sketches so not my doing in code and not the "!!!" issue. Even doing manual resets just before the upload only work maybe 10% of the time. The only reliable way to get my Mega2560 to upload a sketch is to close the IDE, then reopen the IDE and sketch with the USB cable installed and immediately click upload. If I wait too long after opening the IDE or make edits after the first upload and try again, it hangs indefinately.
Still working on debugging the problem, but got this far after a few frustrating days. Haven't broke out the o-scope or LA yet. Running on WIN XP and the USB driver is correct. I started with Arduino 1.0 and just moved to 1.0.1 to see if the apparent bug was fixed, but still acts the same way. I have not read anywhere that this problem may have been fixed in a newer bootloader. When I get a chance I'll capture the verbose avr status info both when it works and fails.
Any thoughts from the long term experts would be welcome as it is a bit of a pain to exit out the IDE and restart every time I want to upload.
I am finding that it is happening more when the main serial port is being used by the program to print text. When I switched over to serial(1,2,3) it is happening less, but it is still going on.
Can you explain a bit more your observation in regard to the other serial ports on the card? In my case it does not matter if I'm using serial communication in the sketch or not. The simple LED blink sketch will not upload again after the first inital successful load. I have to completely exit the IDE, restart it and the sketch and imeadiately click upload to get one more sucessful upload. I saw a few post replys from Nick on another thread regarding the driver in Device Manager and mine are all normal and as expected. I also tried severl USB cables just in case since I'm familiar with signal integrity issues as that is my job.
Can you get a verbose display of the results in the lower status area of the IDE during a failed upload since I have not had time to get mine yet? Also, can you get successful uploads on the first launch of the IDE and imeadiate upload click like I can?
Its usually just the first upload that works, it will then say comport is in use thereafter. If i unplug the usb cable and and replug it back in it will hang on upload. I have to wait 10 minutes before it will respond again. I have 2 usb cables so i just swap back and forth. I have also noticed that it will mess up the connection if i forget to hook up the connection to the board when i upload.
i downloaded a program from microsoft, i killed the processes avrdude and it seemed to have fixed it for the time being. of course it will come back
Just got my problem fixed with the help of a Full Member - Louis.
See his advice in this thread; http://arduino.cc/forum/index.php/topic,57003.0.html
If you are on IDE 1.0, this might help you too.
The link in reply #7 says that any string containing "!!!" three exclamation marks causes some Megas to glitch up. Remove any !!! in your sketch, and see what happens.