Skip to content

Commit e114f3b

Browse files
Irit ArkinIrit Arkin
authored andcommitted
Mbed CLI experiments
1 parent a6b61bb commit e114f3b

File tree

2 files changed

+67
-97
lines changed

2 files changed

+67
-97
lines changed

docs.json

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -551,41 +551,48 @@
551551
},
552552
{
553553
"title": "Arm Mbed CLI",
554-
"sources": [{
555-
"type": "markdown",
556-
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/cli.md"
557-
},
558-
{
559-
"type": "markdown",
560-
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/cli-setup.md"
561-
},
562-
{
563-
"type": "markdown",
564-
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/cli-create.md"
565-
},
566-
{
567-
"type": "markdown",
568-
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/cli-collaborate.md"
569-
},
570-
{
571-
"type": "markdown",
572-
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/cli-test-debug.md"
573-
},
574-
{
575-
"type": "markdown",
576-
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/mbedignore.md"
577-
},
578-
{
579-
"type": "markdown",
580-
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/build_profiles.md"
581-
},
582-
{
583-
"type": "markdown",
584-
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/debug_builds_cli.md"
554+
"intro": {
555+
"type": "markdown",
556+
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/cli.md"
557+
},
558+
"sub_chapters": [{
559+
"title": "Setting up Mbed CLI",
560+
"sources": [{
561+
"type": "markdown",
562+
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/cli-setup.md"
563+
}]
585564
},
586565
{
587-
"type": "markdown",
588-
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/toolchain_profiles.md"
566+
"title": "Working with Mbed CLI",
567+
"sources": [{
568+
"type": "markdown",
569+
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/cli-create.md"
570+
},
571+
{
572+
"type": "markdown",
573+
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/cli-collaborate.md"
574+
},
575+
{
576+
"type": "markdown",
577+
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/cli-test-debug.md"
578+
},
579+
{
580+
"type": "markdown",
581+
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/mbedignore.md"
582+
},
583+
{
584+
"type": "markdown",
585+
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/build_profiles.md"
586+
},
587+
{
588+
"type": "markdown",
589+
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/debug_builds_cli.md"
590+
},
591+
{
592+
"type": "markdown",
593+
"url": "https://github.com/ARMmbed/Handbook/blob/new_engine/docs/tools/offline/toolchain_profiles.md"
594+
}
595+
]
589596
}
590597
]
591598
},

docs/tools/offline/cli-setup.md

Lines changed: 27 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
21
## Setup
32

43
You can install Mbed CLI on Windows, Linux and Mac OS X.
54

65
<span class="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>
76

8-
### Requirements
7+
## Requirements
98

109
- **Python:** Mbed CLI is a Python script, so you'll need Python to use it:
1110
- We test Mbed CLI with <a href="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
3332
3433
You may want to install Mbed CLI on a virtual environment if your main environment has an unsupported Python version.
3534
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>:
49-
50-
```
51-
$ git clone https://github.com/ARMmbed/mbed-cli
52-
```
53-
54-
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`.
6135
62-
#### Windows installer for Mbed CLI
36+
## Installing with the Windows installer
6337
6438
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).
6539
40+
### Included components
41+
6642
The Windows installer for Mbed CLI includes the following components:
6743
6844
- **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:
7349
- **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>.
7450
- **Mbed Windows serial port driver** - <a href="/docs/v5.7/tutorials/windows-serial-driver.html" target="_blank">serial port driver</a>.
7551
76-
##### Install Windows installer for Mbed CLI
52+
### Running the installer
7753
7854
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>.
7955
2. Run `mbed_installer_v042.exe`.
@@ -83,68 +59,59 @@ The Windows installer for Mbed CLI includes the following components:
8359
- Advanced: Allows you to select components.
8460
5. Installer installs all selected components. Close it after it finishes.
8561
86-
###### Silent install
62+
### Optional: silent install
8763
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.
8965
9066
```
9167
$ mbed_installer_{version}.exe /S
9268
```
9369
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-
```
10870
10971
4. Check <a href="https://github.com/ARMmbed/mbed-cli" target="_blank">Mbed CLI</a> for more examples.
72+
## Manual installation
11073
111-
### Installing Mbed CLI standalone stable version
74+
### Installing the stable version
11275
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:
11477
11578
```
11679
$ pip install mbed-cli
11780
```
11881
11982
On Linux or Mac, you may need to run with `sudo`.
12083
121-
#### Optional: installing the development version
84+
### Optional: installing the development version
12285
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>:
12487
12588
```
12689
$ git clone https://github.com/ARMmbed/mbed-cli
12790
```
12891
129-
Once you have cloned the repository, you can install Mbed CLI as a Python package:
92+
Once cloned, you can install Mbed CLI as a Python package:
13093
13194
```
13295
$ python setup.py install
13396
```
13497
13598
On Linux or Mac, you may need to run with `sudo`.
13699
137-
### Configuring Mbed CLI
100+
### Video tutorial for manual installation
101+
102+
<span class="images">[![Video tutorial](https://img.youtube.com/vi/cM0dFoTuU14/0.jpg)](https://www.youtube.com/watch?v=cM0dFoTuU14)</span>
103+
104+
## Configuring Mbed CLI
138105
139106
There are some configuration that you must set before you can work with Mbed CLI.
140107
141-
#### Mandatory: setting PATH variables
108+
### Mandatory: setting PATH variables
142109
143110
Mbed CLI requires adding the following to the system `PATH`:
144111
145112
- The paths for the Git and Mercurial executables (`git` and `hg`).
146113
147-
#### Mandatory: toolchain selection
114+
### Mandatory: toolchain selection
148115
149116
You need to tell Mbed CLI where to find the toolchains that you want to use for compiling. Mbed CLI supports the following toolchains:
150117
@@ -159,7 +126,7 @@ You must inform Mbed CLI about the location of your compiler using one of the fo
159126
- Setting an environment variable.
160127
- The `mbed_settings.py` file in the root of your program. The tools will automatically create this file if it doesn't already exist.
161128
162-
##### Through Mbed CLI configuration
129+
#### Through Mbed CLI configuration
163130
164131
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:
165132
@@ -176,21 +143,21 @@ Mbed CLI supports a setting for each toolchain path. Below is a list of these se
176143
- `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`.
177144
- `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`.
178145
179-
##### Compiler detection through the `PATH`
146+
#### Compiler detection through the `PATH`
180147
181148
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`.
182149
183-
##### Set environment variable
150+
#### Set environment variable
184151
185152
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.
186153
187-
##### Through `mbed_settings.py`
154+
#### Through `mbed_settings.py`
188155
189156
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.
190157
191158
<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>
192159
193-
##### Optional: configuring multiple toolchains
160+
#### Optional: configuring multiple toolchains
194161
195162
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:
196163
@@ -204,7 +171,7 @@ When resolving which setting is used for an individual `mbed compile` or `mbed t
204171
205172
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.
206173
207-
#### Optional: add Bash tab completion
174+
### Optional: add Bash tab completion
208175
209176
To install `mbed-cli` bash tab completion:
210177
@@ -214,7 +181,7 @@ To install `mbed-cli` bash tab completion:
214181
215182
<a href="https://github.com/ARMmbed/mbed-cli/blob/master/tools/bash_completion/install.md" target="_blank">Full documentation</a>
216183
217-
#### Working with `mbed config`
184+
### Working with `mbed config`
218185
219186
The Mbed CLI configuration syntax is:
220187
@@ -253,7 +220,3 @@ Available configurations:
253220
| `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`. |
254221
| `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. |
255222
| `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). |
256-
257-
### Video tutorial for manual installation
258-
259-
<span class="images">[![Video tutorial](https://img.youtube.com/vi/cM0dFoTuU14/0.jpg)](https://www.youtube.com/watch?v=cM0dFoTuU14)</span>

0 commit comments

Comments
 (0)