can't upload new program...is my serial line being swamped?

I have been going through some of the tutorials and was working on one that sends data back through the serial port to display on the serial monitor. (9600 baud)

I accidentally uploaded a program where I forgot the delay( ) line to slow things down.

Now I can't upload a new program. It complies and then starts to Upload..., but it just freezes and eventually says Upload cancelled or it just completely locks up.

Is it possible that the program is swamping the serial line so that I can't upload the new program?

Obviously I'm new at this. Is there a way to erase what is in the flash memory without using the serial?
I tried uploading the very basic program void setup(){}; void loop(){}; but couldn't even get that loaded.

using a UNO, programming on Linux Mint 15 Cinnamon 64-bit

Power and communicate through the USB plug

programmer: AVRISP mkII

serial port: varies, but is typically ttyACM1

I accidentally uploaded a program where I forgot the delay( ) line to slow things down.

You don't need such a thing.

Not sure what is going on but I have never come across that. The thing is that the upload communication occurs before any sketch is run, so what is in your sketch is not an issue.

Is it possible that the program is swamping the serial line so that I can't upload the new program?

So that is not possible.

Is there a way to erase what is in the flash memory without using the serial?

Well if you have two arduinos you could program one with the other through the SPI lines, but you don't need that.

Try holding the reset line down, starting the down load. Then when it says "uploading" count to three and release the reset.

programming on Linux Mint 15 Cinnamon 64-bit

Only used Linux on the Raspberry Pi but it was dog slow. That might be your issue.

quote
Is it possible that the program is swamping the serial line so that I can't upload the new program?
quote

So that is not possible.

Well, the reason I say thought that is when running an earlier example, the delay was set to 5 ms and I had basically the same problem. I changed that to delay(100) and uploads went up no problem and the IDE didn't hang.

So is SEEMED like the delay was allowing the upload to happen, but I don't really know the details of how it works, so who knows.

And everything else I've done with the Arduino has been super fast, so lets not blame linux.

And everything else I've done with the Arduino has been super fast, so lets not blame linux.

I would beg to differ.
It looks like your code is filling the serial buffer and Linux is not clearing it just before an upload.

Perhaps I'm the only person using the Arduino with linux?

I suppose I'd rather someone helped me find a solution, I'm too old and tired to get in a OS flamewar.

jwebster8:
programmer: AVRISP mkII

Are you trying to upload using your programmer? Or using the Arduino's bootloader?

Just trying to upload a new program (sketch).

The AVRISP mkII setting is whatever it defaulted to. Worked fine for the most part, but should I be doing something else?

1 Like

• Disconnect everything from your Arduino except the USB cable.
• Disconnect the USB cable from the computer.
• Load the Arduino IDE.
• Prepare an empty sketch (example provided below).
• Use Verify to ensure the empty sketch builds.
• Connect a jumper wire from RESET to GND.
• Connect the USB cable (your Arduino) to your computer.
• Ensure the correct serial port is selected.
• Ensure the correct board is selected.
• Click / execute Upload.
• At the very moment the status line displays "Uploading..." remove the jumper.
• If that does not work, repeat the entire process twice more.

Empty sketch...

void loop( void ) { }
void setup( void ) { }

jwebster8:
Perhaps I'm the only person using the Arduino with linux?

I suppose I'd rather someone helped me find a solution, I'm too old and tired to get in a OS flamewar.

It is not flaming. It is just that there so many flavours of Linux with so much code that is little tested then there are bound to be problems. Many people use Linux quite happly but some have issues like this. The point is that it is a Linux issue rather than an Arduino one.

I don't know if this is the problem since he doesn't list how old his Uno is but there was a bug on the Atmega8u2 firmware that would cause exactly what he is describing. I ran into this exact problem quite awhile ago so I know it can happen. Here is a page talking about it: Space Tinkerer's Lab: Fixing the 8u2 Firmware Bug on Arduino

Coding Badly, that worked. It took more like 5 or 6 tries though. I learned that you can turn on the verbose setting and see what's going on during the upload.

Frefol, Thanks, that link looks to be exactly what's happening. My Uno's a few years old. I pulled it out recently as I have a use for it. I suspect what Coding Badly's solution did was to sneak the program in before the Serial Port started "spamming".

Since I'll certainly screw up sooner or later and do the same thing, I'll update the firmware ASAP. Looks to be a bit involved

Thanks for everyones help

Cheers guys