Method 1: Mbed CLI configuration

Mbed CLI stores its own configuration about compiler locations in both project local settings and user wide global settings. You may set and view these settings with the mbed config command. For example, set the Arm Compiler 5 location with the command:

Method 2: environment variable

In addition to the manually configured compiler locations, Mbed CLI detects executables that are in paths specified by toolchain-specific environment variables.

Toolchain

Environment variable

Arm Compiler 5

MBED_ARM_PATH

Arm Compiler 6

MBED_ARMC6_PATH

IAR EWARM Compiler

MBED_IAR_PATH

GCC Arm Embedded Compiler

MBED_GCC_ARM_PATH

Method 3: system PATH

In addition to toolchain-specific environment variables, Mbed CLI detects executables that are in your system PATH. This means that if you install a toolchain in the system PATH (different for each OS), Mbed CLI will automatically find the toolchain.

Optional: configuring multiple toolchains

All the settings described in the previous sections can configure a different version of the same toolchain, and Mbed CLI has a set of rules to seamlessly switch between these versions for an individual mbed compile or mbed test invocation. Mbed CLI picks the most specific version, from most specific to least specific, in this order:

mbed_settings.py

Mbed CLI local configuration

Mbed CLI global configuration

Environment variables

The PATH environment variable

To use a standard toolchain for general purpose development, you may use any method from 3 to 5. To override a toolchain version for a specific project, you may use methods 1 and 2. All of these methods may coexist.

Optional: add bash tab completion

To install mbed-cli bash tab completion:

Navigate to the tools/bash_completion directory.

Copy the mbed script into your /etc/bash_completion.d/ or /usr/local/etc/bash_completion.d directory.

Important Information for this Arm website

This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.