Skip to content

Commit 6812274

Browse files
committed
Update README with Mbed CLI 2 instructions
1 parent 487254b commit 6812274

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

README.md

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,43 @@
11
![](./resources/official_armmbed_example_badge.png)
22
# Running Mbed Crypto examples on Mbed OS
3-
This repository contains a set of examples demonstrating the compilation and use of Mbed Crypto on Mbed OS.
4-
5-
List of examples contained within this repository:
6-
* Example code snippets for using the library, with [documentation](https://github.com/ARMmbed/mbed-crypto/blob/development/docs/getting_started.md).
3+
This repository contains an example demonstrating the compilation and use of Mbed Crypto on Mbed OS.
74

85
## Prerequisites
9-
* Install <a href='https://github.com/ARMmbed/mbed-cli#installing-mbed-cli'>Mbed CLI</a>
6+
This example enables Mbed OS PSA. It is compatible with **non-TF-M** targets, as TF-M has its own PSA implementation
7+
(e.g. Arm TrustZone on Arm v8-M) which cannot coexist with Mbed OS PSA.
8+
9+
## Mbed OS build tools
10+
11+
### Mbed CLI 2
12+
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).
13+
1. [Install Mbed CLI 2](https://os.mbed.com/docs/mbed-os/latest/build-tools/install-or-upgrade.html).
14+
1. From the command-line, import the example: `mbed-tools import mbed-os-example-mbed-crypto`
15+
16+
### Mbed CLI 1
17+
1. [Install Mbed CLI 1](https://os.mbed.com/docs/mbed-os/latest/quick-start/offline-with-mbed-cli.html).
18+
1. From the command-line, import the example: `mbed import mbed-os-example-mbed-crypto`
19+
20+
## Building and running
21+
22+
1. Change the current directory to `mbed-os-example-mbed-crypto/getting-started`.
23+
1. Connect a USB cable between the USB port on the board and the host computer.
24+
1. Run the following command to build the example project, program the microcontroller flash memory and open a serial monitor:
1025

11-
## Import
12-
The following are the steps required to install the application:
13-
1. Clone the repository: `git clone https://github.com/ARMmbed/mbed-os-example-mbed-crypto.git`
14-
1. Navigate to the "getting-started" example: `cd mbed-os-example-mbed-crypto/getting-started`
15-
1. Deploy the Mbed OS project: `mbed deploy`
26+
* Mbed CLI 2
1627

17-
## Compile
18-
To compile the example program use `mbed compile` while specifying the target platform and the compiler.
19-
For example, in order to compile using the ARM GCC compiler and a K64F target platform use: `mbed compile -m K64F -t GCC_ARM`.
28+
```bash
29+
$ mbed-tools compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm
30+
```
2031

21-
Once the compilation is completed successfully a binary file will be created: `./BUILD/K64F/GCC_ARM/getting-started.bin`
32+
* Mbed CLI 1
2233

23-
## Program your board
24-
1. Connect your Mbed device to the computer over USB.
25-
1. Copy the binary file (`getting-started.bin`) to the Mbed device.
34+
```bash
35+
$ mbed compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm
36+
```
2637

27-
## Run
28-
1. Connect to the Mbed Device using a serial client application of your choice.
29-
1. Press the reset button on the Mbed device to run the program.
38+
Your PC may take a few minutes to compile your code.
3039

31-
The expected output from the first successful execution of the example program should be as follows:
40+
## Expected output
3241
```
3342
-- Begin Mbed Crypto Getting Started --
3443

0 commit comments

Comments
 (0)