How To Install gcc-msp430 on Ubuntu 18.04

In this tutorial we learn how to install gcc-msp430 on Ubuntu 18.04. gcc-msp430 is GNU C compiler (cross compiler for MSP430)

Introduction

In this tutorial we learn how to install gcc-msp430 on Ubuntu 18.04.

What is gcc-msp430

gcc-msp430 is:

This is the GNU C compiler, a fairly portable optimizing compiler for C for TI’s MSP430 architecture. This package is primarily for MSP430 developers and cross-compilers and is not needed by normal users.

BEWARE: due to a bug in the memory layout reference of FRAM-based chips, this package DOES NOT WORK with MSP430FR5xxx chips (eg. FraunchPad devkit). DO NOT use gcc-msp430 on that chip series, as you will lose access to JTAG and BSL, and permanently BRICK your chip!

There are three methods to install gcc-msp430 on Ubuntu 18.04. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install gcc-msp430 Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install gcc-msp430 using apt-get by running the following command:

sudo apt-get -y install gcc-msp430

Install gcc-msp430 Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install gcc-msp430 using apt by running the following command:

sudo apt -y install gcc-msp430

Install gcc-msp430 Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Ubuntu. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install gcc-msp430 using aptitude by running the following command:

sudo aptitude -y install gcc-msp430

How To Uninstall gcc-msp430 on Ubuntu 18.04

To uninstall only the gcc-msp430 package we can use the following command:

sudo apt-get remove gcc-msp430

Uninstall gcc-msp430 And Its Dependencies

To uninstall gcc-msp430 and its dependencies that are no longer needed by Ubuntu 18.04, we can use the command below:

sudo apt-get -y autoremove gcc-msp430

Remove gcc-msp430 Configurations and Data

To remove gcc-msp430 configuration and data from Ubuntu 18.04 we can use the following command:

sudo apt-get -y purge gcc-msp430

Remove gcc-msp430 configuration, data, and all of its dependencies

We can use the following command to remove gcc-msp430 configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge gcc-msp430

References

Summary

In this tutorial we learn how to install gcc-msp430 package on Ubuntu 18.04 using different package management tools: apt, apt-get and aptitude.