Pages: [1]   Go Down
Author Topic: Bug: Stream with "!!!" make upload fail to Mega2560  (Read 1542 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 2
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 518
Posts: 26331
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Known bug (sorry, I don't have a reference handy). Install a later version bootloader onto the 2560.
Logged

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.

Offline Offline
Newbie
*
Karma: 2
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for a fast reply!

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

/Dick
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 518
Posts: 26331
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Pretty straightforward:

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

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.

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 211
Posts: 13477
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 .
« Last Edit: May 02, 2013, 07:28:43 am by robtillaart » Logged

Rob Tillaart

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 518
Posts: 26331
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't think so. Am pretty sure it was a bug.
Logged

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.

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6636
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 2
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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. smiley

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

Offline Offline
Newbie
*
Karma: 2
Posts: 37
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
wdt_reset();
so I knew if worked. It did. smiley
Logged

Pages: [1]   Go Up
Jump to: