linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: werner@almesberger.net
Cc: Stefan Schmidt <stefan@datenfreihafen.org>,
	Alexander Aring <alex.aring@gmail.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	linux-wpan@vger.kernel.org,
	Miquel Raynal <miquel.raynal@bootlin.com>
Subject: [PATCH atusb/fw 1/2] atusb: fw: Update toolchain instructions
Date: Mon,  5 Sep 2022 22:43:17 +0200	[thread overview]
Message-ID: <20220905204318.1324284-1-miquel.raynal@bootlin.com> (raw)

Those instructions do not work anymore for several reaons:
- Two out of the three files to download return a 404 error:
      * The binutils version does not exist, it was 2.21.1 or 2.21.1a
        instead of just 2.21.
      * The avr-libc is no longer hosted on the pointed website, I've
        found an alternate.
- The binutils version mentioned is not able to compile the firmware on
  a recent distribution, the Internet advised to update its version and
  it worked.
- Most of these compilations will throw warnings if you use a recent
  gcc. Sometimes -Werror is set and it fails the build. To avoid that,
  just use --disable-werror in the ./configure options.
- I had issues building the gcc doc but those issues are trivial to
  fix inline.

Update the instructions for building the toolchain and while at it,
start the file by mentioning that this is maybe not useful anymore, and
provide the packets to install.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 atusb/fw/README | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/atusb/fw/README b/atusb/fw/README
index 99ceb22..44f65f5 100644
--- a/atusb/fw/README
+++ b/atusb/fw/README
@@ -1,4 +1,6 @@
-Requires a very recent toolchain, because ATmega32U2 is relatively new.
+- Toolchain:
+
+  apt install avr-gcc libc-avr
 
 - Building:
 
@@ -64,12 +66,13 @@ apt-get install libmpfr-dev libmpc-dev
 
 # binutils
 
-wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
-tar xfj binutils-2.21.tar.bz2 
-cd binutils-2.21
-./configure --target=avr --disable-nls
+wget https://ftp.gnu.org/gnu/binutils/binutils-2.27.tar.bz2
+tar xfj binutils-2.27.tar.bz2
+cd binutils-2.27
+./configure --target=avr --disable-nls --disable-werror
 make
 make install
+ln -s /usr/local/bin/avr-as /usr/bin/avr-as
 
 # gcc
 
@@ -85,9 +88,8 @@ cd obj-avr
 make
 make install
 
-wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-1.7.1.tar.bz2
-tar xfj avr-libc-1.7.1.tar.bz2 
-cd avr-libc-1.7.1
+wget https://android.googlesource.com/toolchain/avr-libc/+archive/master/avr-libc-1.7.1.tar.gz
+tar xf avr-libc-1.7.1.tar.gz
 ./bootstrap	# the automake at the end takes a while
 ./configure --build=`./config.guess` --host=avr
 make
-- 
2.34.1


             reply	other threads:[~2022-09-05 20:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-05 20:43 Miquel Raynal [this message]
2022-09-05 20:43 ` [PATCH atusb/fw 2/2] atusb: fw: Provide TRAC status Miquel Raynal
2022-09-06  0:16   ` Alexander Aring
2022-09-06  0:19     ` Alexander Aring
2022-09-06  8:08       ` Miquel Raynal
2022-09-05 23:33 ` [PATCH atusb/fw 1/2] atusb: fw: Update toolchain instructions Alexander Aring
2022-09-06  7:56   ` Miquel Raynal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220905204318.1324284-1-miquel.raynal@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=alex.aring@gmail.com \
    --cc=linux-wpan@vger.kernel.org \
    --cc=stefan@datenfreihafen.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=werner@almesberger.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).