37

I tried to install arm-none-eabi-gdb as a part of gcc-arm-embedded package.

I added PPA:

sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa

and executed:

sudo apt install gcc-arm-embedded 

It responded with:

Err:8 http://ppa.launchpad.net/team-gcc-arm-embedded/ppa/ubuntu focal Release
  404  Not Found [IP: 91.189.95.83 80]

As far as I understand - gcc-arm-embedded doesn't have a version for Ubuntu 20. So I've changed release version for this PPA in Software & Updates to bionic so that I can avoid error 404.

Even though Ubuntu 20 has libisl22, now I have unmet dependencies when I try to install gcc-arm-embedded:

The following packages have unmet dependencies:
 gcc-arm-embedded : Depends: libisl15 (>= 0.15) but it is not installable
E: Unable to correct problems, you have held broken packages.

I was unable to find a way to install requested version of libisl, as apt offers only two versions - libisl22 and libisl-dev and both are not accepted by installer.

I need advice on how to install arm-none-eabi-gdb.

EsmaeelE
  • 425
  • 7
  • 16

5 Answers5

47

It turned out that ARM decided to make our life easier (sarcasm) by deprecating the use of PPA - their page at launchpad now has an anouncement: "... all new binary and source packages will not be released on Launchpad henceforth ...".

So, to make use of their latest arm-none-eabi-gdb you have to install gcc-arm-embedded manually.

Remove arm-none-eabi-gcc from your system:

sudo apt remove gcc-arm-none-eabi

Download latest version (Linux x86_64 Tarball) from their website, check its MD5. Unpack it into some directory. I used /usr/share/ :

sudo tar xjf gcc-arm-none-eabi-YOUR-VERSION.bz2 -C /usr/share/

Create links so that binaries are accessible system-wide:

sudo ln -s /usr/share/gcc-arm-none-eabi-YOUR-VERSION/bin/arm-none-eabi-gcc /usr/bin/arm-none-eabi-gcc 
sudo ln -s /usr/share/gcc-arm-none-eabi-YOUR-VERSION/bin/arm-none-eabi-g++ /usr/bin/arm-none-eabi-g++
sudo ln -s /usr/share/gcc-arm-none-eabi-YOUR-VERSION/bin/arm-none-eabi-gdb /usr/bin/arm-none-eabi-gdb
sudo ln -s /usr/share/gcc-arm-none-eabi-YOUR-VERSION/bin/arm-none-eabi-size /usr/bin/arm-none-eabi-size
sudo ln -s /usr/share/gcc-arm-none-eabi-YOUR-VERSION/bin/arm-none-eabi-objcopy /usr/bin/arm-none-eabi-objcopy

Install dependencies. ARM's "full installation instructions" listed in readme.txt won't tell you what dependencies are - you have to figure it out by trial and error. In my system I had to manually create symbolic links to force it to work:

sudo apt install libncurses-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/libncurses.so.6 /usr/lib/x86_64-linux-gnu/libncurses.so.5
sudo ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6 /usr/lib/x86_64-linux-gnu/libtinfo.so.5

Check if it works:

arm-none-eabi-gcc --version
arm-none-eabi-g++ --version
arm-none-eabi-gdb --version
arm-none-eabi-size --version
8

I've wrapped the script here by @kmhallen into a semi-automated debian package builder here: https://gitlab.com/alelec/arm-none-eabi-gcc-deb/-/releases

Installing a package like this means you can skip the tedious manual symlinks to put tools on the path, and just as importantly you can uninstall / upgrade to newer packages (assuming I remember to make more packages)

7

The toolchain is now only provided on their website: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads

After extracting, add the path to the bin folder to the system path:

cd /opt
wget "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2"
tar -jxf gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
rm gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
export PATH="/opt/gcc-arm-none-eabi-10.3-2021.10/bin:$PATH"

Alternatively, here is a script to generate a Debian package and install it to the /usr directory. This way you don't have to export the path all the time, and it can be removed with sudo apt purge gcc-arm-none-eabi

#!/bin/bash

VER=15:10.3-2021.10-9 URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 echo "Creating gcc-arm-none-eabi debian package version $VER"

echo "Entering temporary directory..." cd /tmp

echo "Downloading..." curl -fSL -A "Mozilla/4.0" -o gcc-arm-none-eabi.tar "$URL"

echo "Extracting..." tar -xf gcc-arm-none-eabi.tar rm gcc-arm-none-eabi.tar

echo "Generating debian package..." mkdir gcc-arm-none-eabi mkdir gcc-arm-none-eabi/DEBIAN mkdir gcc-arm-none-eabi/usr echo "Package: gcc-arm-none-eabi" > gcc-arm-none-eabi/DEBIAN/control echo "Version: $VER" >> gcc-arm-none-eabi/DEBIAN/control echo "Architecture: amd64" >> gcc-arm-none-eabi/DEBIAN/control echo "Maintainer: maintainer" >> gcc-arm-none-eabi/DEBIAN/control echo "Description: Arm Embedded toolchain" >> gcc-arm-none-eabi/DEBIAN/control mv gcc-arm-none-eabi-/ gcc-arm-none-eabi/usr/ dpkg-deb --build --root-owner-group gcc-arm-none-eabi

echo "Installing..." sudo apt install ./gcc-arm-none-eabi.deb -y --allow-downgrades

echo "Removing temporary files..." rm -r gcc-arm-none-eabi*

echo "Done."

Check if it works:

arm-none-eabi-gcc --version
5

The answer from Aleksander solved 99 percent of my issues, however after running make I got one error arm-none-eabi-objcopy : command not found. So I had do make one more symlink to get the files generated.

sudo ln -s /usr/share/gcc-arm-none-eabi-your-version/bin/arm-none-eabi-objcopy /usr/bin/arm-none-eabi-objcopy

I tried to add this as comment to the answer but I don't have enough points to do that.

PE2BZ
  • 51
1

As an extension to the other answers. Resolving the issue of non-existing libncurses5 and libtinfo5, after unpacking the ARM Embedded Toolchain.

Instead of symlinking to newer package version, actually install the expected package.

This even works for Ubuntu 24.04 where you cannot install the package using apt.

See which libraries that are missing

See the missing libraries with ldd (shared object dependencies):

ldd "$(which arm-none-eabi-gdb)"

Which outputs something similar to this. Observe the libraries marked with '=> not found'

        linux-vdso.so.1 (0x00007ffe6df20000)
        libncurses.so.5 => not found
        libtinfo.so.5 => not found
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f38ff7a8000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f38fe983000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f38fe89a000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f38ff779000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f38ff774000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f38fe688000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f38ff7b4000)

Install the missing libraries

Get the packages from Ubuntu's own archive:

# libtinfo5
wget http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libtinfo5_6.4-2_amd64.deb

libncurses5

wget http://archive.ubuntu.com/ubuntu/pool/universe/n/ncurses/libncurses5_6.4-2_amd64.deb

Then install the .deb packages using dpkg:

# libtinfo5
sudo dpkg -i ./libtinfo5_6.4-2_amd64.deb

libncurses5

sudo dpkg -i ./libncurses5_6.4-2_amd64.deb

Extra info about STM32CubeCLT

This also works for e.g. STM32CubeCLT - Command Line Tool which ships arm-none-eabi-gdb and which can detect that the wrong library version is used.

Example output if you have symlinked libncurses.so.5 to libncurses.so.6:

arm-none-eabi-gdb: /lib/x86_64-linux-gnu/libncurses.so.5: version `NCURSES_5.3.20021019' not found (required by arm-none-eabi-gdb)
arm-none-eabi-gdb: /lib/x86_64-linux-gnu/libncurses.so.5: version `NCURSES_5.1.20000708' not found (required by arm-none-eabi-gdb)
arm-none-eabi-gdb: /lib/x86_64-linux-gnu/libncurses.so.5: version `NCURSES_5.6.20061217' not found (required by arm-none-eabi-gdb)
arm-none-eabi-gdb: /lib/x86_64-linux-gnu/libncurses.so.5: version `NCURSES_5.0.19991023' not found (required by arm-none-eabi-gdb)
arm-none-eabi-gdb: /lib/x86_64-linux-gnu/libtinfo.so.5: version `NCURSES_TINFO_5.0.19991023' not found (required by arm-none-eabi-gdb)