avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patch #9543] Add avrxmega3 devices.


From: Balint Cristian
Subject: [patch #9543] Add avrxmega3 devices.
Date: Tue, 1 Dec 2020 06:52:19 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36

Follow-up Comment #27, patch #9543 (project avr-libc):

[comment #26 comment #26:]
> Great work all. As I am not so knowlegable@Linux, it took me a while to get
that running, lots of compile problems, try and error, so I wanted to share
what finally worked for me.
> 


Thank you Wasti !
One issue as you pointed out is community support. We do best what we can,
each person within their own area of expertise, but proper documentation and
promotion is always an issue.
* Also I recommend gcc 8.0.0 (very fist gcc8 release) for proper LTO (-Os,
smallest possible size) working, anything >gcc8.0.0 will lead to 30% increase
of binary (in some corner cases).* Spent a lot of time tracking down issues
(by tracking commits) with LTO across gcc8 then gcc9 up to gcc10 and now with
a list of commits/reverts I found hard even to raise the issue to the GCC
community.





> # Other than in the manual below, I did install everything into the default
path. No PREFIX, as prefixing did not work on my environment.
> #
https://www.nongnu.org/avr-libc/user-manual/install_tools.html#install_avr_gcc
> 
> # The following process did work for me.
> cat /proc/version
> #Linux version 5.4.0-52-generic (buildd@lgw01-amd64-060) (gcc version 9.3.0
(Ubuntu 9.3.0-17ubuntu1~20.04))
> 
> sudo apt remove gcc-avr binutils-avr avr-libc
> 
> # Important: close teminal and reopen to remove cached links to the
binaries
> 
> #set up directory
> mkdir ~/libc-compile
> cd ~/libc-compile
> 
> #
> #compile and install binutils
> #
> 
> wget ftp://sourceware.org/pub/binutils/snapshots/binutils-2.34.90.tar.xz
> tar -xf binutils-2.34.90.tar.xz
> cd binutils-2.34.90
> 
> mkdir obj-avr
> cd obj-avr
> ../configure --target=avr --disable-nls
> make
> sudo make install
> 
> #check version
> avr-ld --version
> 
> #
> #compile and install GCC, this takes a wile, have lunch...
> #
> 
> cd ~/libc-compile
> 
> git clone -b releases/gcc-10.1.0 --single-branch
git://gcc.gnu.org/git/gcc.git
> ./contrib/download_prerequisites
> 
> cd gcc
> 
> mkdir obj-avr
> cd obj-avr
> ../configure --target=avr --enable-languages=c,c++ --disable-nls
--disable-libssp --with-dwarf2
> make
> sudo make install
> 
> #check version
> avr-gcc --version
> 
> #
> #patch, compile and install avr-libc
> #
> cd ~/libc-compile
> 
> svn co svn://svn.savannah.nongnu.org/avr-libc/trunk
> cd trunk/avr-libc/
> 
> wget -O - -q https://savannah.nongnu.org/patch/download.php?file_id=48974 >>
avrxmega3-v10.diff.xz
> xz --decompress avrxmega3-v10.diff.xz
> 
> patch -p0 < avrxmega3-v10.diff
> ./bootstrap
> ./configure --build=`./config.guess` --host=avr
> make
> sudo make install
> 
> ###################################
> #now test if it compiles
> ###################################
> 
> mkdir ~/libc-compile/test-program
> cd ~/libc-compile/test-program
> 
> echo "#define __AVR_ATtiny1604__
> #include <avr/io.h>
> int
> main(void)
> {
>         while (1);
> }" >> main.c
> 
> avr-gcc -std=c99 -Wall -g -Os -mmcu=avrxmega3 -DF_CPU=1200000 -I.  -o
main.bin main.c
> avr-objcopy -j .text -j .data -O ihex main.bin main.hex
> 
> 
> 
>   

[comment #26 comment #26:]
> Great work all. As I am not so knowlegable@Linux, it took me a while to get
that running, lots of compile problems, try and error, so I wanted to share
what finally worked for me.
> 
> # Other than in the manual below, I did install everything into the default
path. No PREFIX, as prefixing did not work on my environment.
> #
https://www.nongnu.org/avr-libc/user-manual/install_tools.html#install_avr_gcc
> 
> # The following process did work for me.
> cat /proc/version
> #Linux version 5.4.0-52-generic (buildd@lgw01-amd64-060) (gcc version 9.3.0
(Ubuntu 9.3.0-17ubuntu1~20.04))
> 
> sudo apt remove gcc-avr binutils-avr avr-libc
> 
> # Important: close teminal and reopen to remove cached links to the
binaries
> 
> #set up directory
> mkdir ~/libc-compile
> cd ~/libc-compile
> 
> #
> #compile and install binutils
> #
> 
> wget ftp://sourceware.org/pub/binutils/snapshots/binutils-2.34.90.tar.xz
> tar -xf binutils-2.34.90.tar.xz
> cd binutils-2.34.90
> 
> mkdir obj-avr
> cd obj-avr
> ../configure --target=avr --disable-nls
> make
> sudo make install
> 
> #check version
> avr-ld --version
> 
> #
> #compile and install GCC, this takes a wile, have lunch...
> #
> 
> cd ~/libc-compile
> 
> git clone -b releases/gcc-10.1.0 --single-branch
git://gcc.gnu.org/git/gcc.git
> ./contrib/download_prerequisites
> 
> cd gcc
> 
> mkdir obj-avr
> cd obj-avr
> ../configure --target=avr --enable-languages=c,c++ --disable-nls
--disable-libssp --with-dwarf2
> make
> sudo make install
> 
> #check version
> avr-gcc --version
> 
> #
> #patch, compile and install avr-libc
> #
> cd ~/libc-compile
> 
> svn co svn://svn.savannah.nongnu.org/avr-libc/trunk
> cd trunk/avr-libc/
> 
> wget -O - -q https://savannah.nongnu.org/patch/download.php?file_id=48974 >>
avrxmega3-v10.diff.xz
> xz --decompress avrxmega3-v10.diff.xz
> 
> patch -p0 < avrxmega3-v10.diff
> ./bootstrap
> ./configure --build=`./config.guess` --host=avr
> make
> sudo make install
> 
> ###################################
> #now test if it compiles
> ###################################
> 
> mkdir ~/libc-compile/test-program
> cd ~/libc-compile/test-program
> 
> echo "#define __AVR_ATtiny1604__
> #include <avr/io.h>
> int
> main(void)
> {
>         while (1);
> }" >> main.c
> 
> avr-gcc -std=c99 -Wall -g -Os -mmcu=avrxmega3 -DF_CPU=1200000 -I.  -o
main.bin main.c
> avr-objcopy -j .text -j .data -O ihex main.bin main.hex
> 
> 
> 
>   

[comment #26 comment #26:]
> Great work all. As I am not so knowlegable@Linux, it took me a while to get
that running, lots of compile problems, try and error, so I wanted to share
what finally worked for me.
> 
> # Other than in the manual below, I did install everything into the default
path. No PREFIX, as prefixing did not work on my environment.
> #
https://www.nongnu.org/avr-libc/user-manual/install_tools.html#install_avr_gcc
> 
> # The following process did work for me.
> cat /proc/version
> #Linux version 5.4.0-52-generic (buildd@lgw01-amd64-060) (gcc version 9.3.0
(Ubuntu 9.3.0-17ubuntu1~20.04))
> 
> sudo apt remove gcc-avr binutils-avr avr-libc
> 
> # Important: close teminal and reopen to remove cached links to the
binaries
> 
> #set up directory
> mkdir ~/libc-compile
> cd ~/libc-compile
> 
> #
> #compile and install binutils
> #
> 
> wget ftp://sourceware.org/pub/binutils/snapshots/binutils-2.34.90.tar.xz
> tar -xf binutils-2.34.90.tar.xz
> cd binutils-2.34.90
> 
> mkdir obj-avr
> cd obj-avr
> ../configure --target=avr --disable-nls
> make
> sudo make install
> 
> #check version
> avr-ld --version
> 
> #
> #compile and install GCC, this takes a wile, have lunch...
> #
> 
> cd ~/libc-compile
> 
> git clone -b releases/gcc-10.1.0 --single-branch
git://gcc.gnu.org/git/gcc.git
> ./contrib/download_prerequisites
> 
> cd gcc
> 
> mkdir obj-avr
> cd obj-avr
> ../configure --target=avr --enable-languages=c,c++ --disable-nls
--disable-libssp --with-dwarf2
> make
> sudo make install
> 
> #check version
> avr-gcc --version
> 
> #
> #patch, compile and install avr-libc
> #
> cd ~/libc-compile
> 
> svn co svn://svn.savannah.nongnu.org/avr-libc/trunk
> cd trunk/avr-libc/
> 
> wget -O - -q https://savannah.nongnu.org/patch/download.php?file_id=48974 >>
avrxmega3-v10.diff.xz
> xz --decompress avrxmega3-v10.diff.xz
> 
> patch -p0 < avrxmega3-v10.diff
> ./bootstrap
> ./configure --build=`./config.guess` --host=avr
> make
> sudo make install
> 
> ###################################
> #now test if it compiles
> ###################################
> 
> mkdir ~/libc-compile/test-program
> cd ~/libc-compile/test-program
> 
> echo "#define __AVR_ATtiny1604__
> #include <avr/io.h>
> int
> main(void)
> {
>         while (1);
> }" >> main.c
> 
> avr-gcc -std=c99 -Wall -g -Os -mmcu=avrxmega3 -DF_CPU=1200000 -I.  -o
main.bin main.c
> avr-objcopy -j .text -j .data -O ihex main.bin main.hex
> 
> 
> 
>   

    _______________________________________________________

Reply to this item at:

  <https://savannah.nongnu.org/patch/?9543>

_______________________________________________
  Message sent via Savannah
  https://savannah.nongnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]