Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
goodhack
PostPosted: Jan 26, 2011 - 05:21 PM
Rookie


Joined: Nov 17, 2010
Posts: 32


Ok, I've managed to fix the problem (thanks Bingo, gcc and avr-gcc community) - I was using a wrong parameter for make.

The last version of the building script is here:
http://www.cl.cam.ac.uk/~osc22/files/av ... r_tools.sh

Current versions (see the script to be sure):
BINUTILS_VER="2.21"
GCC_VER="4.5.2"
GDB_VER="7.2"
GMP_VER="5.0.1"
MPFR_VER="3.0.0"
MPC_VER="0.8.2"
INSIGHT_VER="6.8-1"
AVARICE_VER="2.10"
AVRDUDE_VER="5.10"
AVRLIBC_VER="1.7.0"

Bingo if you (and others) find it useful, feel free to add it on the first page.

Thanks.
 
 View user's profile Send private message  
Reply with quote Back to top
Bingo600
PostPosted: Jan 26, 2011 - 06:11 PM
Raving lunatic


Joined: Apr 25, 2004
Posts: 3911
Location: Denmark

@goodhack

I suppose it was EW's hints on the avr-gcc list what brought you on track.

Congratulations in writing a very nice buildscript.

It still amazes me though :
That you chose to ignore the warnings in the last posts about using the unpatched upstream avr-gcc.
Instead of the proven 4.3.4 with the current maintainer patches applied.
These patches are created by Eric Weddington (WinAVR) , who adviced you on the "list". And Jörg Wunsch (avr-libc & FreeBSD port of avr-gcc).

And i sincerely hope your students won't be bitten , as these patches most likely haven't gone into the version of GCC that you are using.

/Bingo
 
 View user's profile Send private message  
Reply with quote Back to top
goodhack
PostPosted: Jan 26, 2011 - 06:33 PM
Rookie


Joined: Nov 17, 2010
Posts: 32


Yes, it was EW's hints on the avr-gcc (as well as some other messages on the gcc-help list) that have helped me.

Well, it is not that I choose to ignore, I just want to provide a working script for the last version of GCC for those (like me) that want to use it.

Also, using your scripts, or the maintained 4.3.4 packages give extra work like applying missing patches.

I am sure the 4.3.4 version might be more stable, but why not trying to make it work with the current version?

Regarding the patches you refer to, I think that many patches have gone into the current (4.5.2) GCC version; at least from the Changelogs it seems that some things related to AVR have been aded.

Omar
 
 View user's profile Send private message  
Reply with quote Back to top
Bingo600
PostPosted: Jan 26, 2011 - 06:49 PM
Raving lunatic


Joined: Apr 25, 2004
Posts: 3911
Location: Denmark

@Omar
There has been some issues between Atmel & the GCC team , that has prevented the accept of the patches into mainstream GCC. The last i heard was , that they are "close to resolve the issues" but afaik.
Some patches still haven't gotten into mainstream GCC.

Btw: The reason i haven't updated the .deb packages with the new delay.h is that i follow the FreeBSD source like 99.9% , and Jörg hasn't released avr-libc-1.7.1 yet.

But your post actually made me upload the correct delay.h file , and write a warning in the "readme's" on http://www.wrightflyer.co.uk/avr-gcc/

Now you don't need to patch , just replace a file

/Bingo
 
 View user's profile Send private message  
Reply with quote Back to top
goodhack
PostPosted: Jan 27, 2011 - 01:28 PM
Rookie


Joined: Nov 17, 2010
Posts: 32


Nice to hear about the correct file.

Thanks.
 
 View user's profile Send private message  
Reply with quote Back to top
bofh
PostPosted: Jan 28, 2011 - 09:14 AM
Newbie


Joined: Jan 26, 2011
Posts: 1


Hi,

nice scripts, thank you. Smile

However, it aborted while building avarice-2.10 with a linker error on Arch Linux (AMD64):

Quote:

g++ -g -O2 -o avarice crc16.o devdescr.o ioreg.o jtag2bp.o jtag2io.o jtag2misc.o jtag2prog.o jtag2run.o jtag2rw.o jtag2usb.o jtagbp.o jtaggeneric.o jtagio.o jtagmisc.o jtagprog.o jtagrun.o jtagrw.o main.o remote.o utils.o gnu_getopt.o gnu_getopt1.o -lusb -lbfd -liberty -lz
/usr/lib/libbfd.a(plugin.o): In function `try_load_plugin':
(.text+0x3f4): undefined reference to `dlopen'
/usr/lib/libbfd.a(plugin.o): In function `try_load_plugin':
(.text+0x417): undefined reference to `dlsym'
/usr/lib/libbfd.a(plugin.o): In function `try_load_plugin':
(.text+0x4a3): undefined reference to `dlerror'
collect2: ld gab 1 als Ende-Status zurück



On Arch Linux AMD64, avarice needs to be linked against libld:

I added
Code:

AC_CHECK_LIB([dl], [dlopen], , [ac_found_ld=no])
to the avarice-2.10 configure.ac file.
Then run autoreconf && autoconf , build a new tarball, exchange it and it works. Smile
 
 View user's profile Send private message  
Reply with quote Back to top
goodhack
PostPosted: Feb 10, 2011 - 04:24 PM
Rookie


Joined: Nov 17, 2010
Posts: 32


Hi bofh,

I am happy to hear you can use them as well.

Regarding the bfd problem, you should install libbfd. In ubuntu this is solved by installing binutils-dev, as mentioned in the header of the scripts.
 
 View user's profile Send private message  
Reply with quote Back to top
SprinterSB
PostPosted: Feb 10, 2011 - 04:57 PM
Posting Freak


Joined: Dec 21, 2006
Posts: 1676
Location: Saar-Lor-Lux

Bingo600 wrote:
There has been some issues between Atmel & the GCC team , that has prevented the accept of the patches into mainstream GCC. The last i heard was , that they are "close to resolve the issues" but afaik.
Some patches still haven't gotten into mainstream GCC.


Would you give some details on that? What exactly was the issue? It's clear that non-GPLed patches will not go into GCC.

I intend to do some work on avr backend in the near future. As I won't copy-paste existing patches, this will probably invalidate some patches. Therefore, as Atmel guys are also GCC's avr backend maintainers, I am not sure if they are happy to see work being done on avr.
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
Bingo600
PostPosted: Feb 11, 2011 - 11:15 AM
Raving lunatic


Joined: Apr 25, 2004
Posts: 3911
Location: Denmark

SprinterSB wrote:
Bingo600 wrote:
There has been some issues between Atmel & the GCC team , that has prevented the accept of the patches into mainstream GCC. The last i heard was , that they are "close to resolve the issues" but afaik.
Some patches still haven't gotten into mainstream GCC.


Would you give some details on that? What exactly was the issue? It's clear that non-GPLed patches will not go into GCC.

I intend to do some work on avr backend in the near future. As I won't copy-paste existing patches, this will probably invalidate some patches. Therefore, as Atmel guys are also GCC's avr backend maintainers, I am not sure if they are happy to see work being done on avr.


I don't have any examples , but i'm quite sure that it was Eric (EW) mentioning this on one of the mailinglists. As an answer to why patches wasn't moved upstream.

Ask Jörg or Eric.

/Bingo
 
 View user's profile Send private message  
Reply with quote Back to top
Bingo600
PostPosted: Feb 13, 2011 - 01:41 PM
Raving lunatic


Joined: Apr 25, 2004
Posts: 3911
Location: Denmark

goodhack wrote:
Ok, I've managed to fix the problem (thanks Bingo, gcc and avr-gcc community) - I was using a wrong parameter for make.

The last version of the building script is here:
http://www.cl.cam.ac.uk/~osc22/files/av ... r_tools.sh

Current versions (see the script to be sure):
BINUTILS_VER="2.21"
GCC_VER="4.5.2"
GDB_VER="7.2"
GMP_VER="5.0.1"
MPFR_VER="3.0.0"
MPC_VER="0.8.2"
INSIGHT_VER="6.8-1"
AVARICE_VER="2.10"
AVRDUDE_VER="5.10"
AVRLIBC_VER="1.7.0"

Thanks.

Mega2560 has a bug in 4.5.2

http://www.avrfreaks.net/index.php?name ... 668#795668
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47696

/Bingo
 
 View user's profile Send private message  
Reply with quote Back to top
goodhack
PostPosted: Feb 14, 2011 - 09:01 PM
Rookie


Joined: Nov 17, 2010
Posts: 32


Thanks Bingo.

I have added a patch for the bug and I see the bug has now been fixed for GCC 4.6. Also I updated my script to use this patch.

Maybe we can make a complete list of unsolved bugs for 4.5.2 and hope they will all be fixed for release 4.6. And we could try to start converging from there.
 
 View user's profile Send private message  
Reply with quote Back to top
madworm
PostPosted: Mar 01, 2011 - 11:39 PM
Rookie


Joined: Feb 16, 2009
Posts: 32


Is there a _single_ location available that at least links to all the files necessary to get up-to-date mcus working?

I must have spent have a day compiling (using the script and the manual on the avr-libc site) only to find out that e.g. my newly acquired ATtiny4313 is not supported by the compiled avr-gcc version I got. Woohooo! Happy happy joy joy.

I don't mind the compiling part too much (well it basically sucks, but it is still tolerable), but finding all the patches... good god! Mad

How come they haven't been integrated into the source code yet? I could (hypothetically) use WinAVR of course, but I just fail to see how and why a 'port' is more up-to-date than the original software.
 
 View user's profile Send private message  
Reply with quote Back to top
markus_b
PostPosted: Mar 02, 2011 - 12:14 AM
Posting Freak


Joined: Mar 20, 2001
Posts: 1517
Location: Switzerland

madworm wrote:
How come they haven't been integrated into the source code yet? I could (hypothetically) use WinAVR of course, but I just fail to see how and why a 'port' is more up-to-date than the original software.

I have the impression that winavr is sometime more a fork than a port and that quite few things don't make it back into the gcc. maybe just due to the lack of motivation my Atmel to provide the work to make it happen. After all in winavr it works and other development platforms than Windows don't exist / are negligible (See the wonderful new Studio 5 based on Microsoft Visual Studio).

_________________
Markus
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
madworm
PostPosted: Mar 02, 2011 - 12:56 AM
Rookie


Joined: Feb 16, 2009
Posts: 32


I think I'll have to agree with the fork vs. port part, but Atmel could at least have had the decency to use QT instead of the horrid MS stuff. It looks more and more like MS-word. Does it have ribbons as well?

And why do I need to register just for downloading a free-of-charge IDE? Is that strictly legal, having to register to get access to software that is - at least partially - licensed under the GPL?

Sheesh. Isn't it enough that I buy some of their chips already. Knowing who I am and what I do won't miraculously octuplicate their sales and blow away their competitors...

/rant

Now back to business please Very Happy
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Mar 02, 2011 - 09:25 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 69337
Location: (using avr-gcc in) Finchingfield, Essex, England

I installed AVR Studio 5 yesterday - it supports Tiny4313. When it was pointed out to Atmel that they'd shot themselves in the foot by delivering (again) a Windows only package the retort was that while the IDE may be tied to Windows the toolchain was "cross platform". Now I don't know how they can make that claim without providing Linux binaries x386 for the avr-* tools in the toolchain - but maybe they are lurking in there (I haven't looked)?

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
markus_b
PostPosted: Mar 02, 2011 - 11:58 AM
Posting Freak


Joined: Mar 20, 2001
Posts: 1517
Location: Switzerland

It was Dean, who said that the underlying stuff is cross-platform and only the IDE is Windows specific. This might be correct in theory and marketing speak (gcc is cross-platform), but in practice this is clearly false. After I pointed out to him that an 500MB exe file is not cross-platform did not venture any further comment.

I respect Dean and suspect he was carried away with his remark. I don't think he works in the Studio team, so he might just defend them without knowing all the details first hand.

I don't need a single click 500MB installer for linux, the script provided here is sufficient for most of us Linux guys. But it looks like we are deliberately ignored.

_________________
Markus
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
madworm
PostPosted: Mar 02, 2011 - 01:33 PM
Rookie


Joined: Feb 16, 2009
Posts: 32


The script is fine!

It basically does all the work. Only currently (well yesterday) it unfortunately does not produce a version of avr-gcc that supports the tiny4313.

The best I could do myself was to apply a patch to avr-devices.c to make the compiler aware of that chip. But later the linker barfed about a missing .o file - which existed.

If atmel is so stuck-up to ignore everything beside windows, they can't be helped and will pay the price once MS faces its inevitable end. I just love companies taking advantage of open source software and give back nowt.

I'm no expert in this, but I doubt it can be considered as terribly hard/impossible for well experienced c/c++ programmers to transfer the 'Studio' to something that compiles 'everywhere' using QT or GTK and at least provide up-to-date binaries for major flavours of linux/mac-os.

Maybe it's time that someone shoves that message up the a*ses of the bean counters in management.
 
 View user's profile Send private message  
Reply with quote Back to top
markus_b
PostPosted: Mar 02, 2011 - 03:39 PM
Posting Freak


Joined: Mar 20, 2001
Posts: 1517
Location: Switzerland

madworm wrote:
I'm no expert in this, but I doubt it can be considered as terribly hard/impossible for well experienced c/c++ programmers to transfer the 'Studio' to something that compiles 'everywhere' using QT or GTK and at least provide up-to-date binaries for major flavours of linux/mac-os.

I doubt that this is easily possible, as Studio 5 is based on the Microsoft proprietary Visual Studio environment. However, the C/C++ compiler is already cross-platform compatible, only that Atmel, in its infinite wisdom has choose only to distribute the Windows version. Over time they will have to release all the patches they have applied to it as gcc is licensed under the GPL.

It would have been very easy for them to base their Studio environment on a cross-platform environment like Eclipse, like most of the industry is doing it right now. It might even have been less work.

_________________
Markus
 
 View user's profile Send private message Send e-mail  
Reply with quote Back to top
clawson
PostPosted: Mar 02, 2011 - 03:53 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 69337
Location: (using avr-gcc in) Finchingfield, Essex, England

Quote:

Over time they will have to release all the patches they have applied to it as gcc is licensed under the GPL.

This is one major niggle I have with AVR Toolchain and now AVR Studio 5. If you go back to WinAVR then you have:
Code:
C:\WinAVR-20100110\source\avr\gcc\4.3.3>dir
 Volume in drive C is ACER
 Volume Serial Number is C6B0-75D7

 Directory of C:\WinAVR-20100110\source\avr\gcc\4.3.3

21/01/2010  12:03    <DIR>          .
21/01/2010  12:03    <DIR>          ..
19/01/2010  18:08               392 20-gcc-4.3.3-libiberty-Makefile.in.patch
19/01/2010  18:08               924 21-gcc-4.3.3-disable-libssp.patch
19/01/2010  18:08               339 23-gcc-4.3.3-ada-Makefile.patch
19/01/2010  18:08               629 30-gcc-4.3.3-param-inline-call-cost.patch
19/01/2010  18:08             1,656 40-gcc-4.3.3-bug-10768-by-adacore.patch
19/01/2010  18:08            11,119 41-gcc-4.3.3-bug-11259_v3.patch
19/01/2010  18:08             1,606 42-gcc-4.3.3-bug-spill-v4.patch
19/01/2010  18:08             2,209 43-gcc-4.3.3-bug-35013.patch
19/01/2010  18:08             1,348 44-gcc-4.3.3-libgcc16.patch
19/01/2010  18:08             2,914 45-gcc-4.3.3-bug-33009.patch
19/01/2010  18:08               445 46-gcc-4.3.3-andsi3-wrong-attribute.patch
19/01/2010  18:08             7,348 47-gcc-4.3.3-bug-18145-v4.patch
19/01/2010  18:08            10,560 50-gcc-4.3.3-mega256-v2.patch
19/01/2010  18:08            33,036 51-gcc-4.3.3-xmega-v13.patch
19/01/2010  18:08            24,718 52-gcc-4.3.3-new-devices.patch
19/01/2010  18:08             7,276 60-gcc-4.3.3-osmain.patch
19/01/2010  18:08            16,365 61-gcc-4.3.3-builtins_v6.patch
19/01/2010  18:08             6,084 62-gcc-4.3.3-ada-mlib.patch
19/01/2010  18:08             3,458 63-gcc-4.3.3-ada-freestanding.patch
19/01/2010  18:08             2,645 64-gcc-4.3.3-ada-timebase.patch
19/01/2010  18:08             1,312 65-gcc-4.3.3-ada-gnat1_print_path.patch
19/01/2010  18:08             3,026 66-gcc-4.3.3-ada-optim_static_addr.patch

Whereas if you look at AS5 you have:
Code:
D:\Program Files\Atmel\AVR Studio 5.0\extensions\Application\AVR Toolchain>dir
 Volume in drive D is DATA
 Volume Serial Number is 3636-53FD

 Directory of D:\Program Files\Atmel\AVR Studio 5.0\extensions\Application\AVR T
oolchain

01/03/2011  20:47    <DIR>          .
01/03/2011  20:47    <DIR>          ..
01/03/2011  20:47    <DIR>          avr
01/03/2011  20:48    <DIR>          avr32
01/03/2011  20:47    <DIR>          bin
01/03/2011  20:48    <DIR>          contrib
01/03/2011  20:48    <DIR>          doc
01/03/2011  20:47    <DIR>          include
01/03/2011  20:47    <DIR>          info
01/03/2011  20:48    <DIR>          lib
01/03/2011  20:48    <DIR>          libexec
01/03/2011  20:49    <DIR>          man
01/03/2011  20:49    <DIR>          share
               0 File(s)              0 bytes

Like "toolchain" before it they haven't bothered to include a source/*/*.patch directory.

In the past I know that people have used the *.patch that Eric included in WinAVR and have then applied them to a Linux built toolchain - as Toolchain/AS5 stands that is not possible and it does suggest Atmel is in violation of GPL as they are providing binaries for which the end user cannot easily rebuild them. At the very least they should just include a list of which patches have been applied and leave it to the builder to locate them from open FTP/HTTP sources.

Code:
============================================================================

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
madworm
PostPosted: Mar 03, 2011 - 01:19 AM
Rookie


Joined: Feb 16, 2009
Posts: 32


So where are the lawyers when you need them?
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits