Pages: [1]   Go Down
Author Topic: Blink problem-constantly on instead of blinking  (Read 708 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 146
Posts: 6022
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Any feedback welcome
greetings
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Miramar Beach, Florida
Offline Offline
Faraday Member
**
Karma: 146
Posts: 6022
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you ping the ethernet shield ip? If that works, and the server code doesn't, then you might have a bug there too. That is in the Arduino library code tho. It is fixed in v1.0.1, but you will need to patch it yourself for v1.0.

It causes several problems, but the main problems have been dhcp, udp, and tcp. If this is the cause, the sketch will appear to lock up in the client.available() loop.

Here is the bug and fix.
http://code.google.com/p/arduino/issues/detail?id=605
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It seems to be working now! I'm using cross-avr/binutils-2.20.1-r1,  cross-avr/gcc-4.5.3-r2 and cross-avr/avr-libc-1.8.0.
Thanks everybody for your help!
Logged

Pages: [1]   Go Up
Jump to: