# Mbed CLI

Many experienced developers prefer to work offline. To meet this need, Arm provides Arm Mbed CLI 1, a command-line tool packaged as mbed-cli and based on Python.

Mbed CLI 1 enables Git- and Mercurial-based version control, dependencies management, code publishing, support for remotely hosted repositories (GitHub, GitLab and mbed.org), use of the Arm Mbed OS build system, export functions and other operations.

# Git

Make sure to install Git first. Follow the GIT installation guide for this.

# GCC Arm Embedded Compiler

Next install the latest GCC Arm Embedded Compiler which can be found at https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads (opens new window).

Make sure to select Add to PATH at the end of the installation procedure.

Now restart your machine.

Next check if the compiler is available and that you have version 9 or higher using the command arm-none-eabi-g++ --version:

Arm Embedded Compiler

WARNING

If the compilation process fails because the compiler version mismatches (6 vs 9) than you have not selected to add GCC Arm Embedded Compiler to you PATH. Either re-install the compiler or add the directory C:\Program Files(x86)\GNU Arm Embedded Toolchain\9 2020-q2-update\bin to your PATH manually. Also make sure that the C:\Program Files(x86)\GNU Tools Arm Embedded\6 2017-q2-update\bin is not present.

# Using Conda

The preferred option for installing mbed cli is to use a virtual environment. This fixes a lot of conflicts regarding different Python versions.

Start by lauching the Anaconda Powershell Prompt and creating a new conda environment with python v3.7.9:

conda create -n mbed python=3.7.9

Mbed Env

Answer y when requested and wait for the creation process to finish.

Mbed env created

Now activate the environment (you will have to do this every time you wish to use mbed):

conda activate mbed

Mbed env activated

Listing Environments

To list all available conda environment use the conda env list command.

Now to install the mbed-cli tool, use the pip python package manager (inside the environment):

pip install mbed-cli

Check if all went well by executing the mbed --version command:

Mbed Check

Last Updated: 9/27/2021, 3:53:28 PM