Go Down

Topic: Bug: Stream with "!!!" make upload fail to Mega2560 (Read 1 time) previous topic - next topic

teddyz

Took me a while to pin down this. I can't upload the code below to none of two Mega2560-boards, but compiling seems OK. I've tried both 1.0.3 and 1.5.2.

Code: [Select]
void setup() {
  // put your setup code here, to run once:
    Serial.begin(9600);
    Serial.println("Please!!!");
}

void loop() {
  // put your main code here, to run repeatedly:

}


All I get is errors that force me to unplug the USB-port.

Binary sketch size: 3 444 bytes (of a 258 048 byte maximum) - 1% used
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
And so on...

But uploading to my UNO works fine. Remove one exclamation mark and it uploads just fine to the Mega too. Have I found a bug?

Here is the topic where I found the troublesome !!!'s http://arduino.cc/forum/index.php/topic,161397.0.html

/Dick

CrossRoads

Known bug (sorry, I don't have a reference handy). Install a later version bootloader onto the 2560.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

teddyz

Thanks for a fast reply!

Now I will learn how to update a boot-loader. Also interesting.   :)

/Dick

CrossRoads

Pretty straightforward:

http://www.gammon.com.au/forum/?id=11635
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

robtillaart

#4
May 01, 2013, 11:23 pm Last Edit: May 02, 2013, 02:28 pm by robtillaart Reason: 1
If I recall correctly  the !!! is the sequence for the bootloader to go into programming mode ???

so a new bootloader won't fix it ..
update: it's a bug so a update of the bootloader can fix it .
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

CrossRoads

I don't think so. Am pretty sure it was a bug.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

westfw

It's a bug that the !!! sequence enters the "monitor mode" even when it is received during an upload.  It should only have that effect when the bootloader is in command mode.

teddyz


Pretty straightforward:

http://www.gammon.com.au/forum/?id=11635



Thanks! I was fortunate enough to have a 6-pin cable that I modified, and the rest was as easy as it possibly can be!
I tested the code above, and it could be downloaded. Case closed. :)

And as a bonus, as I understand it, I from now on can use the watchdog. This will be my next challenge.

teddyz

And for the watchdog, I found this page via google: http://tushev.org/electronics/arduino/item/46-arduino-and-watchdog-timer

First test was without
Code: [Select]
wdt_reset(); so I knew if worked. It did. :)

Go Up