0
Offline
Faraday Member
Karma: 6
Posts: 2504
|
 |
« Reply #15 on: February 03, 2011, 05:02:48 pm » |
You might try avoiding the problem by applying good programming practice, and declare hue in the function where it's used (instead of using a global variable): void loop() { static int hue = 0;
...
-j
|
|
|
|
|
Logged
|
|
|
|
|
Cracow, PL
Offline
Newbie
Karma: 1
Posts: 14
|
 |
« Reply #16 on: February 03, 2011, 05:03:48 pm » |
I just would like to know if it's likely that installing avr-gcc from sources will solve the problem?
@kg4wsv
Thanks, I usually apply good programming practices. I just got my arduino today and was experimenting. It's not like it's some kind of a production code. Besides in a one-file, 50 liner it really doesn't matter if you use global variables.
And working around compiler bugs like this is way more evil than bad programming practices.
|
|
|
|
« Last Edit: February 03, 2011, 05:06:37 pm by dsh1 »
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 23
Posts: 443
|
 |
« Reply #17 on: February 03, 2011, 05:21:47 pm » |
I don't know if compiling from source would help, if you've got the time and the patience you could try it. I couldn't get the compiler to compile on Ubuntu and I just gave up.
|
|
|
|
|
Logged
|
|
|
|
|
Cracow, PL
Offline
Newbie
Karma: 1
Posts: 14
|
 |
« Reply #18 on: February 03, 2011, 05:52:47 pm » |
It could be gcc version or configure switches. I adapted PKGBUILDs from tinyos and compiled latest vanilla binutils (2.21) and gcc (4.5.2) and still the same problem. If you know anything about compiling gcc-avr tell me if you see something suspicious here: GCC: ../configure --disable-libssp \ --disable-nls \ --enable-languages=c,c++ \ --infodir=/usr/share/info \ --libdir=/usr/lib \ --libexecdir=/usr/lib \ --mandir=/usr/share/man \ --prefix=/usr \ --target=avr \ --with-gnu-as \ --with-gnu-ld \ --with-as=/usr/bin/avr-as \ --with-ld=/usr/bin/avr-ld
binutils: ../configure --build=$(../config.guess) \ --disable-nls \ --enable-install-libbfd \ --includedir=/usr/$(../config.guess)/include \ --infodir=/usr/share/info \ --libdir=/usr/lib \ --mandir=/usr/share/man \ --prefix=/usr \ --target=avr \ --disable-werror Just compiled gcc 4.2.3 and it doesn't support atmega328p. One more try... This time 4.4.5. --- EDIT --- No luck with 4.4.5 either. I suppose there are some patches or configure switches that fix this issue... And I almost forgot: Thank you all for help, it's very appreciated.
|
|
|
|
« Last Edit: February 03, 2011, 06:35:15 pm by dsh1 »
|
Logged
|
|
|
|
|
|
|
Cracow, PL
Offline
Newbie
Karma: 1
Posts: 14
|
 |
« Reply #20 on: February 03, 2011, 07:18:01 pm » |
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 23
Posts: 443
|
 |
« Reply #21 on: February 03, 2011, 07:46:04 pm » |
Good work, let's see if this helps the people having trouble in the other thread.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 23
Posts: 443
|
 |
« Reply #22 on: February 03, 2011, 08:34:04 pm » |
The x86_64 PKGBUILDS worked for me on my Virtualbox installation.
I force-installed the Binutils package first, and that was enough to get the linker to output correct code. This suggests the problem is with Binutils rather than GCC. Installing the downgraded GCC as well gave more efficient and shorter code, so it is worth doing both.
|
|
|
|
|
Logged
|
|
|
|
|
Brisbane, Australia
Offline
Newbie
Karma: 3
Posts: 35
B.E.E. / B.Inf.Tech.
|
 |
« Reply #23 on: February 04, 2011, 02:32:36 am » |
I tried the x86_64 packages. Binutils compiled fine, but gcc-avr spit the following error: checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. make[1]: *** [configure-target-libgcc] Error 1 make[1]: Leaving directory `/home/igor/Misc/ArchBuilds/gcc-avr-debian/src/gcc-4.3.5/build' make: *** [all] Error 2 Aborting... ┌─[igor]──[X201] └─[~/Misc/ArchBuilds/gcc-avr-debian]$
I haven't come across this kind of error before (not really a programmer), but if someone knows what this means, please share! Thanks for preparing the PKGBUILDS dsh1! -Igor
|
|
|
|
|
Logged
|
|
|
|
|
Cracow, PL
Offline
Newbie
Karma: 1
Posts: 14
|
 |
« Reply #24 on: February 04, 2011, 08:06:04 am » |
I tried the x86_64 packages. Binutils compiled fine, but gcc-avr spit the following error: checking for suffix of object files... configure: error: cannot compute suffix of object files: cannot compile See `config.log' for more details. make[1]: *** [configure-target-libgcc] Error 1 make[1]: Leaving directory `/home/igor/Misc/ArchBuilds/gcc-avr-debian/src/gcc-4.3.5/build' make: *** [all] Error 2 Aborting... ┌─[igor]──[X201] └─[~/Misc/ArchBuilds/gcc-avr-debian]$
I haven't come across this kind of error before (not really a programmer), but if someone knows what this means, please share! Thanks for preparing the PKGBUILDS dsh1! -Igor Post your config.log please. It will be somewhere in src/gcc-4.3.5 I force-installed the Binutils package first, and that was enough to get the linker to output correct code. This suggests the problem is with Binutils rather than GCC. Installing the downgraded GCC as well gave more efficient and shorter code, so it is worth doing both.
I also had to use force installation. Original Arch packages leave some manpages even if uninstalled, but it shouldn't be a problem.
|
|
|
|
« Last Edit: February 04, 2011, 08:17:36 am by dsh1 »
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #25 on: February 04, 2011, 09:50:42 pm » |
Thanks for this (I've posted on the other thread started by Igor86 as I have the same problem) Well I get the same compile error as Igor with the x86_64 debian patched gcc-avr  Since Stimmer mentions the problem seems to be in the binutils-avr package I'm looking into whether I can patch my currently installed binutils-avr 2.21-1 rather than downgrade that and gcc-avr. BTW dsh's debian patched binutils for x86_64 compiles fine for me but I can't even force install it because of currently installed gcc-avr 4.5.2-1 dependencies... sigh. So yeah, googling around with all the useful pointers from these threads... will post if I get anywhere with patching 2.21-1... maybe this is an upstream problem and I'm not sure how/whether to send a bug report to the relevant Arch package maintainers yet but thanks for all the help! I'll attach the offending config.log too for the compile errors which was in src/gcc-4.3.5/build/avr/avrxmega2/libgcc/config.log (wierd problem config can't compute suffix of object files
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 23
Posts: 443
|
 |
« Reply #26 on: February 04, 2011, 10:27:23 pm » |
When I force-installed binutils I also had to tell it to ignore dependencies. I can't understand why yours won't compile when mine compiled fine. It could be because my install is very fresh and minimal (I only installed the barest minimum to get the IDE running). Have you tried updating your installed packages to the latest versions? The only other difference was that I was compiling as root, which you shouldn't really do (I was running in a virtual machine so was safe). If it's any help the package it generated is here: https://docs.google.com/uc?id=0B5O7TidPmOdzNGYxMGRiNmUtYzFjNC00NGQyLTlhNDYtYmVmODJiMDk3OTlm&export=download&hl=en(I probably won't keep that download around for long...)
|
|
|
|
« Last Edit: February 04, 2011, 10:34:51 pm by stimmer »
|
Logged
|
|
|
|
|
Cracow, PL
Offline
Newbie
Karma: 1
Posts: 14
|
 |
« Reply #27 on: February 04, 2011, 10:38:14 pm » |
Thanks for this (I've posted on the other thread started by Igor86 as I have the same problem) Well I get the same compile error as Igor with the x86_64 debian patched gcc-avr  Since Stimmer mentions the problem seems to be in the binutils-avr package I'm looking into whether I can patch my currently installed binutils-avr 2.21-1 rather than downgrade that and gcc-avr. BTW dsh's debian patched binutils for x86_64 compiles fine for me but I can't even force install it because of currently installed gcc-avr 4.5.2-1 dependencies... sigh. So yeah, googling around with all the useful pointers from these threads... will post if I get anywhere with patching 2.21-1... maybe this is an upstream problem and I'm not sure how/whether to send a bug report to the relevant Arch package maintainers yet but thanks for all the help! I'll attach the offending config.log too for the compile errors which was in src/gcc-4.3.5/build/avr/avrxmega2/libgcc/config.log (wierd problem config can't compute suffix of object files This is the problem "Fatal error: unknown MCU: avrxmega2" I'll look into it further when I find some time.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 5
|
 |
« Reply #28 on: February 05, 2011, 12:32:30 am » |
Yup, force ignore dependencies ie pacman -Udf binutils-avr-2.20.1-1-x86_64.pkg.tar.xz let me try binutils-avr from dsh with the patches applied  It works! I've compiled and uploaded the Blink sketch without any additional global var declared and the sketch runs fine now. So I guess I don't need the patched gcc-avr for the moment. The problem is narrowed down to the binutils package it seems. (no luck of course finding patches for binutils-avr 2.21)
|
|
|
|
|
Logged
|
|
|
|
|
Brisbane, Australia
Offline
Newbie
Karma: 3
Posts: 35
B.E.E. / B.Inf.Tech.
|
 |
« Reply #29 on: February 05, 2011, 12:59:48 am » |
Awesome!
I pacman -Udf'ed binutils-avr and the blink sketch works fine now (at least on the Uno)! So, no need for gcc-avr (Arch package works fine), we just need these binutils-avr!
Thanks heaps to everyone who spent time to look into these problems. I'll send a message to the Arch User Repository for the arduino package (the package for x86_64).
-Igor
|
|
|
|
|
Logged
|
|
|
|
|
|