Skip to content

Commit 43f2b10

Browse files
committed
Update README with Mbed CLI 2 instructions
1 parent cd169a7 commit 43f2b10

File tree

1 file changed

+33
-21
lines changed

1 file changed

+33
-21
lines changed

README.md

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,46 @@
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 PSA 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 requires the PSA Crypto API:
7+
* On TF-M targets, this API is provided by TF-M and always enabled.
8+
* On other targets, Mbed OS PSA can be enabled by adding `target.extra_labels_add": ["MBED_PSA_SRV"]`
9+
to `target_overrides` in [`getting-started/mbed_app.json`](./getting-started/mbed_app.json). Note that
10+
this cannot coexist with TF-M.
11+
12+
## Mbed OS build tools
13+
14+
### Mbed CLI 2
15+
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).
16+
1. [Install Mbed CLI 2](https://os.mbed.com/docs/mbed-os/latest/build-tools/install-or-upgrade.html).
17+
1. From the command-line, import the example: `mbed-tools import mbed-os-example-mbed-crypto`
18+
19+
### Mbed CLI 1
20+
1. [Install Mbed CLI 1](https://os.mbed.com/docs/mbed-os/latest/quick-start/offline-with-mbed-cli.html).
21+
1. From the command-line, import the example: `mbed import mbed-os-example-mbed-crypto`
22+
23+
## Building and running
24+
25+
1. Change the current directory to `mbed-os-example-mbed-crypto/getting-started`.
26+
1. Connect a USB cable between the USB port on the board and the host computer.
27+
1. Run the following command to build the example project, program the microcontroller flash memory and open a serial monitor:
1028

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`
29+
* Mbed CLI 2
1630

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`.
31+
```bash
32+
$ mbed-tools compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm
33+
```
2034

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

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.
37+
```bash
38+
$ mbed compile -m <TARGET> -t <TOOLCHAIN> --flash --sterm
39+
```
2640

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.
41+
Your PC may take a few minutes to compile your code.
3042

31-
The expected output from the first successful execution of the example program should be as follows:
43+
## Expected output
3244
```
3345
-- Begin Mbed Crypto Getting Started --
3446

0 commit comments

Comments
 (0)