Hello ArduPeeps,
In the past 3 weeks, I've been able to get my new DUE to do everything I want. So far, it's quite nice. Fast. Plenty of code & RAM space for my needs. 120K of code and still growing!
The one major headache has been with the upload process. It was really, really unreliable.
I'd often get the dreaded "An error occurred while uploading the sketch" message. About 9 out of 10 times. I'd then reset the DUE, press the erase button, restart the IDE, unplug/replug USB cables. Eventually I'd get the DUE to upload successfully again. Frustrating!
After a lot of Googling, and methodically shotgunning this problem, I think I've found a combination of things that helps with DUE upload reliability (at least on my Win7-x64 host PC):
-
Always use the DUE "programming" port for uploads. It will handle the DUE's "erase" button for you, which is more convenient that having to press that yourself frequently.
-
For your programming USB cable, make sure to plug that into a native USB port on your PC/laptop. Don't go through a hub! Using a hub doesn't make uploading impossible, but reeeealllyy makes it prone to failure. Like I mention below in #3, I think the hub is introducing a timing problem with BOSSAC.
-
If you are using the DUE's native USB port (for example, to dump out serial diagnostic info like I often do), it's important to UNPLUG this USB cable before an upload.
WHY? My informal observations/guesses:
... When a download is initiated (via the USB-PROGRAMMING port), the native USB port "disconnects", as far as your host PC is concerned. Your diagnostic COM: port suddenly went {poof!}.
... It seems to me that the "USB device disconnect" process on the host Windows-PC is interfering with the timing on the USB-PROGRAMMING port and the BOSSAC uploader software. I'm not sure if it's just the "USB-disconnect" handling by Windows, or the playing of the Windows sound which notifies you that "hey! a usb device was just unplugged" (or both).
- IF point #(3) applies to you, and you are using a terminal program (I use RealTerm), it's also important to close the terminal program and then reopen it after your DUE has uploaded and restarted.
WHY? Because when the terminal program is open and a USB-based COM: port suddenly disappears... either Windows (or the terminal program) gets confused and then refuses to work with that port again, until you close/reopen your program. Annoying, but necessary.
Now that I'm adhering to the advice above, my upload success rate has greatly improved, maybe even 100% reliable. I'm still testing...
Anyone with similar experiences?