1. Download and install prerequisites
Python: Mbed CLI is a Python script, so you'll need Python to use it. We test Mbed CLI with Python versions 2.7.11, and with 3.6.5 and greater.
You can download and install Python, or use your package manager. For example, you can use the following in Ubuntu (note that it includes pip, the following item on our list):
$ sudo apt-get install python2.7 python-pip
Note: Python 3 usage is not compatible with Mbed OS versions older than 5.9 and Mbed CLI toolchain versions older than 1.7.2.
To install Pip, run
easy_install --user pipfrom your command-line.
Note: Mbed CLI toolchain versions older than 1.5.1 are not compatible with
pipversion 10.0 (or newer). Please use the latest Mbed CLI with newer version of
Git and Mercurial: Mbed CLI supports both Git and Mercurial repositories, and you may need libraries from both sources as you work, so please install both:
Optional: Using a virtual environments
If your main environment has an unsupported Python version, you may want to install Mbed CLI on a virtual environment. Mbed CLI is compatible with Virtual Python Environment (virtualenv).
2. Install a compiler
Download and install one of the following compilers: GCC Arm, Arm Compiler 5, Arm Compiler 6 or IAR. To download the latest toolchains, visit the supported compilers page.
Note: When installing the Arm Compiler 5 on a 64-bit Linux machine, you may also need to install the i386 architecture package:
``` $ sudo dpkg --add-architecture i386 $ sudo apt-get update $ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 ```
3. Install Mbed CLI
To install Mbed CLI, run
pip install mbed-cli from your command-line.
You can verify Mbed CLI installed correctly by running
4. Set up the environment
For any installed toolchain, be sure to add the Mbed CLI global configuration:
$ mbed config -G ARM_PATH <path to ARM bin\> [mbed] <path to ARM bin\> now set as global ARM_PATH $ mbed config --list [mbed] Global config: ARM_PATH=<path to ARM bin\>
Note: You can also apply the same configuration to the IAR and GNU toolchains using