Skip to content

Commit 2072de4

Browse files
committed
Add instructions for Mbed CLI 2
1 parent 1c3cc9d commit 2072de4

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

README.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,18 @@ The example project is part of the [Arm Mbed OS Official Examples](https://os.mb
77
You can build the project with all supported [Mbed OS build tools](https://os.mbed.com/docs/mbed-os/latest/tools/index.html). However, this example project specifically refers to the command-line interface tool [Arm Mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
88
(Note: To see a rendered example you can import into the Arm Online Compiler, please see our [import quick start](https://os.mbed.com/docs/mbed-os/latest/quick-start/online-with-the-online-compiler.html#importing-the-code).)
99

10-
## Downloading this project
11-
1. [Install Mbed CLI](https://os.mbed.com/docs/mbed-os/latest/quick-start/offline-with-mbed-cli.html).
10+
## Mbed OS build tools
1211

13-
1. Clone this repository on your system, and change the current directory to where the project was cloned:
14-
15-
```
16-
$ git clone https://github.com/ARMmbed/mbed-os-example-for-aws.git && cd mbed-os-example-for-aws
17-
$ mbed deploy
18-
```
19-
20-
Alternatively, you can download the example project with Arm Mbed CLI using the `import` subcommand:
21-
22-
```
23-
$ mbed import mbed-os-example-for-aws && cd mbed-os-example-for-aws
24-
```
12+
### Mbed CLI 2
13+
Starting with version 6.5, Mbed OS uses Mbed CLI 2. It uses Ninja as a build system, and CMake to generate the build environment and manage the build process in a compiler-independent manner. If you are working with Mbed OS version prior to 6.5 then check the section [Mbed CLI 1](#mbed-cli-1).
14+
1. [Install Mbed CLI 2](https://os.mbed.com/docs/mbed-os/latest/build-tools/install-or-upgrade.html).
15+
1. From the command-line, import the example: `mbed-tools import mbed-os-example-for-aws`
16+
1. Change the current directory to where the project was imported.
2517

18+
### Mbed CLI 1
19+
1. [Install Mbed CLI 1](https://os.mbed.com/docs/mbed-os/latest/quick-start/offline-with-mbed-cli.html).
20+
1. From the command-line, import the example: `mbed import mbed-os-example-for-aws`
21+
1. Change the current directory to where the project was imported.
2622

2723
## Configuring the AWS IoT Core service
2824

@@ -71,12 +67,23 @@ You can build the project with all supported [Mbed OS build tools](https://os.mb
7167
1. Connect a USB cable between the USB port on the board and the host computer.
7268
7369
1. <a name="build_cmd"></a> Run the following command to build the example project, program the microcontroller flash memory, and open a serial terminal:
70+
71+
* Mbed CLI 2
72+
73+
```bash
74+
$ mbed-tools compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm --baudrate=115200
7475
```
75-
$ mbed compile -m detect -t <TOOLCHAIN> --flash --sterm --baud 115200
76+
77+
* Mbed CLI 1
78+
79+
```bash
80+
$ mbed compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm --baudrate=115200
7681
```
7782
7883
Alternatively, you can manually copy the binary to the board, which you mount on the host computer over USB.
79-
The binary is located at `./BUILD/<TARGET>/<TOOLCHAIN>/mbed-os-example-for-aws.bin`.
84+
The binary is located at:
85+
* **Mbed CLI 2** - `./cmake_build/<TARGET>/<PROFILE>/<TOOLCHAIN>/mbed-os-example-for-aws.bin`</br>
86+
* **Mbed CLI 1** - `./BUILD/<TARGET>/<TOOLCHAIN>/mbed-os-example-for-aws.bin`
8087
8188
Depending on the target, you can build the example project with the `GCC_ARM` or `ARM` toolchain. Run the command below to determine which toolchain supports your target:
8289

0 commit comments

Comments
 (0)