You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tools/offline/cli-setup.md
+27-64Lines changed: 27 additions & 64 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,10 @@
1
-
2
1
## Setup
3
2
4
3
You can install Mbed CLI on Windows, Linux and Mac OS X.
5
4
6
5
<spanclass="tips">If you're working on Windows, we recommend you use the [Windows installer for Mbed CLI](#windows-installer-for-mbed-cli). For Linux and Mac OS X, refer to the section [Installing Mbed CLI standalone stable version](#installing-mbed-cli-standalone-stable-version)</span>
7
6
8
-
###Requirements
7
+
## Requirements
9
8
10
9
-**Python:** Mbed CLI is a Python script, so you'll need Python to use it:
11
10
- We test Mbed CLI with <ahref="https://www.python.org/downloads/release/python-2711/"target="_blank">version 2.7.11 of Python</a>. It is not compatible with Python 3.
@@ -33,36 +32,13 @@ Mbed CLI is compatible with <a href="https://pypi.python.org/pypi/virtualenv" ta
33
32
34
33
You may want to install Mbed CLI on a virtual environment if your main environment has an unsupported Python version.
35
34
36
-
### Installing the stable version
37
-
38
-
You can get the latest stable version of Mbed CLI through pip by running:
39
-
40
-
```
41
-
$ pip install mbed-cli
42
-
```
43
-
44
-
On Linux or Mac, you may need to run with `sudo`.
45
-
46
-
#### Optional: installing the development version
47
-
48
-
If you are interested in working with the development version (and perhaps contributing to Mbed CLI), clone the <a href="https://github.com/ARMmbed/mbed-cli" target="_blank">development repository</a>:
Once cloned, you can install Mbed CLI as a Python package:
55
-
56
-
```
57
-
$ python setup.py install
58
-
```
59
-
60
-
On Linux or Mac, you may need to run with `sudo`.
61
35
62
-
#### Windows installer for Mbed CLI
36
+
## Installing with the Windows installer
63
37
64
38
Mbed CLI for Windows installs <a href="https://github.com/ARMmbed/mbed-cli" target="_blank">Mbed CLI</a> with all requirements on Windows 7 and newer (both the 32- and 64-bit versions).
65
39
40
+
### Included components
41
+
66
42
The Windows installer for Mbed CLI includes the following components:
67
43
68
44
- **Python** - Mbed CLI is a Python script, so you need Python to use it. The installer installs <a href="https://www.python.org/downloads/release/python-2713/" target="_blank">version 2.7.13 of Python</a>. It is not compatible with Python 3.
@@ -73,7 +49,7 @@ The Windows installer for Mbed CLI includes the following components:
73
49
- **GNU Arm Embedded Toolchain** - <a href="https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads" target="_blank">GNU Embedded Toolchain for Arm</a>.
74
50
- **Mbed Windows serial port driver** - <a href="/docs/v5.7/tutorials/windows-serial-driver.html" target="_blank">serial port driver</a>.
75
51
76
-
##### Install Windows installer for Mbed CLI
52
+
### Running the installer
77
53
78
54
1. Download the latest executable from <a href="https://mbed-media.mbed.com/filer_public/50/38/5038849b-16a8-42f3-be7a-43d98c7a3af3/mbed_installer_v043.exe" target="_blank">`mbed-windows-installer v0.4.3`</a>.
79
55
2. Run `mbed_installer_v042.exe`.
@@ -83,68 +59,59 @@ The Windows installer for Mbed CLI includes the following components:
83
59
- Advanced: Allows you to select components.
84
60
5. Installer installs all selected components. Close it after it finishes.
85
61
86
-
###### Silent install
62
+
### Optional: silent install
87
63
88
-
You can execute installer silently without user interaction. Add `/S` flag in Windows command prompt during installation.
64
+
You can execute the installer silently without user interaction. Add `/S` flag in Windows command prompt during installation.
89
65
90
66
```
91
67
$ mbed_installer_{version}.exe /S
92
68
```
93
69
94
-
##### Usage
95
-
96
-
1. Open Windows command prompt.
97
-
2. Run:
98
-
99
-
```
100
-
$ mbed
101
-
```
102
-
103
-
3. To see help:
104
-
105
-
```
106
-
$ mbed --help
107
-
```
108
70
109
71
4. Check <a href="https://github.com/ARMmbed/mbed-cli" target="_blank">Mbed CLI</a> for more examples.
72
+
## Manual installation
110
73
111
-
### Installing Mbed CLI standalone stable version
74
+
### Installing the stable version
112
75
113
-
Find the latest stable version of Mbed CLI through pip by running:
76
+
You can get the latest stable version of Mbed CLI through pip by running:
114
77
115
78
```
116
79
$ pip install mbed-cli
117
80
```
118
81
119
82
On Linux or Mac, you may need to run with `sudo`.
120
83
121
-
#### Optional: installing the development version
84
+
### Optional: installing the development version
122
85
123
-
To work with the development version and contribute to Mbed CLI, clone the development repository [https://github.com/ARMmbed/mbed-cli](https://github.com/ARMmbed/mbed-cli):
86
+
If you are interested in working with the development version (and perhaps contributing to Mbed CLI), clone the <a href="https://github.com/ARMmbed/mbed-cli" target="_blank">development repository</a>:
There are some configuration that you must set before you can work with Mbed CLI.
140
107
141
-
#### Mandatory: setting PATH variables
108
+
### Mandatory: setting PATH variables
142
109
143
110
Mbed CLI requires adding the following to the system `PATH`:
144
111
145
112
- The paths for the Git and Mercurial executables (`git` and `hg`).
146
113
147
-
#### Mandatory: toolchain selection
114
+
### Mandatory: toolchain selection
148
115
149
116
You need to tell Mbed CLI where to find the toolchains that you want to use for compiling. Mbed CLI supports the following toolchains:
150
117
@@ -159,7 +126,7 @@ You must inform Mbed CLI about the location of your compiler using one of the fo
159
126
- Setting an environment variable.
160
127
- The `mbed_settings.py` file in the root of your program. The tools will automatically create this file if it doesn't already exist.
161
128
162
-
##### Through Mbed CLI configuration
129
+
#### Through Mbed CLI configuration
163
130
164
131
Mbed CLI stores its own configuration about compiler locations both in project local settings, and user wide "global" settings. You may set and view these settings with the `mbed config` command. For example, you set the Arm Compiler 5 location for your user with the command:
165
132
@@ -176,21 +143,21 @@ Mbed CLI supports a setting for each toolchain path. Below is a list of these se
176
143
- `IAR_PATH`: The path to the *base* directory of your IAR EWARM Compiler installation. This should be the directory containing the binaries for `iccarm` and friends. For example, if your IAR EWARM compiler executable is located at `C:/Program Files/IAR Systems/Embedded Workbench 7.5/arm/bin/iccarm.exe`, you set `IAR_PATH` to `C:/Program Files/IAR Systems/Embedded Workbench 7.5/arm`.
177
144
- `GCC_ARM_PATH`: The path to the *binary* directory of your GCC Arm Embedded Compiler installation. This should be the directory containing the binaries for `arm-none-eabi-gcc` and friends. For example, if your Gcc Arm Embedded toolchain gcc executable is in `/usr/bin/arm-none-eabi-gcc`, you set `GCC_ARM_PATH` to `/usr/bin`.
178
145
179
-
##### Compiler detection through the `PATH`
146
+
#### Compiler detection through the `PATH`
180
147
181
148
The `mbed compile` command checks your `PATH` for an executable that is part of the compiler suite in question. This check is the same as a shell would perform to find the executable on the command-line. When `mbed compile` finds the executable it is looking for, it prefaces the executable name with the path it found. Mbed CLI does not prefix any executable found for `GCC_ARM`.
182
149
183
-
##### Set environment variable
150
+
#### Set environment variable
184
151
185
152
Mbed CLI also detects compilers with specially named environment variables. These environment variables are the same as their corresponding configuration variable, with a prefix of `MBED_` added. For example, when configuring Arm Compiler 5, you set the `MBED_ARM_PATH` environment variable to the base directory of your Arm Compiler 5 installation.
186
153
187
-
##### Through `mbed_settings.py`
154
+
#### Through `mbed_settings.py`
188
155
189
156
Mbed CLI also uses `mbed_settings.py` to configure toolchains. This file must be a python module, and uses the exact same configuration variables as the Mbed CLI configuration.
190
157
191
158
<span class="notes">**Note:** Because `mbed_settings.py` contains local settings (possibly relevant only to a single OS on a single machine), you should not check it into version control.</span>
192
159
193
-
##### Optional: configuring multiple toolchains
160
+
#### Optional: configuring multiple toolchains
194
161
195
162
Mbed CLI has a few rules that allow you to seamlessly switch between different versions of the same toolchain when switching between different projects. The settings described in prior sections all can configure a different version of the same toolchain. When multiple settings are available for a single toolchain, Mbed CLI picks the most specific setting. The settings, from most specific to least specific are:
196
163
@@ -204,7 +171,7 @@ When resolving which setting is used for an individual `mbed compile` or `mbed t
204
171
205
172
To use a standard toolchain for general purpose development, you may use any method 3 through 5. For overriding a toolchain version for a specific project, you may use methods 1 and 2. All of these methods for configuring a toolchain may coexist.
206
173
207
-
#### Optional: add Bash tab completion
174
+
### Optional: add Bash tab completion
208
175
209
176
To install `mbed-cli` bash tab completion:
210
177
@@ -214,7 +181,7 @@ To install `mbed-cli` bash tab completion:
| `protocol` | The default protocol used for importing or cloning of programs and libraries. The possible values are `https`, `http` and `ssh`. Use `ssh` if you have generated and registered SSH keys (Public Key Authentication) with a service such as GitHub, GitLab, Bitbucket and so on. Read more about <a href="https://help.github.com/articles/generating-an-ssh-key/" target="_blank">SSH keys</a>. | Default: `https`. |
254
221
| `depth` | The *clone* depth for importing or cloning and applies only to *Git* repositories. Note that though this option may improve cloning speed, it may also prevent you from correctly checking out a dependency tree when the reference revision hash is older than the clone depth. Read more about <a href="https://git-scm.com/docs/git-clone" target="_blank">shallow clones</a>. | No default. |
255
222
| `cache` | The local path that stores small copies of the imported or cloned repositories. Mbed CLI uses it to minimize traffic and speed up future imports of the same repositories. Use `on` or `enabled` to turn on caching in the system temp path. Use `none` to turn caching off. | Default: none (disabled). |
0 commit comments