Skip to content

mbed CLI 0.7.x fixes #221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,23 +58,27 @@ This document covers the installation and usage of *mbed CLI*.

You can get the latest stable version of *mbed CLI* via PyPI by running:

``$ pip install mbed-cli``
```
$ pip install mbed-cli
```

Alternatively you get the development version of *mbed CLI* by cloning the development repository [https://github.com/ARMmbed/mbed-cli](https://github.com/ARMmbed/mbed-cli):

``$ git clone https://github.com/ARMmbed/mbed-cli``
`$ git clone https://github.com/ARMmbed/mbed-cli`

Once cloned you can install *mbed CLI* as a python package:

``$ python setup.py install`` (on Linux/Mac, you may need to run with ``sudo`` as well)
`$ python setup.py install` (on Linux/Mac, you may need to run with `sudo` as well)

<span class="tips">**Note:** *mbed CLI* is compatible with [Virtual Python Environment (virtualenv)](https://pypi.python.org/pypi/virtualenv). You can read more about isolated Python virtual environments [here](http://docs.python-guide.org/en/latest/).</span>

### Uninstalling mbed CLI

To uninstall *mbed CLI*, simply run:

``pip uninstall mbed-cli``
```
pip uninstall mbed-cli
```

## Using mbed CLI

Expand Down Expand Up @@ -291,19 +295,21 @@ Run `mbed update <tag_name|revision> --clean`

__When you have unpublished local libraries__

There are two additional options that define how unpublished local libraries are handled:
There are 3 additional options that define how unpublished local libraries are handled:

`mbed update --ignore` - update the current program or library and its dependencies, and ignore any local unpublished libraries (they won't be deleted or modified, just ignored).
`mbed update --clean-deps` - update the current program or library and its dependencies, and discard all local unpublished repositories. Use this with caution as your local unpublished repositories cannot be restored unless you have a backup copy.

`mbed update --clean-files` - update the current program or library and its dependencies, discard local uncommitted changes and remove any untracked or ignored files. Use this with caution as your local unpublished repositories cannot be restored unless you have a backup copy.

`mbed update --force` - update the current program or library and its dependencies, and discard all local unpublished repositories. Use this with caution as your local unpublished repositories cannot be restored unless you have a backup copy.
`mbed update --ignore` - update the current program or library and its dependencies, and ignore any local unpublished libraries (they won't be deleted or modified, just ignored).

__Combining update options__

You can combine the options above for the following scenarios:

`mbed update --clean --ignore` - update the current program or library and its dependencies, but ignore any local repositories. mbed-cli will update whatever it can from public repositories.
`mbed update --clean --clean-deps --clean-files` - update the current program or library and its dependencies, remove all local unpublished libraries, discard local uncommitted changes, and remove all untracked or ignored files. This wipes every single change that you made in the source tree and restores the stock layout.

`mbed update --clean --force` - update the current program or library and all its dependencies, and restore my source tree to stock layout. This wipes every change that you made in the source tree that didn't belong to the original commit, including uncommitted changes and unpublished local libraries.
`mbed update --clean --ignore` - update the current program or library and its dependencies, but ignore any local repositories. mbed CLI will update whatever it can from the public repositories.

Use these with caution as your uncommitted changes and unpublished libraries cannot be restored.

Expand Down Expand Up @@ -382,8 +388,8 @@ Through the workflow explained above, mbed CLI will maintain association to the

After importing a program or creating a new one, you need to tell *mbed CLI* where to find the toolchains that you want to use for compiling your source tree. *mbed CLI* gets this information from a file named `mbed_settings.py`, which is automatically created at the top of your cloned repository (if it doesn't already exist). As a rule, since `mbed_settings.py` contains local settings (possibly relevant only to a single OS on a single machine), it should not be versioned. In this file:

* If you want to use the [ARM Compiler toolchain](https://developer.arm.com/products/software-development-tools/compilers/arm-compiler-5/downloads), set ``ARM_PATH`` to the *base* directory of your ARMCC installation (example: c:\software\armcc5.06). The recommended version of the ARMCC toolchain is 5.06 (5.05 will very likely work too).
* If you want to use the [GCC ARM Embedded toolchain](https://launchpad.net/gcc-arm-embedded), set ``GCC_ARM_PATH`` to the *binary* directory of your GCC ARM installation (example: c:\software\GNUToolsARMEmbedded\4.82013q4\bin). Use versions 4.8 or 4.9 of GCC ARM Embedded, but version 5.0 or any version above might be incompatible with the tools.
* If you want to use the [ARM Compiler toolchain](https://developer.arm.com/products/software-development-tools/compilers/arm-compiler-5/downloads), set `ARM_PATH` to the *base* directory of your ARMCC installation (example: c:\software\armcc5.06). The recommended version of the ARMCC toolchain is 5.06 (5.05 will very likely work too).
* If you want to use the [GCC ARM Embedded toolchain](https://launchpad.net/gcc-arm-embedded), set `GCC_ARM_PATH` to the *binary* directory of your GCC ARM installation (example: c:\software\GNUToolsARMEmbedded\4.82013q4\bin). Use versions 4.8 or 4.9 of GCC ARM Embedded, but version 5.0 or any version above might be incompatible with the tools.

#### Compiling your program

Expand Down Expand Up @@ -511,7 +517,7 @@ ___Macros___

You can specify macros in your command line using the -D option. For example:

``$ mbed compile -t GCC_ARM -m K64F -c -DUVISOR_PRESENT``
`$ mbed compile -t GCC_ARM -m K64F -c -DUVISOR_PRESENT`

___Compiling in debug mode___

Expand All @@ -526,7 +532,7 @@ $ mbed compile -t GCC_ARM -m K64F -o debug-info

#### Automating toolchain and target selection

Using ``mbed target <target>`` and ``mbed toolchain <toolchain>`` you can set the default target and toolchain for your program, meaning you won't have to specify these every time you compile or generate IDE project files.
Using `mbed target <target>` and `mbed toolchain <toolchain>` you can set the default target and toolchain for your program, meaning you won't have to specify these every time you compile or generate IDE project files.

### Exporting to desktop IDEs

Expand All @@ -538,7 +544,7 @@ For example, to export to uVision run:
$ mbed export -i uvision -m K64F
```

A ``.uvproj`` file is created in the projectfiles/uvision folder. You can open the project file with uVision.
A `.uvproj` file is created in the projectfiles/uvision folder. You can open the project file with uVision.

### Testing

Expand Down Expand Up @@ -659,7 +665,7 @@ Test code exists in the following directory structure:

```
mbed-os-program
|- main.cpp # Optional main.cpp with ```main()``` if it is an application module.
|- main.cpp # Optional main.cpp with main() if it is an application module.
|- pqr.lib # Required libs
|- xyz.lib
|- mbed-os
Expand Down
Loading