Go Down

Topic: Blink problem-constantly on instead of blinking (Read 736 times) previous topic - next topic

spockpv

Hello, I have a problem when I try to use the example program Blink.

I am using Arduino Uno with Gentoo Linux, with the latest arduino software (v1.0).

I have tried the blink example with two different Uno boards with the same result: the led light is constantly on, it doesn't blink. It seems to compile and upload fine, however no matter what I try, the problem persists. I tried with the following cross-avr/gcc versions: 4.5.3 , 4.4.5 , 4.3.4 with the same results. I also tried different cross-avr/avr-libc versions: 1.8.0 and 1.7.1

With windows vista and Linux Debian everything is working fine.

The example code I try to use is:
Code: [Select]

void setup() {               
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(13, OUTPUT);     
}

void loop() {
  digitalWrite(13, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(13, LOW);    // set the LED off
  delay(1000);              // wait for a second
}


The only way to make the blink example to work under Gentoo linux is with the following code:

Code: [Select]

int pin=13;
void setup() {               
  // initialize the digital pin as an output.
  // Pin 13 has an LED connected on most Arduino boards:
  pinMode(pin, OUTPUT);     
}

void loop() {
  digitalWrite(pin, HIGH);   // set the LED on
  delay(1000);              // wait for a second
  digitalWrite(pin, LOW);    // set the LED off
  delay(1000);              // wait for a second
}


where I set a variable for the pin 13. This is the only way for the blinking program to work.

I have also noticed problems with other example programs that work fine under windows or other linux distributions - but do not work under Gentoo linux.
Any ideas? Thanks!

James C4S

Quote
where I set a variable for the pin 13. This is the only way for the blinking program to work.


This is a well know issue with Linux distros using broken tool chains. You need to update avr-bintools or always declare a used global variable.
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

SurferTim

This is a Gentoo bug. The broken toolchains are fixed in most other releases of Linux. Debian is fine. Ubuntu is fine. Let's get Gentoo fixed.

This user has started debugging Gentoo.
http://arduino.cc/forum/index.php/topic,95741.msg734762.html#msg734762


Anaximander

Basically your problem arises from newest version of binutils. For some reason if no global variable is defined before any program code, the program code begins at wrong address. Besides this the delay()-function sis also broken with latest version of binutils.

Just follow my descriptions in the above mentioned thread and you should get a working avr-toolchain at least on gentoo/amd64. :)

Any feedback welcome
greetings

spockpv

Thank you for your help!
Following the directions from the link above, I managed to successfully use the blink program. However I'm still having difficulties with the webserver example, which is working under vista.
There do not seem to be any problems during the compile and the upload. Everything seems fine, but the given ip address is not working.

Go Up