Script for building AVR-GCC 4.5.1 on Linux

Last post
343 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

[Moderator's note: as that thread is sticky now, please
avoid followups here. Rather open your own new thread
instead.]

Quote:
*** YOU MUST LOG IN TO DOWNLOAD THE SCRIPTS ***

Quote:
*** Experimental DEBUGGING of XMEGA's is supported on Linux. But the full protocol is still an Atmel secret.

See : http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=114940

Quote:
Now also as a .deb install package ... Read further on below

Quote:

Here is a list of Linux tools & tips i use on Ubuntu
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=654163#654163

Guyzz i have succeded in building avr-gcc-4.3.4 w. avr-libc-1.6.8 , and Jörg's latest patches on my Ununtu 10.04

Quote:
I'm only testing on the latest Ubuntu LTS.
All other version & distro's , are not guaranteed to work/compile. I'll try to help out , and so will the forum i'm sure. But don't demand support if it doesn't work , just ask nicely in the forum

I am enclosing the scripts i use (credits of A. Erasmus) , if they could be of any use

The steps are these:

Read Readme.txt
Then install the packages listed in pre-reqs.txt.

Note !!
Don't try to call the scripts from another directory location , always execute from same directory where the scripts are located.
The current scripts uses recursive deletes , that could erase the harddisk if the above isn't honored.

Then....

1: Make sure you are root (blushing) , or use sudo
2: Make a working directory , where you extract the files from the archive.
3: If desired edit the buildavr-no-insight.sh file , to change the prefix .. default is : prefix=/usr/local/avr
4: Make sure that the prefix dir is empty or nonexisting
5: Run : chmod +x *.sh
6: Run : ./getfiles.sh
7: Run : ./get-patches.sh
8: Run : ./buildavr-gdb.sh
9: Run: ./buildavr-toolchain.sh

You just answer yes to the existing directory question in step 9.

When building is done , you might want to free around 500MB of diskspace by removing the sources and binaries used to make avr-gcc.
To do so Run: ./buildavr-cleanup.sh

Note this little script expects the "build prefix" to be /usr/local/avr/

Edit:2
I have an avr user on my Linux-box for doing avr development , i have added this to my .bash_profile in my /home/avr directory , it sets up the path to avr-gcc.

Quote:

# User specific environment and startup programs
PREFIX=/usr/local/avr
export PREFIX

PATH=$PATH:$HOME/bin:$PREFIX/bin
export PATH

Quote:

The script builds avr-gcc-4.3.4 w. binutils2.20 and then avr-libc-1.6.8
The script now also automaticly builds avarice-2.10 and avrdude-5.9 , as per request of Jörg.

Note : gcc-4.3.x uses the GMP & MPFR libs , in order to function. So make sure to install the packets mentioned pre-reqs.txt

avr-insight is upgraded to ver 6.8 witch builds ok on 64-bit machines , and it has its own buildscript (buildinsight.sh) , as it takes ages to build.

Use: tar xvzf to extract it if it's a .tgz file, or unzip if it's a zipfile.

Just ansver yes if any of the scripts says that /usr/local/avr exists (ie. when building insight after gcc or the other way around.

But always delete /usr/local/avr before you are making a total/new rebuild.

Quote:

Updated the scriptfiles to build binutils and insight without the -Werror flag. This was caused by GCC 4.3.x (on Ubuntu 8.10) being unable to build the targets. And was due to a lot of new warnings being enabled by default.

Quote:

@20-jun-2009
Upgraded the "old" script building avr-gcc-4.2.2 to build avr-gcc-4.2.4 ... "Jörg did all the patches".
4.2.2 could produce more compact code in some cases.

Quote:

@14-jul-2009
Upgraded the script to build avr-libc-1.6.7 and avrdude-5.8 , no changes to avr-gcc.
As usual "Jörg & the others" did all the hard work.

Quote:

@12-aug-2009
Upgraded the avr-gcc-4.2.4 script to build avr-libc-1.6.7 and avrdude-5.8.
Also applied a "Hotfix patch" to binutils , to avoid a relocation error in the AVR25 architecture (tiny85 etc).
Everybody is urged to rebuild their toolchain

Quote:
@29-0ct-2009
Updated the avr-gcc-4.1.2 binutils 1-17 avr-libc-1.46
script , as it failed in makeinfo.
Moved the updated script to this post
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=632653#632653

Quote:
@03-Nov-2009
Updated the avr-gcc-4.3.3 script , with an avarice patch , to fix a problem when building with "native" gcc 4.4.1

Quote:
@01-Dec-2009
Made a Debian/Ubuntu ".deb" install package containing the binaries build with the above 03-Nov-2009 script.
Read more here
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=86953

Quote:
@17-Dec-2009
Updated the ".deb" install package , w. a new avrdude binary , containing a PDI patch. (See .txt file in the download site)
Read more here
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=86953

Quote:
@16-Jan-2010
Updated the avr-gcc-4.3.3 script , to build avrdude-5.9
Removed the two "interrim avrdude patches" , as 5.9 should fix that.
All other remains unchanged.
The script still includes the "AVR25 relocation fix" patch , and the avarice patch

Quote:
@18-Jan-2010
Updated the ".deb" install package (named 16-jan-2010) , w. avrdude-5.9. (See .txt file in the download site)
Read more here
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=86953

Get the package here.
http://www.wrightflyer.co.uk/avr-gcc/

Quote:
@26-Jan-2010
Updated the scriptfiles and the ".deb" install package to 26-jan-2010 , Added avrdude-5.10 , all other unchanged.

Get the package here.
http://www.wrightflyer.co.uk/avr-gcc/

Quote:
@25-Feb-2010
Made a "Special Static" version , with the patches from WinAVR-20100110-install.exe , so it should be compatible.

Should be installable on both 32-bit & 64-bit versions.
See http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=90241

Get the package here.
http://www.wrightflyer.co.uk/avr-gcc/

Quote:
@09-Mar-2010
Updated the avr-gcc script , to build avr-gcc-4.3.4 and binutils-2.20.
Added 2 patches to avr-insight/avr-gdb.
Added a builtins.h file in the builddir , see readme for use

Added a package-versions file , now versions are only maintained in that file.
Added a new "automatic" way to patch binutils , gcc & insight.

Thanx to Jörg the linux (FreeBSD) build , now has the same patches as WinAVR-2010. A big thankyou to Jörg & EW.

Also uploaded as .deb package avr-gcc-4.3.4-avrfreaks-09-mar-2010.deb
Get the package here.
http://www.wrightflyer.co.uk/avr-gcc/

Quote:
@30-apr-2010
Rebuild the 09-mar-2010 packages on Ubuntu 10.04 LTS
This time i have a x64 system , so i build both 32bit (i386) and 64bit x64 packages.

Uploaded as .deb packages here
http://www.wrightflyer.co.uk/avr-gcc/
Only toolchain change is : Updated insight from 6.8 to 6.8-1

Quote:
@04-jun-2010
Updated buildscript to build avr-insight to 6.8-1
No other changes , and no new .deb's as the 30-apr deb's allready contains that.

Quote:
@12-sep-2011
Did a rebuild of the old trusty avr-gcc-4.3.4 toolchain , with avr-libc-1.7.1 and avrdude-5.11 - avr-insight has switched from 6.8-1 to 6.8-1a

Had to do a "kludge" in order to build avr-insight , ad the file is named 6.8-1a , but it extracts to 6.8-1 directory
Run ./repack-insight.sh , before ./buildinsight.sh

Removed all the rm -fr * , from the buildscript

See readme in zipfile

Also uploaded .deb files to http://www.wrightflyer.co.uk/avr-gcc/

Quote:
@20-sep-2011
Updated the 12-sep-2011 package (see install instructions there)

avrdude updated from 5.11 to 5.11.1 (Serious Bugfix)
avarice updated from 2.10 to 2.11 )minor compilation issues)

See readme in zipfile

Also uploaded .deb files to http://www.wrightflyer.co.uk/avr-gcc/

Quote:
@29-dec-2011
Updated the buildscript with the latest patches from the FreeBSD repos (Thanx Jörg)

avr-gcc updated to 4.5.1
avr-libc updated to 1.8.0
binutils updated to 2.20.1
avarice updated to 2.12
insight replaced with gdb 7.3.1

See readme in zipfile

More info & comments should go here
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=115567

05-jan-2012
Also uploaded .deb files to http://www.wrightflyer.co.uk/avr-gcc/

Quote:
@08-mar-2012
Updated the buildscript with suggestions/patches from Axel W. (Uracoli)
The suggestions makes the get-patches.sh script more secure , and improves on the buildavr-cleanup.sh script.

The resulting toolchain is the same as the 29-dec-2011 TC.

Thanx Axel.

Quote:
@26-feb-2013
Updated the buildscript with working file mirrors

Quote:
@30-nov-2013
Updated the buildscript to build :
avrdude 6.0.1 (Thanx Jörg)
avr-gdb 7.6.1

Quote:
@26-apr-2014
Updated the buildscript to build :
avrdude 6.1 (Thanx Jörg)
and included the patches in the zipfile
So skip the get-patches.sh step

/Bingo
.
.
.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This appears to have become an at least occasionally requested item.

Is there any interest of making this thread `sticky'?

(Please stop replying if you see there's an unanimous vote; I'll
have to split the thread otherwise to decouple the `noise' from
the actual content otherwise before making it sticky.)

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.
Please read the `General information...' article before.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

dl8dtl wrote:

Is there any interest of making this thread `sticky'?

I think that would be a good idea. In particular, I find the information about patches (and where to get them) very useful.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm a relative newbie to Linux, used SUSE a little. Just today I installed UBUNTU. Looks like it will help me brake that bad Windose and commercial-Linux habit.

Have played around with WINAVR a little and like it. Would like to go to GNU GCC on Linux.

Making this thread sticky has my vote.

Mike

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just "Touching the date"

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

compiling binutils with the your scripts failed for me with the following error message (using a current gentoo box with gcc 4.1.1):

gcc -DHAVE_CONFIG_H -I. -I../../../source/binutils-2.17/binutils -I. -D_GNU_SOURCE -I. -I../../../source/binutils-2.17/binutils -I../bfd -I../../../source/binutils-2.17/binutils/../bfd -I../../../source/binutils-2.17/binutils/../include -I../../../source/binutils-2.17/binutils/../intl -I../intl -DLOCALEDIR="\"/usr/local/avr/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation   -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Werror -g -O2 -c ../../../source/binutils-2.17/binutils/wrcoff.c
cc1: warnings being treated as errors
../../../source/binutils-2.17/binutils/wrcoff.c: In Funktion »coff_start_struct_type«:
../../../source/binutils-2.17/binutils/wrcoff.c:2277: Warnung: berechneter Wert ist unbenutzt
make[4]: *** [wrcoff.o] Fehler 1
make[4]: Leaving directory `/usr/local/avr/build/binutils-2.17/binutils'
make[3]: *** [all-recursive] Fehler 1
make[3]: Leaving directory `/usr/local/avr/build/binutils-2.17/binutils'
make[2]: *** [all] Fehler 2
make[2]: Leaving directory `/usr/local/avr/build/binutils-2.17/binutils'
make[1]: *** [all-binutils] Fehler 2
make[1]: Leaving directory `/usr/local/avr/build/binutils-2.17'
make: *** [all] Fehler 2
(./buildavr-no-insight.sh) binutils build failed

Any idea?

Regards:

Uwe Fechner

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Drop the -Werror. I'm not going to do anything about the COFF patch
anymore, given that AVR-COFF is close to be dead.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.
Please read the `General information...' article before.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

thank you very mutch. Your script run successfully with Mandriva 2005. I made a little remark, it don't run with Mandriva 2007. There are some errors with "binutils build failed" message.

Regards.

Monmon :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Is there an easy way to drop the -Werror using the script? It fails on a ubuntu 6.10 and I have tried to remove the -Werror but somehow it pops back again...

/Mikael

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

> Is there an easy way to drop the -Werror using the script? It fails
> on a ubuntu 6.10 ...

"Is there a way to get rid off these seat belts? They are always in
my way."

The correct solution is not to remove the -Werror but to remove the
warning triggering your problem. Not having Ubuntu Linux, and you not
quoting it, I can only guess, but I assume it's:

wrcoff.c: In function 'coff_start_struct_type':
wrcoff.c:2277: warning: value computed is not used

FreeBSD's CVS version recently also switched to GCC 4.x, and thus also
stumbled across that one.

I have just updated the COFF patch for this in my FreeBSD port. The
solution was much simpler than your attempt to get rid of the -Werror:
a "(void)" cast had to be placed before a function call that returned
a value that was not used. (Upon thinking of it, I'm asking myself
whether ignoring the return value is actually the right thing to do,
but at least, it's been that way all the time, and I don't really see
the Big Picture of all this anymore after that many years.)

I also updated the ATmega256x patch in binutils to get rid of that
annoying "operation is dangerous with linker stubs" warning that was
triggered by large C switch() statements. In a discussion with Björn
Haase, we agreed that this was a regression (it wasn't really
dangerous in the switch() situation anyway), and also not all that
useful as Björn initially believed, as there are many more other ways
to shoot into your feet with the linker stubs which cannot be warned
about anyway. So that warning is gone now. (This matches the patch
Eric is using for his most recent WinAVR.)

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.
Please read the `General information...' article before.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Jörg!

The void cast did the trick in Ubuntu 6.10 as well.

/Mikael

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This script worked flawlessly on Arch linux.

Any hints on how build avr-insight, and/or avr-gdb?

Thanks,
Sam

EDIT

I am sorry, that didn't really follow http://www.catb.org/~esr/faqs/smart-questions.html

What I should say is that I have a difficult time determining what the latest stable package is. Right now I am building Insight 6.6.

./configure --prefix=/home/swinchen/opt/avr-insight --target=avr

I am just not sure if I will run into any problems with this version.

Thanks Again,
Sam

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Would it be a problem, for the purpose of consistency, to alter this script to install in the gcc directory (/usr/lib/gcc/gcc-4.1 not sure) along with the i486 target and the arm-elf target?

Thanks,
outer_space

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

outer_space wrote:
Would it be a problem, for the purpose of consistency, to alter this script to install in the gcc directory (/usr/lib/gcc/gcc-4.1 not sure) along with the i486 target and the arm-elf target?

Thanks,
outer_space

Maybe like this ??

Quote:

3: If desired edit the buildavr-no-insight.sh file , to change the prefix .. default is : prefix=/usr/local/avr

the prefix , is pointing to the final "Install dir"

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I mean to suggest altering the script to make it consistent with native and arm prefixes so all three end up in the same spot (for everybody)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I seem to recall having read that once upon a time the /usr/local/avr prefix was chosen so that it would be a simple matter of blowing away the entire directory to get rid of *everything* AVR-related from the filesystem without worrying about:
1) Accidentally removing anything non-AVR-related in the same operation
2) Accidentally losing track of some AVR components and orphaning them

I'm sure there are better ways to accomplish both of these tasks nowadays though.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

> I'm sure there are better ways to accomplish both
> of these tasks nowadays though.

Only if you are carefully tracking the files you did install.
That's where the package management systems of the various Unix
systems come into the game. If you are installing something
outside of these package managers, you have to track that
yourself.

Each of the tools should also come with a Makefile target
"make uninstall", but I wouldn't hold my breath to see whether
they are really removing everything (including perhaps empty
directories they once created): these targets probably belong
to the lesser tested features even if they come "for free"
along with autoconf/automake.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.
Please read the `General information...' article before.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If somenone wants to build packages for installation using the debian packaging system, I wrote a mini how-to:

http://blog.coldtobi.de/index.php?op=ViewArticle&articleId=21&blogId=1

Enjoy!

(The patches are also filed against the debian packages, for your reference, these are the bug numbers:
#420061 #416924 )

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just touching the date , to indicate the new avr-libc-1.4.6 build

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

I change my PC and now I installed Ubuntu 7.04. The script work perfectly with my old PC and Mandrake 2005 (not with 2007).

AVR-GCC package download don't work on tiny45. Then I want compile this version and patches (tiny45) but ./configure indicate : "C compiler cannot create executables". I try different options but there is always this error :oops:.

Thank for your help and for all Ubuntu users.

Monmon.
(Celeron 2500 + Ubuntu 7.04 + Tiny45 + Kontrollerlab)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

IIRC Ubuntu doesn't come with a native C compiler as part of the standard installation. You need to install GCC separately (using apt-get or Synaptic) before you can use it with Bingo's script to build AVR-GCC.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Ifmorrison,

thank you for your answer but I have already install :
-------------------------------------------------------------
gcc -v
Utilisation des specs internes.
Target: i486-linux-gnu
Configuré avec: ../src/configure -v --enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Modèle de thread: posix
version gcc 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
-------------------------------------------------------------

or I don't understand that you mean.

Thank you very much for your help. (excuse me for my english)

Monmon.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is snipped from the AVR32 section , but i think you need to install this on unbuntu , to be able to build a compiler.

sudo apt-get install build-essential

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Bingo600,

I'm so sorry but now, there are another error after I installed build-essential :

config.status: creating po/Makefile.in
config.status: executing depfiles commands
config.status: executing default commands
make[3]: quittant le répertoire « /usr/local/avr/build/binutils-2.17/bfd/po »
make[3]: entrant dans le répertoire « /usr/local/avr/build/binutils-2.17/bfd/po »
make[3]: Rien à faire pour « info ».
make[3]: quittant le répertoire « /usr/local/avr/build/binutils-2.17/bfd/po »
make[3]: entrant dans le répertoire « /usr/local/avr/build/binutils-2.17/bfd »
make[3]: Rien à faire pour « info-am ».
make[3]: quittant le répertoire « /usr/local/avr/build/binutils-2.17/bfd »
make[2]: *** [info-recursive] Erreur 1
make[2]: quittant le répertoire « /usr/local/avr/build/binutils-2.17/bfd »
make[1]: *** [all-bfd] Erreur 2
make[1]: quittant le répertoire « /usr/local/avr/build/binutils-2.17 »
make: *** [all] Erreur 2
(./buildavr-no-insight.sh) binutils build failed

Thank you for your help and your time.

Monmon

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I hope this link will be useful for someone. Using that how-to I have installed avr-gcc on my Linux Suse 10.
Link: http://www.linuxjournal.com/article/7289
I have compiled binutils, gcc and avr libc. When I was compiling simulavr I had been given a mistake.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Added script files for building avr-gcc-4.1.2 w. avr-libc-1.4.6

The following devices are supported :
A snip from the command : avr-gcc --target-help.

Known MCU names:
  avr1 avr2 avr3 avr4 avr5 avr6 at90s1200 attiny10 attiny11 attiny12
  attiny15 attiny28 at90s2313 at90s2323 at90s2333 at90s2343 attiny22
  attiny26 at90s4433 at90s4414 at90s4434 at90s8515 at90s8535 at90c8534
  at86rf401 attiny13 attiny2313 attiny261 attiny461 attiny861 attiny24
  attiny44 attiny84 attiny25 attiny45 attiny85 atmega603 atmega103
  at43usb320 at43usb355 at76c711 atmega48 atmega8 atmega83 atmega85
  atmega88 atmega8515 atmega8535 atmega8hva at90pwm1 at90pwm2 at90pwm3
  atmega16 atmega161 atmega162 atmega163 atmega164p atmega165 atmega165p
  atmega168 atmega169 atmega169p atmega32 atmega323 atmega324p atmega325
  atmega325p atmega329 atmega329p atmega3250 atmega3250p atmega3290
  atmega3290p atmega406 atmega64 atmega640 atmega644 atmega644p atmega128
  atmega1280 atmega1281 atmega645 atmega649 atmega6450 atmega6490
  atmega16hva at90can32 at90can64 at90can128 at90usb82 at90usb162
  at90usb646 at90usb647 at90usb1286 at90usb1287 at94k atmega2560
  atmega2561

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

monmon wrote:
Hi Bingo600,

I'm so sorry but now, there are another error after I installed build-essential :

config.status: creating po/Makefile.in
config.status: executing depfiles commands
config.status: executing default commands
make[3]: quittant le répertoire « /usr/local/avr/build/binutils-2.17/bfd/po »
make[3]: entrant dans le répertoire « /usr/local/avr/build/binutils-2.17/bfd/po »
make[3]: Rien à faire pour « info ».
make[3]: quittant le répertoire « /usr/local/avr/build/binutils-2.17/bfd/po »
make[3]: entrant dans le répertoire « /usr/local/avr/build/binutils-2.17/bfd »
make[3]: Rien à faire pour « info-am ».
make[3]: quittant le répertoire « /usr/local/avr/build/binutils-2.17/bfd »
make[2]: *** [info-recursive] Erreur 1
make[2]: quittant le répertoire « /usr/local/avr/build/binutils-2.17/bfd »
make[1]: *** [all-bfd] Erreur 2
make[1]: quittant le répertoire « /usr/local/avr/build/binutils-2.17 »
make: *** [all] Erreur 2
(./buildavr-no-insight.sh) binutils build failed

Thank you for your help and your time.

Monmon

Try to install "texinfo" with the synaptic install manager, then it builds OK for me on Ubuntu 7.04, Feisty Fawn!

ekh

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As ekh wrote

on Ubuntu 7.04 do :

1: sudo apt-get install build-essential
2: then install texinfo , either via apt-get or the synaptic install/packet manager.

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi everybody,

thank you very much for your help,

now, it work fine with build-essential package, texinfo package, avr-gcc 4.1.2 and unbuntu 7.04.

I can play or work ;-) with my tiny 45 and KontrollerLab.

Regards.

Monmon.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

a simple information, script 4.1.2 work fine with Mandriva 2007 spring if "texinfo" package is installed.

Monmon.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems to me that at some point someone in this community should realize that the preeminent source of stable code in this chan is maintained in the FreeBSD ports collection.

I have finally gotten around to working on a generalized 'portscrape' method. This will actually build the toolchain on SLES 10 and should keep up with whatever revision is blessed. (This seems to need some tweeking to work on OSX's bash.)

I am working on the automation of the packaging from here.

#!/bin/bash
function getfiles ()
{
for fname in $FILES ; do 
echo "GETTING ----- $fname -----"
case ${fname##*\.} in 
  bz2)
     echo "GETTING ----- $fname ----- using bunzip "
     curl ftp://ftp2.freebsd.org/pub/FreeBSD/distfiles/$fname \
      |bunzip2 -dc|tar -xf -
     ;;
  gz|tgz)
     echo "GETTING ----- $fname ----- using gunzip "
     curl ftp://ftp2.freebsd.org/pub/FreeBSD/distfiles/$fname \
      |gzip -dc|tar -xf -
     ;;
esac
done

}

function patchfiles () {
PORTNAME=`cat $port/Makefile |grep ^PORTNAME|cut -f2`
PORTVERSION=`cat $port/Makefile |grep ^PORTVERSION|cut -f2`
ocd=`pwd`
cd $PORTNAME-$PORTVERSION*
echo "-------- PATCHING HERE `pwd`  ------"
for p in $ocd/$port/files/patch* ; do
   patch -p0 -u <$p
done
cd $ocd

}

function makeit () {
PREFIX=/usr/local
LOCALBASE=/usr/local
CONFIGURE_ARGS=`cat $port/Makefile |grep ^CONFIGURE_ARGS|sed 's/^CONFIGURE_ARGS\=\t//'`
MAKE_ARGS=`cat $port/Makefile |grep ^MAKE_ARGS|sed 's/^MAKE_ARGS\=\t//'`
PORTNAME=`cat $port/Makefile |grep ^PORTNAME|cut -f2`
PORTVERSION=`cat $port/Makefile |grep ^PORTVERSION|cut -f2`
ocd=`pwd`
cd $PORTNAME-$PORTVERSION*
echo "-------- CONFIGURING HERE `pwd`  ------"
echo "$CONFIGURE_ENV ./configure $CONFIGURE_ARGS "
export `cat $port/Makefile |grep ^CONFIGURE_ENV|sed 's/\t/ /g'|sed 's/^CONFIGURE_ENV\=//'`
./configure $CONFIGURE_ARGS >config.out
echo "$MAKE_ENV make $MAKE_FLAGS && $MAKE_ENV make $MAKE_FLAGS install"
export `cat $port/Makefile |grep ^MAKE_ENV|sed 's/\t/ /g'|sed 's/^MAKE_ENV\=//'`
make $MAKE_FLAGS && make $MAKE_FLAGS install
# make $MAKE_FLAGS distclean
cd $ocd
}

for port in avr-binutils avr-gcc avr-libc avr-gdb avarice simulavr ; do
curl  "http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/$port/$port.tar.gz?tarball=1"|gzip -dc|tar -xvf -
export FILES=`grep MD5 $port/distinfo|cut -d\( -f2|cut -d\) -f1`
getfiles "$FILES"
patchfiles "$port" "$FILES"
makeit "$port" "$FILES"
done 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

@08-Oct-2007
Added a new set of scriptfiles to avr-gcc-4.1.2
The only change is the WinAVR binutil patch of avr-size , to output %full , at end of compile.

To use the new avr-size function you have to modify the makefile.

Replace the old size stuff with this , in the makefile

# Display size of file.
HEXSIZE = $(SIZE) --target=$(FORMAT) $(TARGET).hex
ELFSIZE = $(SIZE) --mcu=$(MCU) --format=avr $(TARGET).elf

sizebefore:
   @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); \
   2>/dev/null; echo; fi

sizeafter:
   @if test -f $(TARGET).elf; then echo; echo $(MSG_SIZE_AFTER); $(ELFSIZE); \
   2>/dev/null; echo; fi

Edit: If make complains , after insetting the above , make sure to replace the "spaces" in front of the @ , with a "tab"

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ddd7 wrote:
It seems to me that at some point someone in this community should realize that the preeminent source of stable code in this chan is maintained in the FreeBSD ports collection.

It is both FreeBSD and WinAVR. Joerg and I work together to share common patches.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That would be my point with the exception of the patches that you discussed in the osx-avr thread.

Taking this one step further.

The /usr/ports/devel/avr-.* directories contain not only the current patches for .*x systems, but also the source locations, the environment and compiler flags to compile them. Which is why I suggested that a script would be better off extracting this data from the definitive source than rewriting a fresh script every time. The script above was an attempt to hack out a quick proof of concept. It isn't pretty but it works.

There is a good deal of other material in each ports Makefile including descriptions, dependencies, versions and file manifests which could be scripted into depots (hpux), packages(solaris), PackageMaker files(osx), .dpkg's (debian) or rpms.

pushing out from there
a) This could be rewritten in a more robust shell such as perl and generalized to create a framework from scraping the data into patched source trees or various package formats. This might serve to rapidly decrease the delay between your releases and releases by and for the rest of us.

b) More investigation on the OSX side could be done in carrying on the early "port the ports" efforts which were made when darwin first came out. If you pull the source manually into distfiles you can actually run bsdmake from an unmodified ports tree and get the more difficult work done (patch,configure,compile). It makes me wonder what a body could do with a few choice modifications to the /usr/ports/Mk directory.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've tested the script on Ubuntu 7.10.
First the 'texinfo' package was missing. I've installed it with the 'Synaptic Package Manager' and then the script works perfectly!

Thanks for the updated avr-gcc-4.2.2 script,
Thomas

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The new script avr-gcc 4.2.2 & avr-libc 1.6.1 , now knows the following mcu's

Known MCU names:
  avr1 avr2 avr3 avr4 avr5 avr6 at90s1200 attiny10 attiny11 attiny12
  attiny15 attiny28 at90s2313 at90s2323 at90s2333 at90s2343 attiny22
  attiny26 at90s4433 at90s4414 at90s4434 at90s8515 at90s8535 at90c8534
  at86rf401 attiny13 attiny2313 attiny261 attiny461 attiny861 attiny24
  attiny44 attiny84 attiny25 attiny45 attiny85 attiny43u attiny48 attiny88
  atmega603 atmega103 at43usb320 at43usb355 at76c711 at90usb82 at90usb162
  atmega48 atmega48p atmega8 atmega83 atmega85 atmega88 atmega88p
  atmega8515 atmega8535 atmega8hva at90pwm1 at90pwm2 at90pwm2b at90pwm3
  at90pwm3b atmega16 atmega161 atmega162 atmega163 atmega164p atmega165
  atmega165p atmega168 atmega168p atmega169 atmega169p atmega32 atmega323
  atmega324p atmega325 atmega325p atmega328p atmega329 atmega329p
  atmega3250 atmega3250p atmega3290 atmega3290p atmega32hvb atmega406
  atmega64 atmega640 atmega644 atmega644p atmega128 atmega1280 atmega1281
  atmega1284p atmega645 atmega649 atmega6450 atmega6490 atmega16hva
  at90can32 at90can64 at90can128 at90pwm216 at90pwm316 at90usb6

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If anyone experiences errors with makeinfo , when building binutils.

Have a look here.

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=57776

I have updated the scripts in the beginning of this thread with the one containg the makeinfo patches.

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks a lot. Got it working on Fedora core 8 (fc8), 64 bit machine. :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here is a link to a CodeBlocks linux install (Ubuntu) , and there are hints how to build insight & gdb for avr
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=64023

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Another excellent resource for installing CodeBlocks on Ubuntu Hardy 8.04

http://www.futuredesktop.org/codeblocks_on_ubuntu_8.04.html

IDE - Eclipse w/AVR Eclipse plugin
Programmer - AVRISP MKII
OS - Ubuntu (Intrepid) Linux

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just finished this update on ubuntu 6.06 dapper drake and had to take two additional steps.

Prior to building

sudo apt-get install texinfo

post built

sudo cp /usr/local/avr/bin/* /usr/bin

thanks for producing this script, it fixed my compiler issues (ISRs not recognized)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

machs_fuel wrote:
I just finished this update on ubuntu 6.06 dapper drake and had to take two additional steps.

Prior to building

sudo apt-get install texinfo

post built

sudo cp /usr/local/avr/bin/* /usr/bin

thanks for producing this script, it fixed my compiler issues (ISRs not recognized)

Well if you have read the start you would have seen the texinfo part. And the hint to where the default toolchain would be build

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi friends i have downloaded
(1)binutils-2.15.tar.bz2:Assembler
(2)gcc-core-3.4.2.tar.bz2:GNU C Compiler
(3)avr-libc-1.0.4.tar.bz2:AVR C Library
from 'http://electronicsforu.com/efycodes/microcontroller.zip' URL

assuming that i am in the path /usr/local/src/

Step1:
mkdir /usr/local/avr
cd binutils-2.15
mkdir avrobj;cd avrobj
../confugre --target=avr --prefix=/usr/local/avr --disable-nls
make;make install

Result of Step1:
Process ended with two errors

Step2:
export PATH=$PATH:/usr/local/avr/bin
cd gcc-3.4.2
mkdir avrobj;cd avrobj
../confugre --target=avr --prefix=/usr/local/avr --disable-nls --enable-language=c
make;make install

Result of Step1:
Process is not even getting started....
Error stating there is no such file or directory 'configure' and error in 'language=c'

Please can any one solve this problem.

i have 6 years of experience in AVR ICs but new to Linux....

:cry:

ATMEL--Heart Beat
Nothing Impossible

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Do you really need such an old compiler version ??

Why not use the 4.1.2 zip from the beginning of this script.
And maybe read the first post in full , meaning you might need the texinfo package etc ...

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Mr.Bingo. I will try that one.... Will it work with Fedora linux?

ATMEL--Heart Beat
Nothing Impossible

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

srinivasandelta wrote:
Thanks Mr.Bingo. I will try that one.... Will it work with Fedora linux?

It should... :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, where are the scripts for this now? Are they still available?

Thanks

Trev

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Reply to my own, now dumb question. After maximising the display, the shortcuts magically appeared at the top.

Sorry.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There seems to be a bug with build-avr-gcc-4.2.2-libc-1.6.2-makeinfo-fixed.tar.gz.
On different Linux distributions i receive a avr.sc.rej while patching binutils.
The patch is unnable to find

  MEMORY
  {
-   text   (rx)   : ORIGIN = 0, LENGTH = $TEXT_LENGTH
-   data   (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = $DATA_LENGTH
-   eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
  }

because the 'data'-line in the source file looks different...

   data   (rw!x) : ORIGIN = 0x800060, LENGTH = $DATA_LENGTH

Changing this line in binutils-patch-newsections.diff to read like the source file fixed the problem.

edit: UPPS. you also need to change the replacement line or the resulting linker script will fail.

... the only thing you cannot unscramble is eggs...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

wBoellmann wrote:
There seems to be a bug with build-avr-gcc-4.2.2-libc-1.6.2-makeinfo-fixed.tar.gz.
On different Linux distributions i receive a avr.sc.rej while patching binutils.
The patch is unnable to find

  MEMORY
  {
-   text   (rx)   : ORIGIN = 0, LENGTH = $TEXT_LENGTH
-   data   (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = $DATA_LENGTH
-   eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
  }

because the 'data'-line in the source file looks different...

   data   (rw!x) : ORIGIN = 0x800060, LENGTH = $DATA_LENGTH

Changing this line in binutils-patch-newsections.diff to read like the source file fixed the problem.

edit: UPPS. you also need to change the replacement line or the resulting linker script will fail.

I can confirm the bug , and it seems to be in patch-newsections. Will contact the patch maintainer (jörg).

Edit: This is fixed in the new script in the first post (Oct-28-2008).

So you can skip the next 2 post , with the old patch , and the "Interrim script"

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

for now you can use the old patch

Please save the below to the direcory where you have the patches , and name it binutils-patch-newsections.diff
do remember the blank line at the end.

--- ld/scripttempl/avr.sc.old	2007-09-14 06:32:02.437500000 -0600
+++ ld/scripttempl/avr.sc	2007-09-14 06:50:28.854125000 -0600
@@ -4,9 +4,12 @@ OUTPUT_ARCH(${ARCH})
 
 MEMORY
 {
-  text   (rx)   : ORIGIN = 0, LENGTH = $TEXT_LENGTH
-  data   (rw!x) : ORIGIN = 0x800060, LENGTH = $DATA_LENGTH
-  eeprom (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
+  text      (rx)   : ORIGIN = 0, LENGTH = $TEXT_LENGTH
+  data      (rw!x) : ORIGIN = 0x800060, LENGTH = $DATA_LENGTH
+  eeprom    (rw!x) : ORIGIN = 0x810000, LENGTH = 64K
+  fuse      (rw!x) : ORIGIN = 0x820000, LENGTH = 1K
+  lock      (rw!x) : ORIGIN = 0x830000, LENGTH = 1K
+  signature (rw!x) : ORIGIN = 0x840000, LENGTH = 1K
 }
 
 SECTIONS
@@ -196,6 +199,24 @@ SECTIONS
     ${RELOCATING+ __eeprom_end = . ; }
   } ${RELOCATING+ > eeprom}
 
+  .fuse ${RELOCATING-0}:
+  {
+    KEEP(*(.fuse))
+    KEEP(*(.lfuse))
+    KEEP(*(.hfuse))
+    KEEP(*(.efuse))
+  } ${RELOCATING+ > fuse}
+
+  .lock ${RELOCATING-0}:
+  {
+    KEEP(*(.lock*))
+  } ${RELOCATING+ > lock}
+
+  .signature ${RELOCATING-0}:
+  {
+    KEEP(*(.signature*))
+  } ${RELOCATING+ > signature}
+
   /* Stabs debugging sections.  */
   .stab 0 : { *(.stab) }
   .stabstr 0 : { *(.stabstr) }


/Bingo

Pages