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.
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.
Very good article! We will be linking to this great content on our website. Keep up the good writing. Clarie Dan September
I have read some excellent stuff here. Definitely worth bookmarking for revisiting. Merla Pennie Gherardi
Hi there to all, how is the whole thing, I think every one is getting more from this site, and your views are nice in favor of new people. Aidan Yorgo Behre
I simply wanted to thank you a lot more for this amazing blog you have made here. Anabel Joshua Tani
This is an excellent, an eye-opener for sure! Good job on this article! Good job on this article! You appear to know a lot about this. Quinn Allin Mariellen
Howdy! I just wish to give you a huge thumbs up for the great info you have got here on this post. I will be coming back to your blog for more soon. Kenna Dennie Serg
Ahaa, its fastidious conversation on the topic of this post at this place at this webpage, I have read all that, so now me also commenting here. Fayth Worthy Godard
You made some nice points there. I looked on the internet for the subject matter and found most individuals will consent with your blog. Minny Cyrillus Eurydice
You made certain good points there. I did a search on the subject and found mainly folks will consent with your blog. Malanie Rafe Cox
I really like and appreciate your blog article. Really looking forward to read more. Awesome. Adrienne Wilton Hank
I am regular visitor, how are you everybody? This post posted at this web page is in fact fastidious. Carlynne Darrick Sibell
Very good write-up. I certainly love this site. Thanks! Meridel Allin Celestine