Installing GNU Arm Embedded Toolchain

If you are working on Arm Cortex M microcontroller then you will need to setup GNU Arm Embedded Toolchain, it consist of compiler, debugger and much more. The GCC compiler and GDB debugger comes in single package.

The procedure to setup is bit different due to target OS, but the important thing is to select the right version of toolchain. It has been observed that latest version of toolchains have aggressive optimization that can cause to failed execution of code logic on target hardware, however the compilation will give no warnings/errors.

I prefer older version of toolchain that just work fine. To download the toolchain according to your target OS please go to below link , scroll down and click GNU Arm Embedded Toolchain 6-2016-Q4-major Dec 21, 2016. There will be options visible for Windows and Linux 64-bit, click on the Appropriate link to download toolchain.

https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads#

Installing on Windows

Installing on Windows is very simple, just download and execute the installer and that’s it. To verify the installed version just execute the below command. The below command will check the GCC and GDB installed version.

arm-none-eabi-gcc -v

arm-none-eabi-gdb -v

Installing on Linux (Ubuntu or Mint)

It is little bit different than Windows. After downloading the *.tar.bz2 file, there will be in-built arm packages that we need to remove. Please execute the below command to remove existing arm packages from Linux.

sudo apt remove binutils-arm-none-eabi gcc-arm-none-eabi libnewlib-arm-none-eabi

Now its time to install the Arm embedded toolchain, execute the below commands step by step to install. It is recommended to install toolchain in “opt” folder under the home. Replace “****” with your actual version of downloaded toolchain.

$ mkdir opt
$ cd opt
$ tar xjf ~/Downloads/gcc-arm-none-eabi-*******-linux.tar.bz2
$ chmod -R -w gcc-arm-none-eabi-*******

Now the toolchain is installed but not in your user path. To execute this toolchain from any path we need to add it to user environment. Under you HOME folder edit the .bashrc and add the below line at the end of file and save it.

$ sudo gedit .bashrc

Add this line towards the end of file and save it.

export PATH=”$PATH:$HOME/opt/gcc-arm-none-eabi-6_2-2016q4/bin”

Now you need to restart your shell or you can execute any below command to re-read the user shell script.

$ source ~/.bashrc
or
$ exec bash
or
$ exec "$BASH"

After that you are good to go.

12 Comments

Add a Comment

Your email address will not be published. Required fields are marked *