Go Down

Topic: Bug with !!! Using Mega 2560 (Read 10 times) previous topic - next topic

fillibar

Jan 09, 2011, 02:22 am Last Edit: Jan 09, 2011, 03:49 pm by fillibar Reason: 1
This is an apparent bug with the Mega 2560. So far it has been found to not occur with a Duemilanove, but three different Mega 2560s have gotten it to occur.

When the code contains three or more exclamations it will prevent the sketch from being able to complete uploading. Note that there is no compile errors. However eventually there may be a timeout from avrdude.

An example set of code that causes this behavior is:
Code: [Select]
int IncrementingInteger = 1345;
int AlarmTriggerInteger = 1355;
boolean BooleanAlarmTriggered = false;

void setup() {
 Serial.begin( 9600 );
}

void loop() {
 delay( 5000 );
 IncrementingInteger = IncrementingInteger + 1;
 Serial.print( "Incrementing integer: " );
 Serial.println( IncrementingInteger );
 Serial.print( "Alarm trigger integer:" );
 Serial.println( AlarmTriggerInteger );
 if ( BooleanAlarmTriggered == false ) {
   if ( IncrementingInteger == AlarmTriggerInteger ) {
     BooleanAlarmTriggered = true;
     Serial.println( "Alarm has gone off!!!" );
   }
 }
}


Removing just one of the exclamation marks from the Serial.println ( "Alarm has gone off!!!" ); will allow the sketch to upload normally and it will work as expected. I was unable to find reference to this problem otherwise.

Devices used:
Arduino Mega 2560 with Arduino IDE 0022 on a Windows 7 64bit. - Problem occurs.
Duemilanove with Unknown IDE Version on a Windows 7 64bit. - No problem.
Second Arduino Mega 2560 with Arduino IDE 0022 on OSX. - Problem occurs.
Third Arduino Mega 2560 with Arduino IDE 0021 on Ubuntu 10.04 64bit - Problem occurs.

This was originally raised in thread:
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1294452951/0#0

If any further information is needed, please let me know.

mmcp42

#1
Jan 10, 2011, 11:02 am Last Edit: Jan 10, 2011, 11:03 am by mmcp42 Reason: 1
just tried it on a UNO
works fine
uploaded ok and serial monitor is showing

Alaarm trigger integer xxx
Incrementing integer xxx
Alarm has gone off!!!
there are only 10 types of people
them that understands binary
and them that doesn't

retrolefty

If repeatable by others, this has got to be one of the strangest bugs ever reported.  ;D

Somehow my gut says there is something else going on, but I'm just a hardware guy, so don't take what I think to the bank.  ;)

Lefty

mmcp42

#3
Jan 10, 2011, 10:03 pm Last Edit: Jan 10, 2011, 10:05 pm by mmcp42 Reason: 1
a long time ago in a far off computer room
when operating systems were compiled from punch cards every night...

we had a strange bug then
only went wrong on the 17th of the month as I recall

turned out that the bit pattern of the digits as it went past looked like the pattern for some sort of reset

... just wondering

mebbe the clever (ha ha) boot loader is using !!! as a delimiter
I dunno ignore rambling
there are only 10 types of people
them that understands binary
and them that doesn't

fillibar

#4
Jan 11, 2011, 04:09 am Last Edit: Jan 11, 2011, 04:27 am by fillibar Reason: 1
It has to be my original background in Software QA coming to haunt me like normal...

Case in point, I often use POV-Ray for some other work and have found 2 bugs there that were unknown because nobody used it in ways I did (debug file data getting overwritten instead of appended and failure rendering images 41000x41000 pixels). Go figure.

I saw the mention about the Google Code issues section (oops) and have now posted this there with all the information everyone has helped me get (and links to the posts). It is issue 459.
http://code.google.com/p/arduino/issues/detail?id=459

Go Up