Abdellazizhammami / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

delay() function broken in IDE-1.0-rc1 w/ avr-binutils 2.21.1 #689

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use IDE 1.0 rc1
2. Upload Blink.ino to an Arduino UNO
3. See the led on pin 13 NOT blink

What is the expected output? What do you see instead?
Led should blink, but doesn't

What version of the Arduino software are you using? On what operating
system?  Which Arduino board are you using?
Arduino UNO, optiboot version shipped with 1.0 rc1

Please provide any additional information below.
Problem comes from the delay() function.
I've been having similar issues in other projects and libraries, so I tested 
the blink.ino example to verify that it really is a basic issue with the 
delay() function.

This bug also persists on various other 328P based arduino hardware with 
optiboot.

Original issue reported on code.google.com by Vliegend...@gmail.com on 23 Oct 2011 at 12:54

GoogleCodeExporter commented 9 years ago
Huh, it's worked well for me (and for many others, I think).  Does the same 
board work with Arduino 0022?  Have you tried 1.0rc1 with any other boards?

Original comment by dmel...@gmail.com on 23 Oct 2011 at 3:14

GoogleCodeExporter commented 9 years ago
Same boards work with 0022.

Libs and compiler versions:
avr-binutils (2.21.1)
avr-gcc (4.5.3)
avr-libc (1.7.1)

Original comment by Vliegend...@gmail.com on 23 Oct 2011 at 3:38

GoogleCodeExporter commented 9 years ago
Are you on Linux?  I think the problem might be bugs in the avr-gcc or 
avr-binutils versions; the Windows and Mac distributions of Arduino come with 
older versions.  Although I'm not sure why it would be different between 0022 
and 1.0.

Original comment by dmel...@gmail.com on 23 Oct 2011 at 4:05

GoogleCodeExporter commented 9 years ago
Linux indeed.
Slackware64-Current to be precise.
Kernel 2.6.38.7

Original comment by Vliegend...@gmail.com on 23 Oct 2011 at 5:40

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
This bug persists in IDE-1.0 rc2.

I've discovered that this bug appears if you use avr-binutils 2.21.1 and is 
absent if you use version 2.20.1 or lower.

So the cause of this trouble is binutils 2.21.1!

Original comment by Vliegend...@gmail.com on 26 Oct 2011 at 10:47

GoogleCodeExporter commented 9 years ago

Original comment by dmel...@gmail.com on 27 Oct 2011 at 3:42

GoogleCodeExporter commented 9 years ago
The 2.21.1 compiled versions seems to be continuously jumping back to the start 
of the vector table (0x00).

The dumps tell me that stuff goes wrong in the micros, __vector_16 and 
__do_clear_bss functions.

I've attached the elf, hex and assembly dumps of the two versions I've compiled.
One is compiled with 2.21.1 and doesn't work, the other is compiled with 2.20.1 
and works.

Original comment by Vliegend...@gmail.com on 27 Oct 2011 at 6:19

Attachments:

GoogleCodeExporter commented 9 years ago
As noted, the delay function and hence Blink, did not work using FC16 and 
avr-binutils-2.21-2. Downgrading to avr-binutils-2.20-2 as advised above seems 
to have solved the problem. Hope this helps.

Original comment by michael....@wanadoo.fr on 18 Nov 2011 at 10:03